hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f76d362e961f88bf0c6a5bcefbb108fce54b6bbc | 1,782 | py | Python | backtest/simulator.py | geisten/bot | 76d4aef279cd168f6cbf7994055c1d289329e49c | [
"MIT"
] | null | null | null | backtest/simulator.py | geisten/bot | 76d4aef279cd168f6cbf7994055c1d289329e49c | [
"MIT"
] | null | null | null | backtest/simulator.py | geisten/bot | 76d4aef279cd168f6cbf7994055c1d289329e49c | [
"MIT"
] | null | null | null | """Create and save random price data"""
from random import random
import os
from datetime import datetime, timedelta
import pandas as pd # type: ignore
def random_walker(data_length: int):
"""Create a random walk data list"""
# seed(1)
random_walk = list()
random_walk.append(-1 if random() < 0.5 else... | 31.821429 | 80 | 0.627946 | from random import random
import os
from datetime import datetime, timedelta
import pandas as pd
def random_walker(data_length: int):
random_walk = list()
random_walk.append(-1 if random() < 0.5 else 1) for i in range(0, data_length):
movement = -1 if random() < 0.5 else 1 value = r... | true | true |
f76d370b3e2a9bc365c99aa4c20a4610f4cf3ea2 | 419 | py | Python | models/abstract_statistics.py | Yokto13/Sphinx | afb174f0b849658eca081c230d8fbbe875928b1b | [
"MIT"
] | 3 | 2022-01-15T10:11:32.000Z | 2022-01-26T16:29:24.000Z | models/abstract_statistics.py | Yokto13/Sphinx | afb174f0b849658eca081c230d8fbbe875928b1b | [
"MIT"
] | 1 | 2022-02-14T09:04:27.000Z | 2022-02-14T09:04:27.000Z | models/abstract_statistics.py | Yokto13/Sphinx | afb174f0b849658eca081c230d8fbbe875928b1b | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
class AbstractStatistcs(ABC):
@abstractmethod
def __init__(self, *args):
# Args can be used for building from dumped strings.
# Init needs to implement load from string.
pass
@abstractmethod
def __str__(self):
pass
@abstractmeth... | 19.045455 | 60 | 0.627685 | from abc import ABC, abstractmethod
class AbstractStatistcs(ABC):
@abstractmethod
def __init__(self, *args):
pass
@abstractmethod
def __str__(self):
pass
@abstractmethod
def dump(self):
pass
@abstractmethod
def update(self, *args):
pas... | true | true |
f76d3752011667612146944f220c5938e7ab3d97 | 764 | py | Python | Bioinformatics IV/Week IV/SpectrumGraph.py | egeulgen/Bioinformatics_Specialization | 38581b471a54c41d780d9eeb26a7033eb57f3a01 | [
"MIT"
] | 3 | 2021-04-03T23:46:42.000Z | 2021-08-08T01:19:32.000Z | Bioinformatics IV/Week IV/SpectrumGraph.py | egeulgen/Bioinformatics_Specialization | 38581b471a54c41d780d9eeb26a7033eb57f3a01 | [
"MIT"
] | null | null | null | Bioinformatics IV/Week IV/SpectrumGraph.py | egeulgen/Bioinformatics_Specialization | 38581b471a54c41d780d9eeb26a7033eb57f3a01 | [
"MIT"
] | null | null | null | import sys
mass_file=open('integer_mass_table.txt')
mass_table = {}
for line in mass_file:
aa, mass = line.rstrip().split(' ')
mass_table[int(mass)] = aa
def SpectrumGraph(spectrum):
adj_list = []
for i in range(len(spectrum)):
for j in range(i, len(spectrum)):
if spectrum[j] - sp... | 30.56 | 98 | 0.608639 | import sys
mass_file=open('integer_mass_table.txt')
mass_table = {}
for line in mass_file:
aa, mass = line.rstrip().split(' ')
mass_table[int(mass)] = aa
def SpectrumGraph(spectrum):
adj_list = []
for i in range(len(spectrum)):
for j in range(i, len(spectrum)):
if spectrum[j] - sp... | true | true |
f76d390a00e12ede5fce65795c2c7afca211555d | 1,457 | py | Python | py/pyis-onnx/tests/test_transpiler/test_resolve_function.py | microsoft/python-inference-script | cbbbe9d16be0839e4df357b1bd9e8274ca44f1f7 | [
"MIT"
] | 5 | 2021-11-29T01:49:22.000Z | 2022-02-23T10:26:46.000Z | py/pyis-onnx/tests/test_transpiler/test_resolve_function.py | microsoft/python-inference-script | cbbbe9d16be0839e4df357b1bd9e8274ca44f1f7 | [
"MIT"
] | 1 | 2021-11-01T02:22:32.000Z | 2021-11-01T02:22:32.000Z | py/pyis-onnx/tests/test_transpiler/test_resolve_function.py | microsoft/python-inference-script | cbbbe9d16be0839e4df357b1bd9e8274ca44f1f7 | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT license.
import unittest
import ast
from textwrap import dedent
import inspect
from typing import List, Tuple
from pyis.onnx.transpiler.passes.type_infer import TypeInfer
from pyis.onnx.transpiler.ast_printer import pformat_ast
class... | 26.490909 | 62 | 0.551132 |
import unittest
import ast
from textwrap import dedent
import inspect
from typing import List, Tuple
from pyis.onnx.transpiler.passes.type_infer import TypeInfer
from pyis.onnx.transpiler.ast_printer import pformat_ast
class SubModel:
def __init__(self) -> None:
pass
def run(self, q: str) -> Tupl... | true | true |
f76d39847eb920ff23ea172a0540a21e34cf8616 | 16,618 | py | Python | rllib/agents/ars/ars.py | aseaday/ray | 673ecd1241934c644bca7cf92cb5c55a993b5e51 | [
"Apache-2.0"
] | 1 | 2022-03-14T04:24:17.000Z | 2022-03-14T04:24:17.000Z | rllib/agents/ars/ars.py | aseaday/ray | 673ecd1241934c644bca7cf92cb5c55a993b5e51 | [
"Apache-2.0"
] | null | null | null | rllib/agents/ars/ars.py | aseaday/ray | 673ecd1241934c644bca7cf92cb5c55a993b5e51 | [
"Apache-2.0"
] | null | null | null | # Code in this file is copied and adapted from
# https://github.com/openai/evolution-strategies-starter and from
# https://github.com/modestyachts/ARS
from collections import namedtuple
import logging
import numpy as np
import random
import time
import ray
from ray.rllib.agents import Trainer, with_common_config
from... | 36.363239 | 87 | 0.629197 |
from collections import namedtuple
import logging
import numpy as np
import random
import time
import ray
from ray.rllib.agents import Trainer, with_common_config
from ray.rllib.agents.ars.ars_tf_policy import ARSTFPolicy
from ray.rllib.agents.es import optimizers, utils
from ray.rllib.agents.es.es_tf_policy import r... | true | true |
f76d39a136fdb0cc15325d1a14c495906ddf7851 | 2,646 | py | Python | livia_ui/gui/views/utils/SelectDeviceDialog.py | sing-group/livia-ui | 809d90d4429bdd48ad2b8bf6b9546b7ea0ca6dcf | [
"MIT"
] | null | null | null | livia_ui/gui/views/utils/SelectDeviceDialog.py | sing-group/livia-ui | 809d90d4429bdd48ad2b8bf6b9546b7ea0ca6dcf | [
"MIT"
] | null | null | null | livia_ui/gui/views/utils/SelectDeviceDialog.py | sing-group/livia-ui | 809d90d4429bdd48ad2b8bf6b9546b7ea0ca6dcf | [
"MIT"
] | null | null | null | from PySide2.QtCore import Qt, QCoreApplication
from PySide2.QtGui import QShowEvent
from PySide2.QtWidgets import QDialog, QDialogButtonBox, QVBoxLayout, QFormLayout, QLabel, QComboBox, \
QWidget, QSizePolicy
from livia.input.DeviceFrameInput import Device
from livia_ui.gui.views.utils.DevicePanel import DevicePa... | 37.267606 | 103 | 0.719577 | from PySide2.QtCore import Qt, QCoreApplication
from PySide2.QtGui import QShowEvent
from PySide2.QtWidgets import QDialog, QDialogButtonBox, QVBoxLayout, QFormLayout, QLabel, QComboBox, \
QWidget, QSizePolicy
from livia.input.DeviceFrameInput import Device
from livia_ui.gui.views.utils.DevicePanel import DevicePa... | true | true |
f76d39b1f76e73255f44cf8f410b243f06bbc3fa | 8,586 | py | Python | pdc/apps/compose/serializers.py | bliuredhat/PDC | 48c7761d360225d6f4073adc2e7938348844e909 | [
"MIT"
] | 1 | 2018-05-02T08:39:37.000Z | 2018-05-02T08:39:37.000Z | pdc/apps/compose/serializers.py | bliuredhat/PDC | 48c7761d360225d6f4073adc2e7938348844e909 | [
"MIT"
] | null | null | null | pdc/apps/compose/serializers.py | bliuredhat/PDC | 48c7761d360225d6f4073adc2e7938348844e909 | [
"MIT"
] | null | null | null | #
# Copyright (c) 2015 Red Hat
# Licensed under The MIT License (MIT)
# http://opensource.org/licenses/MIT
#
from rest_framework import serializers, fields
from rest_framework.reverse import reverse
from pdc.apps.common.models import Arch
from pdc.apps.common.serializers import StrictSerializerMixin, DynamicFieldsSeri... | 46.410811 | 122 | 0.631726 | from rest_framework import serializers, fields
from rest_framework.reverse import reverse
from pdc.apps.common.models import Arch
from pdc.apps.common.serializers import StrictSerializerMixin, DynamicFieldsSerializerMixin
from pdc.apps.common.fields import ChoiceSlugField
from .models import (Compose, OverrideRPM, Com... | true | true |
f76d39dce3b3749fc0372844175886fe1dde2788 | 304 | py | Python | momochess/__init__.py | MomoStudios/MomoChess | eb8239b2effafd8eb6b408254a0484659d9ee4b6 | [
"MIT"
] | null | null | null | momochess/__init__.py | MomoStudios/MomoChess | eb8239b2effafd8eb6b408254a0484659d9ee4b6 | [
"MIT"
] | null | null | null | momochess/__init__.py | MomoStudios/MomoChess | eb8239b2effafd8eb6b408254a0484659d9ee4b6 | [
"MIT"
] | null | null | null | from flask import Flask, render_template, request
from flask_sqlalchemy import SQLAlchemy
from momochess.routes import create_routes
def create_app():
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql://localhost/momochess'
db = SQLAlchemy(app)
return create_routes(app)
| 30.4 | 76 | 0.796053 | from flask import Flask, render_template, request
from flask_sqlalchemy import SQLAlchemy
from momochess.routes import create_routes
def create_app():
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql://localhost/momochess'
db = SQLAlchemy(app)
return create_routes(app)
| true | true |
f76d3b76a7e2d9477855f7731c15b91135b733a7 | 603 | py | Python | algorithms/calculator/reverse_polish_notation/digit.py | VallyWonka/programming-for-linguists | a1f2fe30fb776efd17d1d8a346d8b7d5b92d7396 | [
"Apache-2.0"
] | null | null | null | algorithms/calculator/reverse_polish_notation/digit.py | VallyWonka/programming-for-linguists | a1f2fe30fb776efd17d1d8a346d8b7d5b92d7396 | [
"Apache-2.0"
] | null | null | null | algorithms/calculator/reverse_polish_notation/digit.py | VallyWonka/programming-for-linguists | a1f2fe30fb776efd17d1d8a346d8b7d5b92d7396 | [
"Apache-2.0"
] | 4 | 2021-02-09T12:00:34.000Z | 2021-05-21T18:59:38.000Z | """
Programming for linguists
Interfaces for digits
"""
from typing import Union
from algorithms.calculator.reverse_polish_notation.element import Element
class Digit(Element):
"""
Interface for presenting a digit
"""
def __init__(self, digit_as_string: Union[float, str]):
print(digit_as_st... | 20.793103 | 73 | 0.638474 | from typing import Union
from algorithms.calculator.reverse_polish_notation.element import Element
class Digit(Element):
def __init__(self, digit_as_string: Union[float, str]):
print(digit_as_string)
self.digit = None
def __str__(self) -> str:
def __eq__(self, other: 'Digit') -> bool:
| true | true |
f76d3bb862f34deedac172cb15155cdfc658d419 | 977 | py | Python | engine.py | riotu-lab/tf2trt_with_onnx | f9828ed99af5530836bf6ee608e631502dfb0f02 | [
"MIT"
] | 12 | 2020-10-08T21:59:28.000Z | 2022-02-05T00:13:41.000Z | engine.py | riotu-lab/tf2trt_with_onnx | f9828ed99af5530836bf6ee608e631502dfb0f02 | [
"MIT"
] | 3 | 2020-11-19T15:13:17.000Z | 2022-03-07T06:54:45.000Z | engine.py | riotu-lab/tf2trt_with_onnx | f9828ed99af5530836bf6ee608e631502dfb0f02 | [
"MIT"
] | 7 | 2020-10-08T21:59:13.000Z | 2022-01-20T06:37:15.000Z | import tensorrt as trt
TRT_LOGGER = trt.Logger(trt.Logger.INTERNAL_ERROR)
def build_engine(onnx_path, shape = [1,224,224,3]):
"""
This is the function to create the TensorRT engine
Args:
onnx_path : Path to onnx_file.
shape : Shape of the input of the ONNX file.
"""
with trt.Builder(TRT_LO... | 33.689655 | 128 | 0.68782 | import tensorrt as trt
TRT_LOGGER = trt.Logger(trt.Logger.INTERNAL_ERROR)
def build_engine(onnx_path, shape = [1,224,224,3]):
with trt.Builder(TRT_LOGGER) as builder, builder.create_network(1) as network, trt.OnnxParser(network, TRT_LOGGER) as parser:
builder.max_workspace_size = (256 << 20)
with ope... | true | true |
f76d3d2c735a791925a56cdf27d0bbb187c77bd3 | 404 | py | Python | synthesis/synthesizers/__init__.py | sahilk15/synthetic_data_generation | 06676d15821fc5ce27464a46d294fd3bb484ecfa | [
"MIT"
] | 4 | 2021-02-16T00:38:27.000Z | 2022-01-21T21:59:28.000Z | synthesis/synthesizers/__init__.py | Daan0/synthetic_data_generation | 5a0d1818cba2bc8b629869773a2f86a156d25fd9 | [
"MIT"
] | 2 | 2021-08-20T14:32:59.000Z | 2022-03-18T10:15:40.000Z | synthesis/synthesizers/__init__.py | Daan0/synthetic_data_generation | 5a0d1818cba2bc8b629869773a2f86a156d25fd9 | [
"MIT"
] | 5 | 2020-12-08T05:01:39.000Z | 2022-03-24T18:12:45.000Z | """Algorithms for generating synthetic data"""
from synthesis.synthesizers.marginal import MarginalSynthesizer, UniformSynthesizer
from synthesis.synthesizers.contingency import ContingencySynthesizer
from synthesis.synthesizers.privbayes import PrivBayes, PrivBayesFix
__all__ = [
'MarginalSynthesizer',
'Unif... | 31.076923 | 83 | 0.80198 |
from synthesis.synthesizers.marginal import MarginalSynthesizer, UniformSynthesizer
from synthesis.synthesizers.contingency import ContingencySynthesizer
from synthesis.synthesizers.privbayes import PrivBayes, PrivBayesFix
__all__ = [
'MarginalSynthesizer',
'UniformSynthesizer',
'ContingencySynthesizer',
... | true | true |
f76d3f19ad424ec93a3ef6e33240641614924c31 | 4,657 | py | Python | test/functional/rpc_net.py | ConneXdev/ConneX | 2a67367ef9e28109a536d5d6e4ddc11e4831022c | [
"MIT"
] | null | null | null | test/functional/rpc_net.py | ConneXdev/ConneX | 2a67367ef9e28109a536d5d6e4ddc11e4831022c | [
"MIT"
] | null | null | null | test/functional/rpc_net.py | ConneXdev/ConneX | 2a67367ef9e28109a536d5d6e4ddc11e4831022c | [
"MIT"
] | 2 | 2019-04-21T10:35:41.000Z | 2020-05-07T09:06:43.000Z | #!/usr/bin/env python3
# Copyright (c) 2017-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test RPC calls related to net.
Tests correspond to code in rpc/net.cpp.
"""
from test_framework.test_... | 46.108911 | 134 | 0.694009 |
from test_framework.test_framework import CONNEXTestFramework
from test_framework.util import (
assert_equal,
assert_greater_than_or_equal,
assert_raises_rpc_error,
connect_nodes_bi,
p2p_port,
wait_until,
)
class NetTest(CONNEXTestFramework):
def set_test_params(self):
self.setup_c... | true | true |
f76d3f48169109e7bc7b0642bb1680c022d6da72 | 271 | py | Python | website/models.py | monuyadav016/GEWA-Wallet | af615f94b90627e96b8d430429ba5f7d67181d1d | [
"MIT"
] | 1 | 2020-05-25T15:02:53.000Z | 2020-05-25T15:02:53.000Z | website/models.py | monuyadav016/GEWA-Wallet | af615f94b90627e96b8d430429ba5f7d67181d1d | [
"MIT"
] | 6 | 2021-03-19T00:22:32.000Z | 2021-09-22T18:40:08.000Z | website/models.py | monuyadav016/GEWA-Wallet | af615f94b90627e96b8d430429ba5f7d67181d1d | [
"MIT"
] | 1 | 2020-04-27T08:55:44.000Z | 2020-04-27T08:55:44.000Z | from django.db import models
class ContactPage(models.Model):
name = models.CharField(max_length=50, unique=False)
email = models.EmailField()
message = models.CharField(max_length=500)
def __str__(self):
return "{0}'s Message".format(self.name) | 30.111111 | 56 | 0.708487 | from django.db import models
class ContactPage(models.Model):
name = models.CharField(max_length=50, unique=False)
email = models.EmailField()
message = models.CharField(max_length=500)
def __str__(self):
return "{0}'s Message".format(self.name) | true | true |
f76d40116c7a22d14376a20c987dae89420d4e59 | 4,749 | py | Python | 2_mnist_AGN/main.py | Little-gg/tensorflow_learn | 3cb017e5745a20482d5e192a6840aac750e4c567 | [
"MIT"
] | null | null | null | 2_mnist_AGN/main.py | Little-gg/tensorflow_learn | 3cb017e5745a20482d5e192a6840aac750e4c567 | [
"MIT"
] | null | null | null | 2_mnist_AGN/main.py | Little-gg/tensorflow_learn | 3cb017e5745a20482d5e192a6840aac750e4c567 | [
"MIT"
] | null | null | null | #/usr/bin/env python
# encoding: utf-8
import numpy as np
import sklearn.preprocessing as prep
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
def xavier_init(fan_in, fan_out, constant = 1):
low = -constant * np.sqrt(6.0 / (fan_in + fan_out))
high = constant * np.sqrt(6.0 /... | 37.992 | 75 | 0.599495 |
import numpy as np
import sklearn.preprocessing as prep
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
def xavier_init(fan_in, fan_out, constant = 1):
low = -constant * np.sqrt(6.0 / (fan_in + fan_out))
high = constant * np.sqrt(6.0 / (fan_in + fan_out))
return tf.rand... | true | true |
f76d40282a53d174f61b9159917b840ca3422787 | 928 | py | Python | pcm/interactive_runner.py | kojinho10/pcm | 85bcf805b9e9ed05c3babfe42acc7771ce57971b | [
"MIT"
] | 4 | 2019-06-05T14:21:29.000Z | 2021-04-25T19:36:47.000Z | pcm/interactive_runner.py | kojinho10/CPP | 85bcf805b9e9ed05c3babfe42acc7771ce57971b | [
"MIT"
] | 42 | 2018-04-24T15:43:05.000Z | 2021-06-08T07:48:32.000Z | pcm/interactive_runner.py | kojinho10/CPP | 85bcf805b9e9ed05c3babfe42acc7771ce57971b | [
"MIT"
] | null | null | null | import subprocess
import sys
import threading
class SubprocessThread(threading.Thread):
def __init__(
self,
args,
stdin_pipe=subprocess.PIPE,
stdout_pipe=subprocess.PIPE,
stderr_pipe=subprocess.PIPE,
timeout=2,
):
threading.Thread.__init__(self)
... | 30.933333 | 176 | 0.645474 | import subprocess
import sys
import threading
class SubprocessThread(threading.Thread):
def __init__(
self,
args,
stdin_pipe=subprocess.PIPE,
stdout_pipe=subprocess.PIPE,
stderr_pipe=subprocess.PIPE,
timeout=2,
):
threading.Thread.__init__(self)
... | true | true |
f76d41e9204edb47f34d36e84cf4bad007563b31 | 418 | py | Python | configs/hrnet/fcn_hr48_512x1024_40k_cityscapes.py | Xlinford/mmsegmentation | 8b444de5e6db2af2538a73a93ac75204f5c3bb2f | [
"Apache-2.0"
] | null | null | null | configs/hrnet/fcn_hr48_512x1024_40k_cityscapes.py | Xlinford/mmsegmentation | 8b444de5e6db2af2538a73a93ac75204f5c3bb2f | [
"Apache-2.0"
] | null | null | null | configs/hrnet/fcn_hr48_512x1024_40k_cityscapes.py | Xlinford/mmsegmentation | 8b444de5e6db2af2538a73a93ac75204f5c3bb2f | [
"Apache-2.0"
] | null | null | null | _base_ = './fcn_hr18_512x1024_40k_cityscapes.py'
model = dict(
pretrained='open-mmlab://msra/hrnetv2_w48',
backbone=dict(
extra=dict(
stage2=dict(num_channels=(48, 96)),
stage3=dict(num_channels=(48, 96, 192)),
stage4=dict(num_channels=(48, 96, 192, 384)))),
... | 38 | 75 | 0.593301 | _base_ = './fcn_hr18_512x1024_40k_cityscapes.py'
model = dict(
pretrained='open-mmlab://msra/hrnetv2_w48',
backbone=dict(
extra=dict(
stage2=dict(num_channels=(48, 96)),
stage3=dict(num_channels=(48, 96, 192)),
stage4=dict(num_channels=(48, 96, 192, 384)))),
... | true | true |
f76d420ff3e597ba4433353a318e76d77f59e91e | 5,631 | py | Python | tfx/extensions/google_cloud_ai_platform/pusher/executor_test.py | Mikehem/tfx | e803ea6778d8550ec77dcc92bc8172f1a3a90f38 | [
"Apache-2.0"
] | null | null | null | tfx/extensions/google_cloud_ai_platform/pusher/executor_test.py | Mikehem/tfx | e803ea6778d8550ec77dcc92bc8172f1a3a90f38 | [
"Apache-2.0"
] | 1 | 2020-11-10T02:21:30.000Z | 2020-11-10T02:21:30.000Z | tfx/extensions/google_cloud_ai_platform/pusher/executor_test.py | fanszoro/tfx | b1acab7bf89ec1364c96b9b4e2cc41594407b86c | [
"Apache-2.0"
] | null | null | null | # Lint as: python2, python3
# Copyright 2019 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | 40.221429 | 76 | 0.716569 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import copy
import os
from typing import Any, Dict, Text
import mock
import tensorflow as tf
from tfx.components.pusher import executor as tfx_pusher_executor
from tfx.dsl.io import fileio
from tfx.extensions... | true | true |
f76d4225acb695cd0a490f892f33ead171004aad | 1,656 | py | Python | tests/test_skimp.py | KSaiRahul21/matrixprofile | d8250e30d90ed0453bb7c35bb34ab0c04ae7b334 | [
"Apache-2.0"
] | null | null | null | tests/test_skimp.py | KSaiRahul21/matrixprofile | d8250e30d90ed0453bb7c35bb34ab0c04ae7b334 | [
"Apache-2.0"
] | null | null | null | tests/test_skimp.py | KSaiRahul21/matrixprofile | d8250e30d90ed0453bb7c35bb34ab0c04ae7b334 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
range = getattr(__builtins__, 'xrange', range)
# end of py2 compatability boilerplate
import os
import pytest
import nump... | 22.684932 | 80 | 0.682367 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
range = getattr(__builtins__, 'xrange', range)
import os
import pytest
import numpy as np
from matrixprofile.algorithms import skimp
from matrixprofile.algorithms.ski... | true | true |
f76d42a58f6f8c38c6189368b8963f37db61b820 | 613 | py | Python | utils/logger.py | ravishdussaruth/deployer | e69b61ff71b1fe2192d44f258076e0d017cf92ec | [
"MIT"
] | null | null | null | utils/logger.py | ravishdussaruth/deployer | e69b61ff71b1fe2192d44f258076e0d017cf92ec | [
"MIT"
] | null | null | null | utils/logger.py | ravishdussaruth/deployer | e69b61ff71b1fe2192d44f258076e0d017cf92ec | [
"MIT"
] | null | null | null | class Logger:
__environment = None
def __init__(self):
pass
def set_environment(self, environment: str):
"""
Log into the terminal.
:param environment:
:type environment: str
:return:
"""
self.__environment = environment
def log(self,... | 19.774194 | 81 | 0.510604 | class Logger:
__environment = None
def __init__(self):
pass
def set_environment(self, environment: str):
self.__environment = environment
def log(self, message):
print('[{environment}]: {message}'.format(environment=self.__environment,
... | true | true |
f76d43e63143e797f35f30f8a00815ab75256554 | 1,006 | py | Python | NPTEL-Course-Lecture Programmes/SameLetterCards.py | Slow-Rain/NPTEL-The-Joy-of-Computing-using-Python | e4bd830ef7a3f171a14a88f94df626c766a7649b | [
"MIT"
] | 29 | 2021-01-25T16:13:17.000Z | 2022-03-23T16:34:06.000Z | NPTEL-Course-Lecture Programmes/SameLetterCards.py | Slow-Rain/NPTEL-The-Joy-of-Computing-using-Python | e4bd830ef7a3f171a14a88f94df626c766a7649b | [
"MIT"
] | 12 | 2021-02-11T13:47:07.000Z | 2021-10-10T04:26:45.000Z | NPTEL-Course-Lecture Programmes/SameLetterCards.py | Slow-Rain/NPTEL-The-Joy-of-Computing-using-Python | e4bd830ef7a3f171a14a88f94df626c766a7649b | [
"MIT"
] | 30 | 2021-02-10T05:54:31.000Z | 2022-02-25T11:24:36.000Z | # -*- coding: utf-8 -*-
"""
Created on Sun Feb 14 09:53:19 2021
@author: Lakhan Kumawat
"""
import string
import random
symbols=[]
symbols=list(string.ascii_letters)
card1=[0]*5
card2=[0]*5
pos1=random.randint(0,4)
pos2=random.randint(0,4)
#first lets declare same symbol and extract it out
samesymbol=... | 22.355556 | 51 | 0.643141 |
import string
import random
symbols=[]
symbols=list(string.ascii_letters)
card1=[0]*5
card2=[0]*5
pos1=random.randint(0,4)
pos2=random.randint(0,4)
samesymbol=random.choice(symbols)
symbols.remove(samesymbol)
if(pos1==pos2):
card1[pos1]=samesymbol
card2[pos2]=samesymbol
else:
card1[pos1]=sam... | true | true |
f76d442d0aafb95426f855b2a763b402845e21d0 | 1,371 | py | Python | ASICDesign/measure_helper.py | yyc12345/gist | 000a03cb4b9fc8ca0b083c3b0bd939c41a590c94 | [
"MIT"
] | 1 | 2020-09-07T06:24:10.000Z | 2020-09-07T06:24:10.000Z | ASICDesign/measure_helper.py | yyc12345/gist | 000a03cb4b9fc8ca0b083c3b0bd939c41a590c94 | [
"MIT"
] | null | null | null | ASICDesign/measure_helper.py | yyc12345/gist | 000a03cb4b9fc8ca0b083c3b0bd939c41a590c94 | [
"MIT"
] | null | null | null |
def get_measure_data(meas_path):
with open(meas_path, 'r') as fs:
# useless lines
fs.readline()
fs.readline()
value = []
while True:
ln = fs.readline()
if ln == '':
break
ln = ln.strip()
column_splitter(value... | 24.052632 | 63 | 0.442743 |
def get_measure_data(meas_path):
with open(meas_path, 'r') as fs:
fs.readline()
fs.readline()
value = []
while True:
ln = fs.readline()
if ln == '':
break
ln = ln.strip()
column_splitter(value, ln)
l... | true | true |
f76d44af18ac212241c30334b3d21c832ee6d5dc | 1,444 | py | Python | nudging/dataset/matrix.py | UtrechtUniversity/nudging | 9eb1b77749f36059d0c03e60338308ed2e1ebe3d | [
"MIT"
] | 1 | 2021-11-08T15:14:07.000Z | 2021-11-08T15:14:07.000Z | nudging/dataset/matrix.py | UtrechtUniversity/nudging | 9eb1b77749f36059d0c03e60338308ed2e1ebe3d | [
"MIT"
] | 6 | 2021-12-07T11:05:19.000Z | 2022-03-21T09:05:52.000Z | nudging/dataset/matrix.py | UtrechtUniversity/nudging | 9eb1b77749f36059d0c03e60338308ed2e1ebe3d | [
"MIT"
] | null | null | null | """DataSet class for simlated matrix data"""
from pandas import DataFrame
from nudging.dataset.base import BaseDataSet
class MatrixData(BaseDataSet):
"""Class MatrixData"""
@classmethod
def from_data(cls, data, truth=None, names=None, **kwargs):
"""Initialize dataset from numpy arrays.
A... | 30.723404 | 74 | 0.566482 | from pandas import DataFrame
from nudging.dataset.base import BaseDataSet
class MatrixData(BaseDataSet):
@classmethod
def from_data(cls, data, truth=None, names=None, **kwargs):
X, nudge, outcome = data
if truth is None:
truth = {}
truth.update(kwargs)
standard_df ... | true | true |
f76d44d28fc61d28e7ca0e7b1813cde1ff46ecc5 | 5,513 | py | Python | src/archive/ir-hotspot-rfc/hotspot_classifier.py | Bhaskers-Blu-Org2/arcticseals | 9e2629ca0ce7aadbe63118f39ff2da757d5dbc33 | [
"MIT"
] | 16 | 2019-05-21T20:08:01.000Z | 2021-11-23T22:34:00.000Z | src/archive/ir-hotspot-rfc/hotspot_classifier.py | readicculus/arcticseals | adfdd911e7f74ffaf288d1fbc4d8863844328d45 | [
"MIT"
] | 14 | 2018-07-18T17:14:30.000Z | 2019-04-14T14:40:12.000Z | src/archive/ir-hotspot-rfc/hotspot_classifier.py | readicculus/arcticseals | adfdd911e7f74ffaf288d1fbc4d8863844328d45 | [
"MIT"
] | 10 | 2019-05-10T20:56:47.000Z | 2022-01-26T13:16:40.000Z | """Functions and Command line Script for classifying hotspots"""
# Standard Inputs
import argparse
import os
import sys
import pickle
# Pip Inputs
import pandas as pd
import numpy as np
from PIL import Image
def square_crop(image, x_pos, y_pos, size=35):
"""Returns a square crop of size centered on (x_pos, y_pos)
... | 35.798701 | 98 | 0.664974 | import argparse
import os
import sys
import pickle
import pandas as pd
import numpy as np
from PIL import Image
def square_crop(image, x_pos, y_pos, size=35):
size = (np.floor(size/2) * 2 + 1).astype(np.int) offset = ((size - 1) / 2).astype(np.int)
x_low = x_pos - offset
x_high = x_pos + offset + 1
... | true | true |
f76d4504a479ee54846e877a3808ae1fd3758dbd | 8,064 | py | Python | frappe/core/doctype/data_import/test_importer.py | alijasim/frappe | 17803d5408d0a0257ab6968acb1a847a582b07ce | [
"MIT"
] | 2 | 2021-04-11T11:00:12.000Z | 2021-06-15T09:50:09.000Z | frappe/core/doctype/data_import/test_importer.py | alijasim/frappe | 17803d5408d0a0257ab6968acb1a847a582b07ce | [
"MIT"
] | 17 | 2021-03-22T18:47:14.000Z | 2022-03-15T12:21:00.000Z | frappe/core/doctype/data_import/test_importer.py | alijasim/frappe | 17803d5408d0a0257ab6968acb1a847a582b07ce | [
"MIT"
] | 2 | 2021-05-06T06:14:40.000Z | 2021-05-06T10:05:29.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2019, Frappe Technologies and Contributors
# See license.txt
from __future__ import unicode_literals
import unittest
import frappe
from frappe.core.doctype.data_import.importer import Importer
from frappe.utils import getdate, format_duration
doctype_name = 'DocType for Import'... | 39.920792 | 119 | 0.727555 | from __future__ import unicode_literals
import unittest
import frappe
from frappe.core.doctype.data_import.importer import Importer
from frappe.utils import getdate, format_duration
doctype_name = 'DocType for Import'
class TestImporter(unittest.TestCase):
@classmethod
def setUpClass(cls):
create_doctype_if_not_... | true | true |
f76d45f25bc4cad42682b57f6b5252e5d9869d07 | 2,551 | py | Python | experiments/incrementaccountswithshardedmap.py | emlynoregan/emlyn-experiments | ca7b22b7e8e2d8200b12b9772cc64b5695ef8fa9 | [
"Apache-2.0"
] | null | null | null | experiments/incrementaccountswithshardedmap.py | emlynoregan/emlyn-experiments | ca7b22b7e8e2d8200b12b9772cc64b5695ef8fa9 | [
"Apache-2.0"
] | null | null | null | experiments/incrementaccountswithshardedmap.py | emlynoregan/emlyn-experiments | ca7b22b7e8e2d8200b12b9772cc64b5695ef8fa9 | [
"Apache-2.0"
] | null | null | null | from model.account import Account
from taskutils.ndbsharded import ndbshardedmap, futurendbshardedmapwithcount
import logging
# from taskutils.future import twostagefuture
from taskutils.ndbsharded import futurendbshardedpagemap, futurendbshardedmap
def IncrementAccountsWithShardedMapExperiment():
def Go():
... | 45.553571 | 164 | 0.652685 | from model.account import Account
from taskutils.ndbsharded import ndbshardedmap, futurendbshardedmapwithcount
import logging
from taskutils.ndbsharded import futurendbshardedpagemap, futurendbshardedmap
def IncrementAccountsWithShardedMapExperiment():
def Go():
def AddFreeCredit(creditamount):
... | true | true |
f76d4694fcc1d795af4f2e56782df5b8965827bb | 433 | py | Python | ckconv/utils/grids.py | boczekbartek/flexconv | 610b5be3a846bcc1436275daaad89482b6b8e7cc | [
"BSD-2-Clause"
] | 41 | 2021-10-19T03:13:39.000Z | 2022-03-31T17:08:14.000Z | ckconv/utils/grids.py | boczekbartek/flexconv | 610b5be3a846bcc1436275daaad89482b6b8e7cc | [
"BSD-2-Clause"
] | 3 | 2021-10-19T17:32:14.000Z | 2021-12-23T02:42:07.000Z | ckconv/utils/grids.py | boczekbartek/flexconv | 610b5be3a846bcc1436275daaad89482b6b8e7cc | [
"BSD-2-Clause"
] | 3 | 2021-11-01T14:29:35.000Z | 2022-03-30T00:36:50.000Z | import torch
def rel_positions_grid(grid_sizes):
"""Generates a flattened grid of (x,y,...) coordinates in a range of -1 to 1.
sidelen: int
dim: int
"""
tensors = []
for size in grid_sizes:
tensors.append(torch.linspace(-1, 1, steps=size))
# tensors = tuple(dim * [torch.linspace(-1... | 28.866667 | 81 | 0.648961 | import torch
def rel_positions_grid(grid_sizes):
tensors = []
for size in grid_sizes:
tensors.append(torch.linspace(-1, 1, steps=size))
relpos_grid = torch.stack(torch.meshgrid(*tensors), dim=-0)
return relpos_grid
| true | true |
f76d48325b07e6f9613672e7403ae0c79acc87fc | 24,463 | py | Python | python/models/gp_classifier_svi.py | makoeppel/acl2019-GPPL-humour-metaphor | f659144465085f80e699445c0bc0202d0bdb9817 | [
"Apache-2.0"
] | 10 | 2019-10-07T13:18:59.000Z | 2021-10-04T11:41:24.000Z | python/models/gp_classifier_svi.py | makoeppel/acl2019-GPPL-humour-metaphor | f659144465085f80e699445c0bc0202d0bdb9817 | [
"Apache-2.0"
] | 3 | 2019-09-01T14:04:11.000Z | 2021-12-13T20:06:34.000Z | python/models/gp_classifier_svi.py | makoeppel/acl2019-GPPL-humour-metaphor | f659144465085f80e699445c0bc0202d0bdb9817 | [
"Apache-2.0"
] | 3 | 2019-08-30T15:51:28.000Z | 2021-09-01T13:48:12.000Z | '''
Uses stochastic variational inference (SVI) to scale to larger datasets with limited memory. At each iteration
of the VB algorithm, only a fixed number of random data points are used to update the distribution.
'''
import numpy as np
import logging
import scipy
from gp_classifier_vb import GPClassifierVB, sigm... | 45.301852 | 169 | 0.618976 |
import numpy as np
import logging
import scipy
from gp_classifier_vb import GPClassifierVB, sigmoid, max_no_jobs
from sklearn.cluster import MiniBatchKMeans
from joblib import Parallel, delayed
import multiprocessing
from scipy.special import psi
def _gradient_terms_for_subset(K_mm, invK_mm, kernel_derfactor, kern... | true | true |
f76d49d9a4040abeba12aba718e419081e706282 | 242,426 | py | Python | app/views.py | Rahmatullina/self-examination-site | ca6600f31e002c73573b16c8e7d31b446bc7b54c | [
"Apache-2.0"
] | null | null | null | app/views.py | Rahmatullina/self-examination-site | ca6600f31e002c73573b16c8e7d31b446bc7b54c | [
"Apache-2.0"
] | 8 | 2020-03-21T09:44:46.000Z | 2022-02-10T07:54:34.000Z | app/views.py | Rahmatullina/self-examination-site | ca6600f31e002c73573b16c8e7d31b446bc7b54c | [
"Apache-2.0"
] | null | null | null | from django.http import HttpResponseRedirect, HttpResponseNotFound, HttpResponse,Http404
from django.urls import reverse
from django.shortcuts import render
from datetime import datetime
from django.contrib.auth.decorators import login_required
from django.contrib.auth import login, logout
from openpyxl import load_wor... | 78.966124 | 366 | 0.633645 | from django.http import HttpResponseRedirect, HttpResponseNotFound, HttpResponse,Http404
from django.urls import reverse
from django.shortcuts import render
from datetime import datetime
from django.contrib.auth.decorators import login_required
from django.contrib.auth import login, logout
from openpyxl import load_wor... | true | true |
f76d4a9610e2c7bd901dd3ff35b9ce76808b87ff | 681 | py | Python | quantum/plugins/nicira/nicira_nvp_plugin/api_client/__init__.py | aristanetworks/arista-ovs-quantum | 8e7fe17cafa70c3346e2a5d70da2d6e2637c338e | [
"Apache-2.0"
] | null | null | null | quantum/plugins/nicira/nicira_nvp_plugin/api_client/__init__.py | aristanetworks/arista-ovs-quantum | 8e7fe17cafa70c3346e2a5d70da2d6e2637c338e | [
"Apache-2.0"
] | null | null | null | quantum/plugins/nicira/nicira_nvp_plugin/api_client/__init__.py | aristanetworks/arista-ovs-quantum | 8e7fe17cafa70c3346e2a5d70da2d6e2637c338e | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 Nicira Networks, Inc.
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 40.058824 | 78 | 0.729809 | true | true | |
f76d4b1765044e54ab60b0b5cc2ea493112ee3e6 | 7,898 | py | Python | tests/mfem_ex1_serial_hip/postprocess-plot-2.py | nbeams/benchmarks | fdd742fb2ca22c0282c0ccb85832f471bf22f23a | [
"BSD-2-Clause"
] | 6 | 2017-08-25T19:44:54.000Z | 2021-11-01T20:33:18.000Z | tests/mfem_ex1_serial_hip/postprocess-plot-2.py | nbeams/benchmarks | fdd742fb2ca22c0282c0ccb85832f471bf22f23a | [
"BSD-2-Clause"
] | 7 | 2018-05-08T13:53:44.000Z | 2021-02-11T04:26:30.000Z | tests/mfem_ex1_serial_hip/postprocess-plot-2.py | nbeams/benchmarks | fdd742fb2ca22c0282c0ccb85832f471bf22f23a | [
"BSD-2-Clause"
] | 5 | 2017-08-11T21:54:29.000Z | 2020-09-03T16:48:46.000Z | # Copyright (c) 2017, Lawrence Livermore National Security, LLC. Produced at
# the Lawrence Livermore National Laboratory. LLNL-CODE-734707. All Rights
# reserved. See files LICENSE and NOTICE for details.
#
# This file is part of CEED, a collection of benchmarks, miniapps, software
# libraries and APIs for efficient h... | 36.734884 | 77 | 0.613193 | # exascale computing imperative.
##### Adjustable plot parameters:
log_y=0 # use log scale on the y-axis?
#x_range=(1e3,6e6) # plot range for the x-axis; comment out for auto
#y_range=(0,2.2e7) # plot range for the y-axis; comment out for auto
#y_range=(0,2.5e6) # plot range for the y-axis; ... | false | true |
f76d4b88cb0591adcb0326fd243402966884d741 | 784 | py | Python | sockets/client.py | adrianogil/pynsecply | 424859f691bc42e9434ab66e88611eba5845cc3b | [
"MIT"
] | null | null | null | sockets/client.py | adrianogil/pynsecply | 424859f691bc42e9434ab66e88611eba5845cc3b | [
"MIT"
] | null | null | null | sockets/client.py | adrianogil/pynsecply | 424859f691bc42e9434ab66e88611eba5845cc3b | [
"MIT"
] | null | null | null | # https://pymotw.com/2/socket/tcp.html
import socket
import sys
# Create a TCP/IP socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# Bind the socket to the port
server_address = ('localhost', 11111)
print >>sys.stderr, 'starting up on %s port %s' % server_address
sock.connect(server_address)
try:
... | 27.034483 | 64 | 0.681122 | import socket
import sys
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server_address = ('localhost', 11111)
print >>sys.stderr, 'starting up on %s port %s' % server_address
sock.connect(server_address)
try:
message = 'This is the message. It will be repeated.<EOF>'
print >>sys.stderr, 'sendin... | true | true |
f76d4c6957ed0ff07a1a67377698b7794d54e594 | 223 | py | Python | concord_erpnext/concord_erpnext/doctype/consignment_note_detail/test_consignment_note_detail.py | joekabucho/transport-management | 6594a69b236bf5b598301a9ece526b8889ee4e97 | [
"MIT"
] | null | null | null | concord_erpnext/concord_erpnext/doctype/consignment_note_detail/test_consignment_note_detail.py | joekabucho/transport-management | 6594a69b236bf5b598301a9ece526b8889ee4e97 | [
"MIT"
] | null | null | null | concord_erpnext/concord_erpnext/doctype/consignment_note_detail/test_consignment_note_detail.py | joekabucho/transport-management | 6594a69b236bf5b598301a9ece526b8889ee4e97 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2018, Gaurav Naik and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestConsignmentNoteDetail(unittest.TestCase):
pass
| 20.272727 | 51 | 0.780269 | from __future__ import unicode_literals
import frappe
import unittest
class TestConsignmentNoteDetail(unittest.TestCase):
pass
| true | true |
f76d4c8d3d4ef8de3080e16c3b6fd77b47733edb | 12,356 | py | Python | abb_rl_algorithms/DDDQN_PER/rl_logging.py | habichta/ETHZDeepReinforcementLearning | e1ae22159753724290f20068214bb3d94fcb7be4 | [
"BSD-3-Clause"
] | 7 | 2018-01-23T05:17:50.000Z | 2020-10-30T02:29:59.000Z | abb_rl_algorithms/DDDQN_PER/rl_logging.py | habichta/ETHZDeepReinforcementLearning | e1ae22159753724290f20068214bb3d94fcb7be4 | [
"BSD-3-Clause"
] | null | null | null | abb_rl_algorithms/DDDQN_PER/rl_logging.py | habichta/ETHZDeepReinforcementLearning | e1ae22159753724290f20068214bb3d94fcb7be4 | [
"BSD-3-Clause"
] | 2 | 2018-01-23T05:17:58.000Z | 2018-07-02T00:13:34.000Z |
import numpy as np
import datetime as dt
import tensorflow as tf
import os,csv
slim = tf.contrib.slim
def save_statistics(train_writer, episodes_reward_list, episodes_mean_max_q_value_list, episodes_mean_chosen_q_value_list=None, episodes_mean_batch_reward_list=None, episode_mean_action_q_value_list=None,step=1, a... | 51.057851 | 484 | 0.70055 |
import numpy as np
import datetime as dt
import tensorflow as tf
import os,csv
slim = tf.contrib.slim
def save_statistics(train_writer, episodes_reward_list, episodes_mean_max_q_value_list, episodes_mean_chosen_q_value_list=None, episodes_mean_batch_reward_list=None, episode_mean_action_q_value_list=None,step=1, a... | true | true |
f76d4ca51658a21b21cdc4c5f658b1009525162e | 1,298 | py | Python | env/Lib/site-packages/OpenGL/GL/OES/read_format.py | 5gconnectedbike/Navio2 | 8c3f2b5d8bbbcea1fc08739945183c12b206712c | [
"BSD-3-Clause"
] | 210 | 2016-04-09T14:26:00.000Z | 2022-03-25T18:36:19.000Z | env/Lib/site-packages/OpenGL/GL/OES/read_format.py | 5gconnectedbike/Navio2 | 8c3f2b5d8bbbcea1fc08739945183c12b206712c | [
"BSD-3-Clause"
] | 72 | 2016-09-04T09:30:19.000Z | 2022-03-27T17:06:53.000Z | env/Lib/site-packages/OpenGL/GL/OES/read_format.py | 5gconnectedbike/Navio2 | 8c3f2b5d8bbbcea1fc08739945183c12b206712c | [
"BSD-3-Clause"
] | 64 | 2016-04-09T14:26:49.000Z | 2022-03-21T11:19:47.000Z | '''OpenGL extension OES.read_format
This module customises the behaviour of the
OpenGL.raw.GL.OES.read_format to provide a more
Python-friendly API
Overview (from the spec)
This extension provides the capability to query an OpenGL
implementation for a preferred type and format combination
for use with reading ... | 36.055556 | 71 | 0.808166 | from OpenGL import platform, constant, arrays
from OpenGL import extensions, wrapper
import ctypes
from OpenGL.raw.GL import _types, _glgets
from OpenGL.raw.GL.OES.read_format import *
from OpenGL.raw.GL.OES.read_format import _EXTENSION_NAME
def glInitReadFormatOES():
from OpenGL import extensions
return exte... | true | true |
f76d4d6f213a9c75c0d6f8bf1ac88988a4ee210d | 1,438 | py | Python | setup.py | clearpathrobotics/transitions | 2d09bd433d3a2ee4745f7ac485bbe152a97ed31a | [
"MIT"
] | null | null | null | setup.py | clearpathrobotics/transitions | 2d09bd433d3a2ee4745f7ac485bbe152a97ed31a | [
"MIT"
] | 1 | 2017-07-04T14:10:09.000Z | 2017-07-04T14:16:04.000Z | setup.py | clearpathrobotics/transitions | 2d09bd433d3a2ee4745f7ac485bbe152a97ed31a | [
"MIT"
] | 2 | 2017-01-08T20:12:58.000Z | 2017-07-04T12:32:40.000Z | import sys
from setuptools import setup, find_packages
with open('transitions/version.py') as f:
exec(f.read())
if len(set(('test', 'easy_install')).intersection(sys.argv)) > 0:
import setuptools
tests_require = ['dill', 'pygraphviz']
extra_setuptools_args = {}
if 'setuptools' in sys.modules:
tests_requ... | 31.26087 | 91 | 0.636996 | import sys
from setuptools import setup, find_packages
with open('transitions/version.py') as f:
exec(f.read())
if len(set(('test', 'easy_install')).intersection(sys.argv)) > 0:
import setuptools
tests_require = ['dill', 'pygraphviz']
extra_setuptools_args = {}
if 'setuptools' in sys.modules:
tests_requ... | true | true |
f76d4e351b7b3df1079270cd218b9f6d75228e80 | 117 | py | Python | test.py | berkankadioglu/Bandits-Get-GANs | 8cd5be8d12fc53ba96fe51b737b665ca9baaedef | [
"MIT"
] | null | null | null | test.py | berkankadioglu/Bandits-Get-GANs | 8cd5be8d12fc53ba96fe51b737b665ca9baaedef | [
"MIT"
] | null | null | null | test.py | berkankadioglu/Bandits-Get-GANs | 8cd5be8d12fc53ba96fe51b737b665ca9baaedef | [
"MIT"
] | null | null | null | from tqdm import tqdm
from time import sleep
for _ in tqdm(range(1500)):
# print('Ilkayyyyyyy')
sleep(.2) | 13 | 27 | 0.666667 | from tqdm import tqdm
from time import sleep
for _ in tqdm(range(1500)):
sleep(.2) | true | true |
f76d4ea78e4ecfd1a63c6d86bcc4352a449e6926 | 13,770 | py | Python | tools/taish/client/taish.py | skuwa/oopt-tai | c026c32eea76d37d638a006678d959c50ed02414 | [
"BSD-3-Clause"
] | null | null | null | tools/taish/client/taish.py | skuwa/oopt-tai | c026c32eea76d37d638a006678d959c50ed02414 | [
"BSD-3-Clause"
] | null | null | null | tools/taish/client/taish.py | skuwa/oopt-tai | c026c32eea76d37d638a006678d959c50ed02414 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
#
# Copyright (C) 2018 Nippon Telegraph and Telephone Corporation.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import grpc
import sys
import tai_pb2
import tai_pb2_grpc
from optparse import OptionParser
fro... | 32.4 | 144 | 0.527887 |
import grpc
import sys
import tai_pb2
import tai_pb2_grpc
from optparse import OptionParser
from prompt_toolkit import PromptSession
from prompt_toolkit.completion import FuzzyCompleter, Completer, Completion
from tabulate import tabulate
TAI_ATTR_CUSTOM_RANGE_START = 0x10000000
def show_help(hidden=False):
d... | true | true |
f76d4f18d5289b364a373b1e5dcdabc2411821f4 | 11,948 | py | Python | src/azure-cli/azure/cli/command_modules/storage/_client_factory_azure_stack.py | ZengTaoxu/azure-cli | 6be96de450da5ac9f07aafb22dd69880bea04792 | [
"MIT"
] | null | null | null | src/azure-cli/azure/cli/command_modules/storage/_client_factory_azure_stack.py | ZengTaoxu/azure-cli | 6be96de450da5ac9f07aafb22dd69880bea04792 | [
"MIT"
] | null | null | null | src/azure-cli/azure/cli/command_modules/storage/_client_factory_azure_stack.py | ZengTaoxu/azure-cli | 6be96de450da5ac9f07aafb22dd69880bea04792 | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 47.601594 | 115 | 0.677436 |
from azure.cli.core.commands.client_factory import get_mgmt_service_client, get_data_service_client
from azure.cli.core.profiles import ResourceType, get_sdk
from azure.cli.command_modules.storage.sdkutil import get_table_data_type
MISSING_CREDENTIALS_ERROR_MESSAGE = """
Missing credentials to access storage service... | true | true |
f76d4f3bb924f8436dd53c5baf52562d82e1bb77 | 11,780 | py | Python | aiortc/codecs/vpx.py | sfrost23/aiortc | ca23567ca74cd45ad1d507a9fe8c4a5e61ca6ae8 | [
"BSD-3-Clause"
] | 4 | 2019-09-02T22:26:03.000Z | 2020-09-02T18:13:29.000Z | aiortc/codecs/vpx.py | sfrost23/aiortc | ca23567ca74cd45ad1d507a9fe8c4a5e61ca6ae8 | [
"BSD-3-Clause"
] | 2 | 2018-12-24T19:18:58.000Z | 2018-12-24T20:09:32.000Z | aiortc/codecs/vpx.py | koenvo/aiortc | ac834849b58f852722079436e616562b7d9f787b | [
"BSD-3-Clause"
] | 2 | 2021-03-04T04:05:54.000Z | 2021-03-25T07:33:43.000Z | import multiprocessing
import random
from struct import pack, unpack_from
from av import VideoFrame
from ..mediastreams import VIDEO_CLOCK_RATE, VIDEO_TIME_BASE, convert_timebase
from ._vpx import ffi, lib
DEFAULT_BITRATE = 500000 # 500 kbps
MIN_BITRATE = 250000 # 250 kbps
MAX_BITRATE = 1500000 # 1.5 Mbps
... | 35.481928 | 100 | 0.548048 | import multiprocessing
import random
from struct import pack, unpack_from
from av import VideoFrame
from ..mediastreams import VIDEO_CLOCK_RATE, VIDEO_TIME_BASE, convert_timebase
from ._vpx import ffi, lib
DEFAULT_BITRATE = 500000 MIN_BITRATE = 250000 MAX_BITRATE = 1500000
MAX_FRAME_RATE = 30
PACKET_MAX =... | true | true |
f76d4f3d55fad9f671cb775e6be0d046f2beb2d0 | 393 | py | Python | Session-6/EC2.py | saianuragpeddu/python-assignemts | a6bb192f2c0ef8ea86531c1a98f1b76150fa474b | [
"MIT"
] | null | null | null | Session-6/EC2.py | saianuragpeddu/python-assignemts | a6bb192f2c0ef8ea86531c1a98f1b76150fa474b | [
"MIT"
] | null | null | null | Session-6/EC2.py | saianuragpeddu/python-assignemts | a6bb192f2c0ef8ea86531c1a98f1b76150fa474b | [
"MIT"
] | 1 | 2019-07-06T02:37:58.000Z | 2019-07-06T02:37:58.000Z | # To find the path on which we are working
import os
cwd = os.getcwd()
print('###cwd###', cwd)
filename = os.path.join(cwd, 'ec2-launch')
# Create the Ec2 instances
import boto3
ec2 = boto3.resource('ec2', region_name = 'us-east-1')
instances = ec2.create_instances(
ImageId='ami-035be7bafff33b6b6',
MinCount=1,... | 23.117647 | 54 | 0.684478 | import os
cwd = os.getcwd()
print('###cwd###', cwd)
filename = os.path.join(cwd, 'ec2-launch')
import boto3
ec2 = boto3.resource('ec2', region_name = 'us-east-1')
instances = ec2.create_instances(
ImageId='ami-035be7bafff33b6b6',
MinCount=1,
MaxCount=2,
InstanceType='t2.micro',
KeyName='ec2-launch'... | true | true |
f76d4fd5de721fc5fb025bc8a44c4453c3616c75 | 2,045 | py | Python | build/executils.py | D15C0DE/openMSX | 5119a9657de4b82115c745f670cdc55dc7363133 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 320 | 2015-06-16T20:32:33.000Z | 2022-03-26T17:03:27.000Z | build/executils.py | D15C0DE/openMSX | 5119a9657de4b82115c745f670cdc55dc7363133 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 2,592 | 2015-05-30T12:12:21.000Z | 2022-03-31T17:16:15.000Z | build/executils.py | D15C0DE/openMSX | 5119a9657de4b82115c745f670cdc55dc7363133 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 74 | 2015-06-18T19:51:15.000Z | 2022-03-24T15:09:33.000Z | from msysutils import msysActive, msysShell
from os import environ
from shlex import split as shsplit
from subprocess import PIPE, Popen
def captureStdout(log, commandLine):
'''Run a command and capture what it writes to stdout.
If the command fails or writes something to stderr, that is logged.
Returns the captur... | 30.073529 | 76 | 0.684597 | from msysutils import msysActive, msysShell
from os import environ
from shlex import split as shsplit
from subprocess import PIPE, Popen
def captureStdout(log, commandLine):
commandParts = shsplit(commandLine)
env = dict(environ)
env['LC_ALL'] = 'C.UTF-8'
while commandParts:
if '=' in commandParts[0]:
name,... | true | true |
f76d4fddc6386decf2eee8d7f7a3114fa3995413 | 433 | py | Python | tornado_learning/simple_server.py | rwbooks/python_learning | 077449e27cb3b18620ba44f0ab1addc7662e001b | [
"MIT"
] | null | null | null | tornado_learning/simple_server.py | rwbooks/python_learning | 077449e27cb3b18620ba44f0ab1addc7662e001b | [
"MIT"
] | null | null | null | tornado_learning/simple_server.py | rwbooks/python_learning | 077449e27cb3b18620ba44f0ab1addc7662e001b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# author:ls
import tornado.ioloop
import tornado.web
class MainHandler(tornado.web.RequestHandler):
def get(self,*args,**kwargs):
self.write("Hello, world")
def main():
application = tornado.web.Application([
(r"/", MainHandler),
],debug=True... | 20.619048 | 46 | 0.648961 |
import tornado.ioloop
import tornado.web
class MainHandler(tornado.web.RequestHandler):
def get(self,*args,**kwargs):
self.write("Hello, world")
def main():
application = tornado.web.Application([
(r"/", MainHandler),
],debug=True)
application.listen(8888)
tornado.ioloop.IOLoop.c... | true | true |
f76d50043a2a90d51b2b64f1d5bfea98eceda38e | 658 | py | Python | backend_app/util.py | GGCarrotsBerlin/test | 47d7414e8c4f2aa419710645c68bf32b584b29fa | [
"BSD-3-Clause"
] | null | null | null | backend_app/util.py | GGCarrotsBerlin/test | 47d7414e8c4f2aa419710645c68bf32b584b29fa | [
"BSD-3-Clause"
] | null | null | null | backend_app/util.py | GGCarrotsBerlin/test | 47d7414e8c4f2aa419710645c68bf32b584b29fa | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
NW = (52.58363, 13.2035)
SE = (52.42755, 13.62648)
NE = (NW[0], SE[1])
SW = (SE[0], NW[1])
def flatten_list(irregularly_nested_list):
"""Generator which recursively flattens list of lists
:param irregularly_nested_list: iterable object containing iterable and non-iterable objects as elemen... | 26.32 | 108 | 0.638298 | import numpy as np
NW = (52.58363, 13.2035)
SE = (52.42755, 13.62648)
NE = (NW[0], SE[1])
SW = (SE[0], NW[1])
def flatten_list(irregularly_nested_list):
for el in irregularly_nested_list:
if isinstance(el, list):
for sub_el in flatten_list(el):
yield sub_el
else:
... | true | true |
f76d50625db6f515ebdb383855cb7c19e15f16c5 | 31,122 | py | Python | venv/Lib/site-packages/IPython/kernel/zmq/ipkernel.py | Tyranicangel/dtrans | a5e23d200a310701bb357bff09e35a5629a3f7a3 | [
"BSD-3-Clause"
] | null | null | null | venv/Lib/site-packages/IPython/kernel/zmq/ipkernel.py | Tyranicangel/dtrans | a5e23d200a310701bb357bff09e35a5629a3f7a3 | [
"BSD-3-Clause"
] | null | null | null | venv/Lib/site-packages/IPython/kernel/zmq/ipkernel.py | Tyranicangel/dtrans | a5e23d200a310701bb357bff09e35a5629a3f7a3 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
"""An interactive kernel that talks to frontends over 0MQ."""
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
from __future__ import print_function
# Standard library imports
i... | 38.853933 | 103 | 0.569951 |
from __future__ import print_function
import sys
import time
import traceback
import logging
import uuid
from datetime import datetime
from signal import (
signal, default_int_handler, SIGINT
)
import zmq
from zmq.eventloop import ioloop
from zmq.eventloop.zmqstream import ZMQStream
from IPython.config.con... | true | true |
f76d508d6976c1fcf7519af7a301ac241692aef2 | 740 | py | Python | benchpress/benchmarks/lu/python_numpy/lu.py | bh107/benchpress | e1dcda446a986d4d828b14d807e37e10cf4a046b | [
"Apache-2.0"
] | 6 | 2015-03-31T15:39:40.000Z | 2022-03-16T21:30:49.000Z | benchpress/benchmarks/lu/python_numpy/lu.py | bh107/benchpress | e1dcda446a986d4d828b14d807e37e10cf4a046b | [
"Apache-2.0"
] | 8 | 2015-04-13T12:03:56.000Z | 2018-11-28T13:31:11.000Z | benchpress/benchmarks/lu/python_numpy/lu.py | bh107/benchpress | e1dcda446a986d4d828b14d807e37e10cf4a046b | [
"Apache-2.0"
] | 4 | 2018-06-28T08:06:37.000Z | 2021-05-20T17:30:25.000Z | from __future__ import print_function
from benchpress.benchmarks import util
import numpy as np
bench = util.Benchmark("LU decomposition on the matrix so that A = L*U", "<size>")
def lu(a):
"""
Perform LU decomposition on the matrix `a` so that A = L*U
"""
u = a.copy()
l = np.identity(a.shape[0],... | 23.125 | 82 | 0.541892 | from __future__ import print_function
from benchpress.benchmarks import util
import numpy as np
bench = util.Benchmark("LU decomposition on the matrix so that A = L*U", "<size>")
def lu(a):
u = a.copy()
l = np.identity(a.shape[0], a.dtype)
for c in range(1, u.shape[0]):
l[c:, c - 1] = (u[c:, c - ... | true | true |
f76d50fc6fee17281c242a3af78ea76e03735fb3 | 602 | py | Python | Leetcode/0435. Non overlapping Intervals.py | luckyrabbit85/Python | ed134fd70b4a7b84b183b87b85ad5190f54c9526 | [
"MIT"
] | 1 | 2021-07-15T18:40:26.000Z | 2021-07-15T18:40:26.000Z | Leetcode/0435. Non overlapping Intervals.py | luckyrabbit85/Python | ed134fd70b4a7b84b183b87b85ad5190f54c9526 | [
"MIT"
] | null | null | null | Leetcode/0435. Non overlapping Intervals.py | luckyrabbit85/Python | ed134fd70b4a7b84b183b87b85ad5190f54c9526 | [
"MIT"
] | null | null | null | class Solution:
def eraseOverlapIntervals(self, intervals: list[list[int]]) -> int:
intervals.sort()
n = len(intervals)
left, right = 0, 1
count = 0
while right < n:
if intervals[left][1] <= intervals[right][0]:
left = right
right ... | 30.1 | 71 | 0.45515 | class Solution:
def eraseOverlapIntervals(self, intervals: list[list[int]]) -> int:
intervals.sort()
n = len(intervals)
left, right = 0, 1
count = 0
while right < n:
if intervals[left][1] <= intervals[right][0]:
left = right
right ... | true | true |
f76d5155e1242fa94882902fa6ea97f6118f9cf6 | 4,056 | py | Python | Mengascini-Spina/Sistemi-Digitali-M/Datasets/Utilities/Maps/Noiseprint/noiseprint.py | mattpoggi/SistemiDigitaliM20-21 | 202e520a571a2bb961851763f37e9293c3af400d | [
"MIT"
] | 9 | 2021-02-07T22:53:34.000Z | 2022-03-14T21:47:30.000Z | Mengascini-Spina/Sistemi-Digitali-M/Datasets/Utilities/Maps/Noiseprint/noiseprint.py | mattpoggi/SistemiDigitaliM20-21 | 202e520a571a2bb961851763f37e9293c3af400d | [
"MIT"
] | null | null | null | Mengascini-Spina/Sistemi-Digitali-M/Datasets/Utilities/Maps/Noiseprint/noiseprint.py | mattpoggi/SistemiDigitaliM20-21 | 202e520a571a2bb961851763f37e9293c3af400d | [
"MIT"
] | 18 | 2021-02-07T18:30:47.000Z | 2022-01-22T16:57:40.000Z | from pathlib import Path
import os
from PIL import Image
from tensorflow.python.keras.layers import Conv2D, BatchNormalization, Activation
import logging
logging.getLogger("tensorflow").setLevel(logging.ERROR)
import tensorflow as tf
tf.get_logger().setLevel('ERROR')
import numpy as np
from tensorflow.python.keras.mod... | 37.555556 | 115 | 0.627959 | from pathlib import Path
import os
from PIL import Image
from tensorflow.python.keras.layers import Conv2D, BatchNormalization, Activation
import logging
logging.getLogger("tensorflow").setLevel(logging.ERROR)
import tensorflow as tf
tf.get_logger().setLevel('ERROR')
import numpy as np
from tensorflow.python.keras.mod... | true | true |
f76d517aebf611652fb30dc0b42372f04842cfd7 | 1,319 | py | Python | ball.py | hex-plex/Pong-ReinforcementLearning | 62d257ae03afb7561403d0f48650344254dcc06e | [
"MIT"
] | null | null | null | ball.py | hex-plex/Pong-ReinforcementLearning | 62d257ae03afb7561403d0f48650344254dcc06e | [
"MIT"
] | 8 | 2020-05-05T22:04:58.000Z | 2022-01-13T03:16:44.000Z | ball.py | hex-plex/Pong-ReinforcementLearning | 62d257ae03afb7561403d0f48650344254dcc06e | [
"MIT"
] | null | null | null | import pygame
from random import randint
BLACK = (0,0,0)
import numpy as np
class Ball(pygame.sprite.Sprite):
def __init__(self, color , width ,height, twidth, theight):
super().__init__()
self.image = pygame.Surface([width,height])
self.image.fill(BLACK)
self.image.set_colorkey(... | 33.820513 | 87 | 0.61865 | import pygame
from random import randint
BLACK = (0,0,0)
import numpy as np
class Ball(pygame.sprite.Sprite):
def __init__(self, color , width ,height, twidth, theight):
super().__init__()
self.image = pygame.Surface([width,height])
self.image.fill(BLACK)
self.image.set_colorkey(... | true | true |
f76d51886d005e10bb957dce5bb17ff8b2bf498d | 2,138 | py | Python | src/facenet/datasets/generate_csv_files.py | dawidkski/federated-faceid | 95b1f4b7da0e8baf1cac35edf3b49528c650c491 | [
"MIT"
] | 1 | 2021-12-23T14:00:36.000Z | 2021-12-23T14:00:36.000Z | src/facenet/datasets/generate_csv_files.py | dawidkski/federated-faceid | 95b1f4b7da0e8baf1cac35edf3b49528c650c491 | [
"MIT"
] | 6 | 2021-01-12T13:40:31.000Z | 2022-03-12T00:31:27.000Z | src/facenet/datasets/generate_csv_files.py | d-kicinski/federated-faceid | 95b1f4b7da0e8baf1cac35edf3b49528c650c491 | [
"MIT"
] | 1 | 2020-05-12T03:11:07.000Z | 2020-05-12T03:11:07.000Z | import argparse
import glob
import os
import time
import pandas as pd
from tqdm import tqdm
def generate_csv_file(data_dir: str, output_file: str):
"""Generates a csv file containing the image paths of the VGGFace2 dataset for use in triplet selection in
triplet loss training.
Args:
dataroot (st... | 26.725 | 110 | 0.638915 | import argparse
import glob
import os
import time
import pandas as pd
from tqdm import tqdm
def generate_csv_file(data_dir: str, output_file: str):
print("\nLoading image paths ...")
files = glob.glob(data_dir + "/*/*")
start_time = time.time()
list_rows = []
print(data_dir)
print(os.listdir... | true | true |
f76d51a71724264a5e2c43d36e5dc4354b504a42 | 683 | py | Python | apps/acheve_mgt/migrations/0019_auto_20190610_1139.py | lennon624/stu_mgt | c0118f9adede46db23b6a9b5329004343023f1a3 | [
"MIT"
] | null | null | null | apps/acheve_mgt/migrations/0019_auto_20190610_1139.py | lennon624/stu_mgt | c0118f9adede46db23b6a9b5329004343023f1a3 | [
"MIT"
] | null | null | null | apps/acheve_mgt/migrations/0019_auto_20190610_1139.py | lennon624/stu_mgt | c0118f9adede46db23b6a9b5329004343023f1a3 | [
"MIT"
] | null | null | null | # Generated by Django 2.0 on 2019-06-10 11:39
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('acheve_mgt', '0018_auto_20190610_1136'),
]
operations = [
migrations.AlterField(
model_name='myclass',
name='dept',
... | 28.458333 | 147 | 0.568082 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('acheve_mgt', '0018_auto_20190610_1136'),
]
operations = [
migrations.AlterField(
model_name='myclass',
name='dept',
field=models.CharField(choices=[('信息... | true | true |
f76d51b9d32772a327c8a8e5387a038437f3477a | 5,602 | py | Python | salt/utils/raetlane.py | jubrad/salt | 7960334fb726cfde45e6409da79a65535c626685 | [
"Apache-2.0"
] | 1 | 2021-08-14T13:48:38.000Z | 2021-08-14T13:48:38.000Z | salt/utils/raetlane.py | jubrad/salt | 7960334fb726cfde45e6409da79a65535c626685 | [
"Apache-2.0"
] | 3 | 2015-03-31T14:44:05.000Z | 2015-06-18T19:02:24.000Z | salt/utils/raetlane.py | jubrad/salt | 7960334fb726cfde45e6409da79a65535c626685 | [
"Apache-2.0"
] | 1 | 2020-01-02T09:03:24.000Z | 2020-01-02T09:03:24.000Z | # -*- coding: utf-8 -*-
'''
Provides RAET LaneStack interface for interprocess communications in Salt Raet
to a remote yard, default name for remote is 'manor' .
Usages are for RAETChannels and RAETEvents
This provides a single module global LaneStack to be shared by all users in
the same process. This combines into o... | 31.47191 | 91 | 0.669404 | from __future__ import absolute_import
import time
import logging
import salt.utils.kinds as kinds
log = logging.getLogger(__name__)
from raet import raeting, nacling
from raet.lane.stacking import LaneStack
from raet.lane.yarding import RemoteYard
rx_msgs = {} lane_stack = None remote_yard = None master_estate... | true | true |
f76d52a8ca1709cb4240289172f915173d882011 | 58,281 | py | Python | libcloud/common/dimensiondata.py | dupontz/libcloud | 419c69441ea10e7bbf37319e5e8d02e82e7e6b40 | [
"Apache-2.0"
] | 1 | 2018-08-17T11:13:12.000Z | 2018-08-17T11:13:12.000Z | libcloud/common/dimensiondata.py | dupontz/libcloud | 419c69441ea10e7bbf37319e5e8d02e82e7e6b40 | [
"Apache-2.0"
] | 1 | 2018-06-12T10:27:33.000Z | 2018-06-12T10:27:33.000Z | libcloud/common/dimensiondata.py | dupontz/libcloud | 419c69441ea10e7bbf37319e5e8d02e82e7e6b40 | [
"Apache-2.0"
] | 1 | 2020-10-23T04:09:40.000Z | 2020-10-23T04:09:40.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 use ... | 32.396331 | 79 | 0.583878 | from base64 import b64encode
from time import sleep
from libcloud.utils.py3 import httplib
from libcloud.utils.py3 import b
from libcloud.common.base import ConnectionUserAndKey, XmlResponse, RawResponse
from libcloud.compute.base import Node
from libcloud.utils.py3 import basestring
from libcloud.utils.xml import find... | true | true |
f76d52fffc73091ebadc3c78f87604325df9dcd4 | 8,639 | py | Python | mfexport/tests/test_results_export.py | mnfienen/modflow-export | e56e49285a7ef71797ce047151f6dbabbd8fe245 | [
"BSD-3-Clause"
] | null | null | null | mfexport/tests/test_results_export.py | mnfienen/modflow-export | e56e49285a7ef71797ce047151f6dbabbd8fe245 | [
"BSD-3-Clause"
] | null | null | null | mfexport/tests/test_results_export.py | mnfienen/modflow-export | e56e49285a7ef71797ce047151f6dbabbd8fe245 | [
"BSD-3-Clause"
] | null | null | null | import os
from pathlib import Path
import pytest
from flopy.utils import binaryfile as bf
import numpy as np
import fiona
import rasterio
from shapely.geometry import box
import pytest
from ..grid import load_modelgrid
from ..results import export_cell_budget, export_heads, export_drawdown, export_sfr_results
@pytest... | 39.62844 | 95 | 0.586295 | import os
from pathlib import Path
import pytest
from flopy.utils import binaryfile as bf
import numpy as np
import fiona
import rasterio
from shapely.geometry import box
import pytest
from ..grid import load_modelgrid
from ..results import export_cell_budget, export_heads, export_drawdown, export_sfr_results
@pytest... | true | true |
f76d530d7fc99b86ae845abf68255f8693237007 | 913 | py | Python | scripts/make_boxplot.py | turbomaze/gpgp | 574cb4d4b8661c282d01ec38e4acd8fca2d7929e | [
"MIT"
] | null | null | null | scripts/make_boxplot.py | turbomaze/gpgp | 574cb4d4b8661c282d01ec38e4acd8fca2d7929e | [
"MIT"
] | 14 | 2016-12-16T05:19:06.000Z | 2016-12-21T02:23:48.000Z | scripts/make_boxplot.py | turbomaze/gaze | 574cb4d4b8661c282d01ec38e4acd8fca2d7929e | [
"MIT"
] | null | null | null | import sys
import matplotlib.pyplot as plt
from matplotlib import rc
import cPickle
if len(sys.argv) < 2:
print 'Must provide a comma separated list of experiments.'
sys.exit(0)
results_base = 'results-'
root_dir = '../data/experiments/experiment-'
experiment_ids = sys.argv[1].split(',')
data = [
cPickle... | 20.75 | 63 | 0.67908 | import sys
import matplotlib.pyplot as plt
from matplotlib import rc
import cPickle
if len(sys.argv) < 2:
print 'Must provide a comma separated list of experiments.'
sys.exit(0)
results_base = 'results-'
root_dir = '../data/experiments/experiment-'
experiment_ids = sys.argv[1].split(',')
data = [
cPickle... | false | true |
f76d537e4a62a107cad186856a459f896a14f31e | 3,003 | py | Python | elliptic_position.py | Zomega/keplerian | ec4f8ac5766186853932081de7584fd4330e1984 | [
"MIT"
] | null | null | null | elliptic_position.py | Zomega/keplerian | ec4f8ac5766186853932081de7584fd4330e1984 | [
"MIT"
] | null | null | null | elliptic_position.py | Zomega/keplerian | ec4f8ac5766186853932081de7584fd4330e1984 | [
"MIT"
] | null | null | null | # Elliptic position is governed by Kepler's equation
#
# M = E - e * sin E
#
# Aux equations for computing position from E assuming an axis aligned orbit.
#
# x = a * ( cos E - e )
#
# y = a * sqrt( 1 - e ^ 2 ) * sin E
#
# For computing M from an orbit.
#
# M = M_0 + ( 2 * pi * t / ... | 27.550459 | 95 | 0.566101 | #
# M = E - e * sin E
#
# Aux equations for computing position from E assuming an axis aligned orbit.
#
# x = a * ( cos E - e )
#
# y = a * sqrt( 1 - e ^ 2 ) * sin E
#
# For computing M from an orbit.
#
# M = M_0 + ( 2 * pi * t / T )
#
# The solution E( M, e ) is a transcendental f... | false | true |
f76d53a85fab922864f124c0713ef41925687897 | 2,597 | py | Python | portal/settings.py | elkoutwest/Pound-Cake | 9da88e70df3d1c5db6d1ab19ad5f375649c4e730 | [
"MIT"
] | null | null | null | portal/settings.py | elkoutwest/Pound-Cake | 9da88e70df3d1c5db6d1ab19ad5f375649c4e730 | [
"MIT"
] | null | null | null | portal/settings.py | elkoutwest/Pound-Cake | 9da88e70df3d1c5db6d1ab19ad5f375649c4e730 | [
"MIT"
] | null | null | null | """
Django settings for portal project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
imp... | 22.196581 | 71 | 0.703119 |
import os
import sys
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
SECRET_KEY = '_7#n0ifs6*zv33piiq#(x5z23j4laegech*(dzmfrgm5onwz^^'
DEBUG = True
TEMPLATE_DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.co... | true | true |
f76d53defda8aa8c21b3a5f587fa15a7139dc8f8 | 14,653 | py | Python | test_wsgi_kerberos.py | mkomitee/wsgi-kerberos | b2364b6cc2bb23302c1a09713c7418f19c83a3d5 | [
"BSD-2-Clause"
] | 10 | 2015-03-25T09:15:55.000Z | 2020-09-13T10:48:47.000Z | test_wsgi_kerberos.py | deshaw/wsgi-kerberos | cc64c9ee72431df40309493f7645e43e0d53daae | [
"BSD-3-Clause"
] | 20 | 2020-12-12T14:36:15.000Z | 2022-01-03T21:40:57.000Z | test_wsgi_kerberos.py | mkomitee/wsgi-kerberos | b2364b6cc2bb23302c1a09713c7418f19c83a3d5 | [
"BSD-2-Clause"
] | 5 | 2016-12-14T15:03:05.000Z | 2020-09-26T19:38:05.000Z | from wsgi_kerberos import KerberosAuthMiddleware, ensure_bytestring, _DEFAULT_READ_MAX
from webtest import TestApp, TestRequest
import kerberos
import mock
import unittest
def index(environ, start_response):
start_response('200 OK', [('Content-Type', 'text/plain')])
response_body = 'Hello %s' % environ.get('R... | 45.506211 | 94 | 0.659524 | from wsgi_kerberos import KerberosAuthMiddleware, ensure_bytestring, _DEFAULT_READ_MAX
from webtest import TestApp, TestRequest
import kerberos
import mock
import unittest
def index(environ, start_response):
start_response('200 OK', [('Content-Type', 'text/plain')])
response_body = 'Hello %s' % environ.get('R... | true | true |
f76d549ac2958f7bc1805dd6c5f6090ab9f7f9b2 | 1,728 | py | Python | src/azure-cli/azure/cli/command_modules/acs/tests/latest/mocks.py | staer/azure-cli | 93c47df7565a6ff1bca080bd68be2a8252545def | [
"MIT"
] | 3,287 | 2016-07-26T17:34:33.000Z | 2022-03-31T09:52:13.000Z | src/azure-cli/azure/cli/command_modules/acs/tests/latest/mocks.py | staer/azure-cli | 93c47df7565a6ff1bca080bd68be2a8252545def | [
"MIT"
] | 19,206 | 2016-07-26T07:04:42.000Z | 2022-03-31T23:57:09.000Z | src/azure-cli/azure/cli/command_modules/acs/tests/latest/mocks.py | staer/azure-cli | 93c47df7565a6ff1bca080bd68be2a8252545def | [
"MIT"
] | 2,575 | 2016-07-26T06:44:40.000Z | 2022-03-31T22:56:06.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 29.288136 | 94 | 0.603009 |
from knack import CLI
import tempfile
from azure.cli.core import AzCommandsLoader
from azure.cli.core.cloud import get_active_cloud
from azure.cli.core.commands import AzCliCommand
from azure.cli.core._config import ENV_VAR_PREFIX
MOCK_CLI_CONFIG_DIR = tempfile.mkdtemp()
MOCK_CLI_ENV_VAR_PREFIX = "MOCK_" + ENV_VAR_P... | true | true |
f76d555875795991be69d3f824e2899ab778d331 | 713 | py | Python | examples/double_fhn_restricted_lyap.py | neurophysik/jitcode | cbc815da01974597057c8d78f74d16169bdad580 | [
"BSD-3-Clause"
] | 56 | 2016-06-17T15:53:01.000Z | 2022-03-17T16:47:00.000Z | examples/double_fhn_restricted_lyap.py | neurophysik/jitcode | cbc815da01974597057c8d78f74d16169bdad580 | [
"BSD-3-Clause"
] | 33 | 2016-08-16T11:41:42.000Z | 2022-03-05T16:09:41.000Z | examples/double_fhn_restricted_lyap.py | neurophysik/jitcode | cbc815da01974597057c8d78f74d16169bdad580 | [
"BSD-3-Clause"
] | 9 | 2016-07-19T19:00:27.000Z | 2019-11-19T00:36:38.000Z | #!/usr/bin/python3
# -*- coding: utf-8 -*-
from jitcode import jitcode_restricted_lyap, y
import numpy as np
from scipy.stats import sem
a = -0.025794
b1 = 0.01
b2 = 0.01
c = 0.02
k = 0.128
f = [
y(0) * ( a-y(0) ) * ( y(0)-1.0 ) - y(1) + k * (y(2) - y(0)),
b1*y(0) - c*y(1),
y(2) * ( a-y(2) ) * ( y(2)-1.0 )... | 20.371429 | 68 | 0.575035 |
from jitcode import jitcode_restricted_lyap, y
import numpy as np
from scipy.stats import sem
a = -0.025794
b1 = 0.01
b2 = 0.01
c = 0.02
k = 0.128
f = [
y(0) * ( a-y(0) ) * ( y(0)-1.0 ) - y(1) + k * (y(2) - y(0)),
b1*y(0) - c*y(1),
y(2) * ( a-y(2) ) * ( y(2)-1.0 ) - y(3) + k * (y(0) - y(2)),
b2*y(2) - c*y... | true | true |
f76d5561f3d032ae3e8d004b87f201f5093824a1 | 1,429 | py | Python | p871h/min_refuel_stops.py | l33tdaima/l33tdaima | 0a7a9573dc6b79e22dcb54357493ebaaf5e0aa90 | [
"MIT"
] | 1 | 2020-02-20T12:04:46.000Z | 2020-02-20T12:04:46.000Z | p871h/min_refuel_stops.py | l33tdaima/l33tdaima | 0a7a9573dc6b79e22dcb54357493ebaaf5e0aa90 | [
"MIT"
] | null | null | null | p871h/min_refuel_stops.py | l33tdaima/l33tdaima | 0a7a9573dc6b79e22dcb54357493ebaaf5e0aa90 | [
"MIT"
] | null | null | null | from typing import List
from heapq import heappush, heappop
class Solution:
def minRefuelStopsDP(
self, target: int, startFuel: int, stations: List[List[int]]
) -> int:
dp = [startFuel] + [0] * len(stations)
for i in range(len(stations)):
for t in range(i + 1)[::-1]:
... | 31.755556 | 83 | 0.522043 | from typing import List
from heapq import heappush, heappop
class Solution:
def minRefuelStopsDP(
self, target: int, startFuel: int, stations: List[List[int]]
) -> int:
dp = [startFuel] + [0] * len(stations)
for i in range(len(stations)):
for t in range(i + 1)[::-1]:
... | true | true |
f76d56626d98d3971d028d9f159a10eae4027104 | 132 | py | Python | output/models/saxon_data/missing/missing003_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/saxon_data/missing/missing003_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/saxon_data/missing/missing003_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from output.models.saxon_data.missing.missing003_xsd.missing003 import (
Bad,
Good,
)
__all__ = [
"Bad",
"Good",
]
| 13.2 | 72 | 0.636364 | from output.models.saxon_data.missing.missing003_xsd.missing003 import (
Bad,
Good,
)
__all__ = [
"Bad",
"Good",
]
| true | true |
f76d5746c5605bc9e000144273bf96d495934718 | 2,584 | py | Python | pyswagger/tests/v2_0/test_resolve.py | nzinfo/pyswagger | efde3ae756f0cd5a500f9ba90495e18a53d7df24 | [
"MIT"
] | null | null | null | pyswagger/tests/v2_0/test_resolve.py | nzinfo/pyswagger | efde3ae756f0cd5a500f9ba90495e18a53d7df24 | [
"MIT"
] | null | null | null | pyswagger/tests/v2_0/test_resolve.py | nzinfo/pyswagger | efde3ae756f0cd5a500f9ba90495e18a53d7df24 | [
"MIT"
] | 1 | 2020-03-04T00:22:24.000Z | 2020-03-04T00:22:24.000Z | from pyswagger import SwaggerApp, utils
from pyswagger.spec.v2_0 import objects
from ..utils import get_test_data_folder
import unittest
import os
class ResolvePathItemTestCase(unittest.TestCase):
""" test for PathItem $ref """
@classmethod
def setUpClass(kls):
kls.app = SwaggerApp._create_(get_t... | 31.512195 | 102 | 0.625774 | from pyswagger import SwaggerApp, utils
from pyswagger.spec.v2_0 import objects
from ..utils import get_test_data_folder
import unittest
import os
class ResolvePathItemTestCase(unittest.TestCase):
@classmethod
def setUpClass(kls):
kls.app = SwaggerApp._create_(get_test_data_folder(
versio... | true | true |
f76d598668b9c9f979dd039531325689438716db | 6,686 | py | Python | facial_features.py | okinter11/VTuber-Python-Unity | ebfdf729ffb07a1698acd07aa0e2baec0d6bbb02 | [
"MIT"
] | 127 | 2021-07-06T12:13:39.000Z | 2022-03-31T16:32:07.000Z | facial_features.py | okinter11/VTuber-Python-Unity | ebfdf729ffb07a1698acd07aa0e2baec0d6bbb02 | [
"MIT"
] | 10 | 2021-09-07T11:54:15.000Z | 2022-03-30T05:19:19.000Z | facial_features.py | okinter11/VTuber-Python-Unity | ebfdf729ffb07a1698acd07aa0e2baec0d6bbb02 | [
"MIT"
] | 22 | 2021-07-02T08:42:16.000Z | 2022-03-26T05:34:15.000Z | """
Miscellaneous facial features detection implementation
"""
import cv2
import numpy as np
from enum import Enum
class Eyes(Enum):
LEFT = 1
RIGHT = 2
class FacialFeatures:
eye_key_indicies=[
[
# Left eye
# eye lower contour
33,
7,
163... | 32.935961 | 161 | 0.552946 |
import cv2
import numpy as np
from enum import Enum
class Eyes(Enum):
LEFT = 1
RIGHT = 2
class FacialFeatures:
eye_key_indicies=[
[
33,
7,
163,
144,
145,
153,
154,
155,
133,
... | true | true |
f76d5a90b2bff669e11f1e3d4410a7b4c9568dff | 1,117 | py | Python | styles/lv_example_style_6.py | shownb/lv_mpy_examples_v8 | ae09b2d591ed182f2746274269dade7e6b93a6fe | [
"MIT"
] | 3 | 2021-04-30T10:13:38.000Z | 2021-12-06T05:51:09.000Z | styles/lv_example_style_6.py | shownb/lv_mpy_examples_v8 | ae09b2d591ed182f2746274269dade7e6b93a6fe | [
"MIT"
] | null | null | null | styles/lv_example_style_6.py | shownb/lv_mpy_examples_v8 | ae09b2d591ed182f2746274269dade7e6b93a6fe | [
"MIT"
] | 2 | 2021-06-01T15:35:40.000Z | 2021-11-29T21:21:04.000Z | #!//opt/bin/lv_micropython -i
import time
import lvgl as lv
import display_driver
from imagetools import get_png_info, open_png
# Register PNG image decoder
decoder = lv.img.decoder_create()
decoder.info_cb = get_png_info
decoder.open_cb = open_png
# Create an image from the png file
try:
with open('../assets/img... | 22.34 | 59 | 0.751119 | import time
import lvgl as lv
import display_driver
from imagetools import get_png_info, open_png
decoder = lv.img.decoder_create()
decoder.info_cb = get_png_info
decoder.open_cb = open_png
try:
with open('../assets/img_cogwheel_argb.png','rb') as f:
png_data = f.read()
except:
print("Could not find i... | true | true |
f76d5b348ae5a959fb3868e76745cd67c4cb82c8 | 446 | py | Python | run.py | hypersport/sysinfo | 69c2f40c8099d0b5a8c96dff61fab473d3b1b126 | [
"MIT"
] | 43 | 2017-05-01T00:14:02.000Z | 2022-03-15T01:34:42.000Z | run.py | hypersport/sysinfo | 69c2f40c8099d0b5a8c96dff61fab473d3b1b126 | [
"MIT"
] | 2 | 2020-05-14T02:55:02.000Z | 2021-08-15T06:20:37.000Z | run.py | hypersport/sysinfo | 69c2f40c8099d0b5a8c96dff61fab473d3b1b126 | [
"MIT"
] | 18 | 2017-05-01T14:06:11.000Z | 2020-08-11T09:18:24.000Z | from flask import Flask
from views import main
from views.custom_filters import format_time, format_size, socket_type, socket_family, format_addr_port
app = Flask(__name__)
app.add_template_filter(format_time)
app.add_template_filter(format_size)
app.add_template_filter(socket_type)
app.add_template_filter(socket_fami... | 29.733333 | 103 | 0.840807 | from flask import Flask
from views import main
from views.custom_filters import format_time, format_size, socket_type, socket_family, format_addr_port
app = Flask(__name__)
app.add_template_filter(format_time)
app.add_template_filter(format_size)
app.add_template_filter(socket_type)
app.add_template_filter(socket_fami... | true | true |
f76d5b5c1a555e55e1fcc8338add078431be9092 | 427 | py | Python | 2021/Python/6/lanternfish_1.py | ames0k0/AdventOfCode | 51c2d51ec36d92f6b4f7165bfba9bcdc3d5991c2 | [
"MIT"
] | null | null | null | 2021/Python/6/lanternfish_1.py | ames0k0/AdventOfCode | 51c2d51ec36d92f6b4f7165bfba9bcdc3d5991c2 | [
"MIT"
] | null | null | null | 2021/Python/6/lanternfish_1.py | ames0k0/AdventOfCode | 51c2d51ec36d92f6b4f7165bfba9bcdc3d5991c2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
def main():
input_file = './input_2.txt'
with open(input_file, 'r') as ftr:
fishes = list(map(int, ftr.read().strip().split(',')))
for _ in range(80):
for fidx, fish in enumerate(fishes[:]):
if (fish == 0):
fishes[fidx] = 6
fishes.appen... | 22.473684 | 58 | 0.555035 |
def main():
input_file = './input_2.txt'
with open(input_file, 'r') as ftr:
fishes = list(map(int, ftr.read().strip().split(',')))
for _ in range(80):
for fidx, fish in enumerate(fishes[:]):
if (fish == 0):
fishes[fidx] = 6
fishes.append(8)
else:
fishes[fidx] = (fish-1... | true | true |
f76d5dae65544cf8918bf7927cfba47e75700c82 | 4,032 | py | Python | pycwr/draw/colormap/cm.py | aliny2003/pycwr | 3186125bdd2f551b9c59639dca567a1c06b50e96 | [
"MIT"
] | 4 | 2019-12-24T06:07:59.000Z | 2020-10-13T02:24:18.000Z | pycwr/draw/colormap/cm.py | zhaopingsun/pycwr | 7459371588e6d0d6d0737e249afa3921fe073151 | [
"MIT"
] | null | null | null | pycwr/draw/colormap/cm.py | zhaopingsun/pycwr | 7459371588e6d0d6d0737e249afa3921fe073151 | [
"MIT"
] | null | null | null | """
this code is modified from pyart.graph.cm file, developed by Helmus, J.J. & Collis, S.M.
https://github.com/ARM-DOE/pyart
==============
Radar related colormaps.
.. autosummary::
:toctree: generated/
revcmap
_reverser
_reverse_cmap_spec
_generate_cmap
Available colormaps, reversed versions ... | 25.043478 | 92 | 0.634177 |
from __future__ import print_function, division
import warnings
import matplotlib as mpl
import matplotlib.colors as colors
from ._cm import datad
import matplotlib.cm
cmap_d = dict()
def _reverser(f):
def freversed(x):
return f(1 - x)
return freversed
def revcmap(data):
data_r = {}
for... | true | true |
f76d5ef8075eb53c2cb8081f782722a8e8cd32a6 | 119 | py | Python | services/web/test.py | PersonofNote/flask-react-postgres-boilerplate | f482df1923e6a31e862bad48c6d8727c3884d3ea | [
"MIT",
"PostgreSQL",
"Unlicense"
] | null | null | null | services/web/test.py | PersonofNote/flask-react-postgres-boilerplate | f482df1923e6a31e862bad48c6d8727c3884d3ea | [
"MIT",
"PostgreSQL",
"Unlicense"
] | null | null | null | services/web/test.py | PersonofNote/flask-react-postgres-boilerplate | f482df1923e6a31e862bad48c6d8727c3884d3ea | [
"MIT",
"PostgreSQL",
"Unlicense"
] | null | null | null | import unittest
from . import *
class HomePageTest(unittest.TestCase):
def test_home_page(self):
pass | 17 | 38 | 0.689076 | import unittest
from . import *
class HomePageTest(unittest.TestCase):
def test_home_page(self):
pass | true | true |
f76d5efbd50f74ebd28b1186dec88581e5c87453 | 1,355 | py | Python | dataset.py | keshavpdl/sign-language-recognition-using-cnn-and-tensorflow | 11e7255fd5d7bdc791626670db6274d41fbd9c58 | [
"Unlicense"
] | null | null | null | dataset.py | keshavpdl/sign-language-recognition-using-cnn-and-tensorflow | 11e7255fd5d7bdc791626670db6274d41fbd9c58 | [
"Unlicense"
] | null | null | null | dataset.py | keshavpdl/sign-language-recognition-using-cnn-and-tensorflow | 11e7255fd5d7bdc791626670db6274d41fbd9c58 | [
"Unlicense"
] | null | null | null | import cv2 # working with, mainly resizing, images
import numpy as np # dealing with arrays
import os # dealing with directories
from random import shuffle # mixing up or currently ordered data that might lead our network astray in training.
path='data'
IMG_SIZE = 96
... | 42.34375 | 127 | 0.575646 | import cv2 import numpy as np import os from random import shuffle
path='data'
IMG_SIZE = 96
def create_train_data():
training_data = []
label = 0
for (dirpath,dirnames,filenames) in os.walk(path):
for dirname in dirnames:
print(dirna... | true | true |
f76d5f99c16e2f0b4e973483607c9c98ffc72e93 | 5,331 | py | Python | day16/main.py | Jachoooo/AdventOfCode2021 | 90b1a98d76a391e2e54b961be5f83c6f8e86dadb | [
"MIT"
] | null | null | null | day16/main.py | Jachoooo/AdventOfCode2021 | 90b1a98d76a391e2e54b961be5f83c6f8e86dadb | [
"MIT"
] | null | null | null | day16/main.py | Jachoooo/AdventOfCode2021 | 90b1a98d76a391e2e54b961be5f83c6f8e86dadb | [
"MIT"
] | null | null | null | import time
from collections import deque
import numpy as np
from numpy import product
FILENAME="test4.txt"
if FILENAME=="test.txt":
D=True
else:
D=False
starttime=time.perf_counter()
print("\u001b[2J\u001b[0;0H")
with open(FILENAME,'r') as file:
msg='F'+file.readline()
print(msg[1:])
print(str(bin(in... | 24.56682 | 64 | 0.421309 | import time
from collections import deque
import numpy as np
from numpy import product
FILENAME="test4.txt"
if FILENAME=="test.txt":
D=True
else:
D=False
starttime=time.perf_counter()
print("\u001b[2J\u001b[0;0H")
with open(FILENAME,'r') as file:
msg='F'+file.readline()
print(msg[1:])
print(str(bin(in... | true | true |
f76d6022da72ec9d89f5eb296905c4f43c4c670b | 4,511 | py | Python | orca/modules/bert.py | IBM/urcanet | ce3f41eba23c24506ea2cf9e77cd3898a4eafbaf | [
"Apache-2.0"
] | 2 | 2020-03-21T19:09:24.000Z | 2020-07-08T07:52:55.000Z | orca/modules/bert.py | IBM/urcanet | ce3f41eba23c24506ea2cf9e77cd3898a4eafbaf | [
"Apache-2.0"
] | null | null | null | orca/modules/bert.py | IBM/urcanet | ce3f41eba23c24506ea2cf9e77cd3898a4eafbaf | [
"Apache-2.0"
] | 3 | 2020-03-21T19:12:16.000Z | 2020-11-17T10:02:44.000Z | import torch
import torch.nn as nn
from pytorch_pretrained_bert.modeling import BertEncoder, BertPooler, BertLayerNorm, BertPreTrainedModel
class BertEmbeddingsModified(nn.Module):
"""Construct the embeddings from word, position and token_type embeddings.
"""
def __init__(self, config):
super(Bert... | 55.012195 | 174 | 0.726003 | import torch
import torch.nn as nn
from pytorch_pretrained_bert.modeling import BertEncoder, BertPooler, BertLayerNorm, BertPreTrainedModel
class BertEmbeddingsModified(nn.Module):
def __init__(self, config):
super(BertEmbeddingsModified, self).__init__()
self.word_embeddings = nn.Embedding(config... | true | true |
f76d60e3261c44b26bc16a66488fd603ec0e368e | 521 | py | Python | isaacgymenvs/tasks/amp/poselib/poselib/core/__init__.py | ZaneZh/IsaacGymEnvs | adc20a5fbd70d77a716fefe86eb947f83d3efbd2 | [
"BSD-3-Clause"
] | 1 | 2022-03-26T12:55:04.000Z | 2022-03-26T12:55:04.000Z | isaacgymenvs/tasks/amp/poselib/poselib/core/__init__.py | ZaneZh/IsaacGymEnvs | adc20a5fbd70d77a716fefe86eb947f83d3efbd2 | [
"BSD-3-Clause"
] | null | null | null | isaacgymenvs/tasks/amp/poselib/poselib/core/__init__.py | ZaneZh/IsaacGymEnvs | adc20a5fbd70d77a716fefe86eb947f83d3efbd2 | [
"BSD-3-Clause"
] | 2 | 2022-03-19T13:45:54.000Z | 2022-03-23T07:23:19.000Z | # Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and relat... | 47.363636 | 76 | 0.8119 |
from .tensor_utils import *
from .rotation3d import *
from .backend import Serializable, logger
| true | true |
f76d619e528dc4d33238a699dc7bb7459aeb51fa | 718 | py | Python | fixture/soap.py | kasiazubielik/python_training_mantis | d2aecfb4c65cefafba753dfab1be38c8607518f0 | [
"Apache-2.0"
] | null | null | null | fixture/soap.py | kasiazubielik/python_training_mantis | d2aecfb4c65cefafba753dfab1be38c8607518f0 | [
"Apache-2.0"
] | null | null | null | fixture/soap.py | kasiazubielik/python_training_mantis | d2aecfb4c65cefafba753dfab1be38c8607518f0 | [
"Apache-2.0"
] | null | null | null | from suds.client import Client
from suds import WebFault
class SoapHelper:
def __init__(self, app):
self.app = app
def can_login(self, username, password):
client = Client("http://localhost/mantisbt-1.2.20/api/soap/mantisconnect.php?wsdl")
try:
client.service.mc_login(use... | 28.72 | 91 | 0.639276 | from suds.client import Client
from suds import WebFault
class SoapHelper:
def __init__(self, app):
self.app = app
def can_login(self, username, password):
client = Client("http://localhost/mantisbt-1.2.20/api/soap/mantisconnect.php?wsdl")
try:
client.service.mc_login(use... | true | true |
f76d62143b8e1fa514207d6381b4adbf58120f1a | 2,889 | py | Python | skos/method.py | edmondchuc/voc-view | 57bd965facacc77f40f218685c88e8b858d4925c | [
"MIT"
] | 3 | 2021-07-31T16:23:26.000Z | 2022-01-24T01:28:17.000Z | skos/method.py | edmondchuc/voc-view | 57bd965facacc77f40f218685c88e8b858d4925c | [
"MIT"
] | null | null | null | skos/method.py | edmondchuc/voc-view | 57bd965facacc77f40f218685c88e8b858d4925c | [
"MIT"
] | 1 | 2019-08-07T06:02:52.000Z | 2019-08-07T06:02:52.000Z | from pyldapi.renderer import Renderer
from pyldapi.view import View
from flask import render_template, Response
from rdflib import Graph, URIRef, BNode
import skos
from skos.common_properties import CommonPropertiesMixin
from config import Config
class Method(CommonPropertiesMixin):
def __init__(self, uri):
... | 40.125 | 128 | 0.602631 | from pyldapi.renderer import Renderer
from pyldapi.view import View
from flask import render_template, Response
from rdflib import Graph, URIRef, BNode
import skos
from skos.common_properties import CommonPropertiesMixin
from config import Config
class Method(CommonPropertiesMixin):
def __init__(self, uri):
... | true | true |
f76d634a69e77e197cf603305345f93890f5ad22 | 3,673 | py | Python | sdk/python/pulumi_azure_native/documentdb/v20151106/__init__.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/documentdb/v20151106/__init__.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/documentdb/v20151106/__init__.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
# Export this package's modules as members:
from ._enums import *
from .database_account import *
from .database_account_cassandra_keyspace import *
fr... | 51.013889 | 101 | 0.752246 |
# Export this package's modules as members:
from ._enums import *
from .database_account import *
from .database_account_cassandra_keyspace import *
from .database_account_cassandra_table import *
from .database_account_gremlin_database import *
from .database_account_gremlin_graph import *
from .database_account_mong... | true | true |
f76d634ad3b68abd02aa78c57849d24726b99a9a | 917 | py | Python | test gui.py | shogan50/paint_bot_ml | 53ab332445a4634888f926387695b7e77ed713f6 | [
"MIT"
] | null | null | null | test gui.py | shogan50/paint_bot_ml | 53ab332445a4634888f926387695b7e77ed713f6 | [
"MIT"
] | null | null | null | test gui.py | shogan50/paint_bot_ml | 53ab332445a4634888f926387695b7e77ed713f6 | [
"MIT"
] | null | null | null | import tkinter as tk
class Application(tk.Frame):
def __init__(self, master=None):
super().__init__(master)
self.master = master
self.pack()
self.create_widgets()
def create_widgets(self):
self.hi_there = tk.Button(self)
self.hi_there["text"] = "Hello World\n(cl... | 26.970588 | 58 | 0.586696 | import tkinter as tk
class Application(tk.Frame):
def __init__(self, master=None):
super().__init__(master)
self.master = master
self.pack()
self.create_widgets()
def create_widgets(self):
self.hi_there = tk.Button(self)
self.hi_there["text"] = "Hello World\n(cl... | true | true |
f76d64257eb711550446c4156f193f3c4dda02f7 | 94 | py | Python | backend/schedule/admin.py | LloydTao/Hackathon-NASA-2020-II | 6617f2dd3bafe1ccf5f086090c4fb92cae69012c | [
"MIT"
] | null | null | null | backend/schedule/admin.py | LloydTao/Hackathon-NASA-2020-II | 6617f2dd3bafe1ccf5f086090c4fb92cae69012c | [
"MIT"
] | 1 | 2020-10-03T08:24:12.000Z | 2020-10-03T08:24:12.000Z | backend/schedule/admin.py | LloydTao/Hackathon-NASA-2020-II | 6617f2dd3bafe1ccf5f086090c4fb92cae69012c | [
"MIT"
] | 1 | 2020-10-04T11:07:12.000Z | 2020-10-04T11:07:12.000Z | from django.contrib import admin
from .models import Schedule
admin.site.register(Schedule)
| 15.666667 | 32 | 0.819149 | from django.contrib import admin
from .models import Schedule
admin.site.register(Schedule)
| true | true |
f76d64316039b7d9d996fba0d17d39b324486381 | 1,309 | py | Python | bw_archive_test.py | RenolY2/battalion-tools | d7ea359c270a687559fb8183afded409b4dd33a0 | [
"MIT"
] | null | null | null | bw_archive_test.py | RenolY2/battalion-tools | d7ea359c270a687559fb8183afded409b4dd33a0 | [
"MIT"
] | null | null | null | bw_archive_test.py | RenolY2/battalion-tools | d7ea359c270a687559fb8183afded409b4dd33a0 | [
"MIT"
] | null | null | null | import struct
from bw_archive.bw_archive import BWArchive
if __name__ == "__main__":
import os
dir = "BattalionWars/BW1/Data/CompoundFiles"
files = os.listdir(dir)
out = "test.res"
sub_sections = [b"RXET", b"PRCS"]
for filename in files:
if not filename.endswith(".res"):
... | 25.173077 | 83 | 0.508785 | import struct
from bw_archive.bw_archive import BWArchive
if __name__ == "__main__":
import os
dir = "BattalionWars/BW1/Data/CompoundFiles"
files = os.listdir(dir)
out = "test.res"
sub_sections = [b"RXET", b"PRCS"]
for filename in files:
if not filename.endswith(".res"):
... | true | true |
f76d648c4845e5b772d9f92321b4c63b84668027 | 1,684 | py | Python | chatbot/utils/config.py | WLAN-Pi/wlanpi-chat-bot | c0dff0779eb873bd074fd0a579798252e4018ee2 | [
"MIT"
] | 1 | 2021-12-05T06:25:17.000Z | 2021-12-05T06:25:17.000Z | chatbot/utils/config.py | WLAN-Pi/wlanpi-chat-bot | c0dff0779eb873bd074fd0a579798252e4018ee2 | [
"MIT"
] | 6 | 2021-12-07T01:18:57.000Z | 2022-02-18T05:05:24.000Z | chatbot/utils/config.py | WLAN-Pi/wlanpi-chat-bot | c0dff0779eb873bd074fd0a579798252e4018ee2 | [
"MIT"
] | 1 | 2021-07-17T20:09:47.000Z | 2021-07-17T20:09:47.000Z | #!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
Manipulate the global config file
"""
import json
import logging
config_file = "/etc/wlanpi-chat-bot/config.json"
logging.basicConfig(level=logging.INFO)
class_logger = logging.getLogger("Config")
class Config(object):
"""
Manipulate the global config file
... | 25.515152 | 78 | 0.577197 |
import json
import logging
config_file = "/etc/wlanpi-chat-bot/config.json"
logging.basicConfig(level=logging.INFO)
class_logger = logging.getLogger("Config")
class Config(object):
def __init__(
self,
config_file=config_file,
):
self.config_file = config_file
self.config... | true | true |
f76d66234a7f4759823d72035c384006aa549a8c | 6,325 | py | Python | PriceRelativeRemoteSignalVXVOptimizerTwoAssetRiskReduction.py | adamrvfisher/TechnicalAnalysisLibrary | 38a22b2b2b5052623f81edb11b3c5460fc254e45 | [
"Apache-2.0"
] | 3 | 2019-04-26T11:13:14.000Z | 2020-01-10T05:58:16.000Z | PriceRelativeRemoteSignalVXVOptimizerTwoAssetRiskReduction.py | adamrvfisher/TechnicalAnalysisLibrary | 38a22b2b2b5052623f81edb11b3c5460fc254e45 | [
"Apache-2.0"
] | null | null | null | PriceRelativeRemoteSignalVXVOptimizerTwoAssetRiskReduction.py | adamrvfisher/TechnicalAnalysisLibrary | 38a22b2b2b5052623f81edb11b3c5460fc254e45 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@author: Adam Reinhold Von Fisher - https://www.linkedin.com/in/adamrvfisher/
"""
#This is a two asset portfolio/strategy tester with a brute force optimizer, lower max drawdown threshold in optimizer
#Import modules
import numpy as np
import random as rand
import pandas as p... | 31.157635 | 119 | 0.632411 | """
@author: Adam Reinhold Von Fisher - https://www.linkedin.com/in/adamrvfisher/
"""
import numpy as np
import random as rand
import pandas as pd
import time as t
from DatabaseGrabber import DatabaseGrabber
from YahooGrabber import YahooGrabber
Empty = []
Dataset = pd.DataFrame()
Portfolio = pd.Da... | false | true |
f76d66bcbf3dddf0e551c2193f94fca8b91d6656 | 1,127 | py | Python | mt_metadata/timeseries/electrode.py | kujaku11/mt_metadata | 92081e77550b737619f6c40c4ecb56e2e4d4d870 | [
"MIT"
] | 10 | 2021-01-08T23:38:45.000Z | 2022-03-31T14:01:45.000Z | mt_metadata/timeseries/electrode.py | kujaku11/mt_metadata | 92081e77550b737619f6c40c4ecb56e2e4d4d870 | [
"MIT"
] | 79 | 2021-01-09T03:24:30.000Z | 2022-03-18T05:28:15.000Z | mt_metadata/timeseries/electrode.py | kujaku11/mt_metadata | 92081e77550b737619f6c40c4ecb56e2e4d4d870 | [
"MIT"
] | 1 | 2022-03-02T01:11:38.000Z | 2022-03-02T01:11:38.000Z | # -*- coding: utf-8 -*-
"""
Created on Wed Dec 23 21:30:36 2020
:copyright:
Jared Peacock (jpeacock@usgs.gov)
:license: MIT
"""
# =============================================================================
# Imports
# =============================================================================
from mt_metada... | 28.175 | 79 | 0.475599 | from mt_metadata.base.helpers import write_lines
from mt_metadata.base import get_schema, Base
from .standards import SCHEMA_FN_PATHS
attr_dict = get_schema("instrument", SCHEMA_FN_PATHS)
attr_dict.add_dict(
get_schema("location", SCHEMA_FN_PATHS),
None,
keys=["latitude", "longitude", "elevation"],
)
clas... | true | true |
f76d670811613119b855c80c70ad07986201c616 | 9,940 | py | Python | cloudmersive_validate_api_client/models/geolocate_response.py | BrooksWatson717/Cloudmersive.APIClient.Python.Validate | cdef31b89f7b7298a556e80b6fd622086325e36b | [
"Apache-2.0"
] | null | null | null | cloudmersive_validate_api_client/models/geolocate_response.py | BrooksWatson717/Cloudmersive.APIClient.Python.Validate | cdef31b89f7b7298a556e80b6fd622086325e36b | [
"Apache-2.0"
] | null | null | null | cloudmersive_validate_api_client/models/geolocate_response.py | BrooksWatson717/Cloudmersive.APIClient.Python.Validate | cdef31b89f7b7298a556e80b6fd622086325e36b | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
validateapi
The validation APIs help you validate data. Check if an E-mail address is real. Check if a domain is real. Check up on an IP address, and even where it is located. All this and much more is available in the validation API. # noqa: E501
OpenAPI spec version: v1
Ge... | 29.321534 | 240 | 0.604728 |
import pprint
import re
import six
class GeolocateResponse(object):
swagger_types = {
'country_code': 'str',
'country_name': 'str',
'city': 'str',
'region_code': 'str',
'region_name': 'str',
'zip_code': 'str',
'timezone_standard_name': 'str',
'... | true | true |
f76d674a465160450e08e8d2a7fe3a94c2ada0b6 | 5,073 | py | Python | _check_cuda_numerical_stability.py | One-sixth/check_cuda_numerical_stability | 0229632f81e8558436132eb0a9d8e8c2b332cb81 | [
"MIT"
] | null | null | null | _check_cuda_numerical_stability.py | One-sixth/check_cuda_numerical_stability | 0229632f81e8558436132eb0a9d8e8c2b332cb81 | [
"MIT"
] | null | null | null | _check_cuda_numerical_stability.py | One-sixth/check_cuda_numerical_stability | 0229632f81e8558436132eb0a9d8e8c2b332cb81 | [
"MIT"
] | null | null | null | '''
用于检测cuda运算错误
'''
import torch
import torch.nn as nn
from torch.backends import cudnn
import argparse
import time
import math
def ConvBnAct(in_ch, out_ch, ker_sz, stride, pad, act=nn.Identity(), group=1, dilation=1):
return nn.Sequential(nn.Conv2d(in_ch, out_ch, ker_sz, stride, pad, groups=group, bias=False, ... | 31.70625 | 170 | 0.604376 |
import torch
import torch.nn as nn
from torch.backends import cudnn
import argparse
import time
import math
def ConvBnAct(in_ch, out_ch, ker_sz, stride, pad, act=nn.Identity(), group=1, dilation=1):
return nn.Sequential(nn.Conv2d(in_ch, out_ch, ker_sz, stride, pad, groups=group, bias=False, dilation=dilation),
... | true | true |
f76d693868fefa0c63ce9514472b8f47f4efadf3 | 3,960 | py | Python | mmdet/models/losses/ae_loss.py | mrzhuzhe/mmdetection | c04ca2c2a65500bc248a5d2ab6ace5b15f00064d | [
"Apache-2.0"
] | null | null | null | mmdet/models/losses/ae_loss.py | mrzhuzhe/mmdetection | c04ca2c2a65500bc248a5d2ab6ace5b15f00064d | [
"Apache-2.0"
] | null | null | null | mmdet/models/losses/ae_loss.py | mrzhuzhe/mmdetection | c04ca2c2a65500bc248a5d2ab6ace5b15f00064d | [
"Apache-2.0"
] | null | null | null | # Copyright (c) OpenMMLab. All rights reserved.
import mmcv
import torch
import torch.nn as nn
import torch.nn.functional as F
from ..builder import LOSSES
@mmcv.jit(derivate=True, coderize=True)
def ae_loss_per_image(tl_preds, br_preds, match):
"""Associative Embedding Loss in one image.
Assoc... | 38.076923 | 144 | 0.619444 | import mmcv
import torch
import torch.nn as nn
import torch.nn.functional as F
from ..builder import LOSSES
@mmcv.jit(derivate=True, coderize=True)
def ae_loss_per_image(tl_preds, br_preds, match):
tl_list, br_list, me_list = [], [], []
if len(match) == 0: pull_loss = tl_preds.sum() * 0... | true | true |
f76d69899f9ea9fb35f56f5aa123f93224e68e76 | 2,422 | py | Python | recipes/python/backup-restore/vm_backup.py | besantp/netbackup-api-code-samples | 8900df53c17faeec05379d9fb604fe438d17f8cd | [
"MIT"
] | 43 | 2018-03-18T16:03:34.000Z | 2022-03-30T16:30:06.000Z | recipes/python/backup-restore/vm_backup.py | besantp/netbackup-api-code-samples | 8900df53c17faeec05379d9fb604fe438d17f8cd | [
"MIT"
] | 36 | 2018-02-02T19:20:29.000Z | 2022-03-16T17:33:25.000Z | recipes/python/backup-restore/vm_backup.py | besantp/netbackup-api-code-samples | 8900df53c17faeec05379d9fb604fe438d17f8cd | [
"MIT"
] | 44 | 2018-05-21T06:05:34.000Z | 2022-02-18T04:14:46.000Z | """
The library contain functions related to NetBackup VM backup functionality.
"""
## The script can be run with Python 3.6 or higher version.
## The script requires 'requests' library to make the API calls.
import common
headers = {"Content-Type" : "application/vnd.netbackup+json;version=4.0"}
# Perform VM backu... | 47.490196 | 108 | 0.716763 |
import common
headers = {"Content-Type" : "application/vnd.netbackup+json;version=4.0"}
def perform_vm_backup(baseurl, token, protection_plan_id, asset_id, is_vm_group=0):
headers.update({'Authorization': token})
url = f"{baseurl}servicecatalog/slos/{protection_plan_id}/backup-now"
selection_type = "AS... | true | true |
f76d6c21921013e8a486a2880bd8025cac95a44d | 1,015 | py | Python | September 2020/06-File-Handling/05-Word-Count.py | eclipse-ib/Software-University-Professional-Advanced-Module | 636385f9e5521840f680644824d725d074b93c9a | [
"MIT"
] | null | null | null | September 2020/06-File-Handling/05-Word-Count.py | eclipse-ib/Software-University-Professional-Advanced-Module | 636385f9e5521840f680644824d725d074b93c9a | [
"MIT"
] | null | null | null | September 2020/06-File-Handling/05-Word-Count.py | eclipse-ib/Software-University-Professional-Advanced-Module | 636385f9e5521840f680644824d725d074b93c9a | [
"MIT"
] | null | null | null | import re
with open("words.txt", "w") as words_file:
words_file.write(input())
text_file = open("text.txt", "w")
while True:
line = input().lower()
if not line:
break
text_file.write(f"{line}\n")
text_file.close()
# Counting key words:
key_words = {}
with open("words.txt") as reading_words_... | 26.710526 | 100 | 0.64532 | import re
with open("words.txt", "w") as words_file:
words_file.write(input())
text_file = open("text.txt", "w")
while True:
line = input().lower()
if not line:
break
text_file.write(f"{line}\n")
text_file.close()
key_words = {}
with open("words.txt") as reading_words_file:
wds = readin... | true | true |
f76d6c2239ef61c2dd000a37f3bfe878c0c6f53c | 1,340 | py | Python | setup.py | dmateusp/pre-commit-hooks | ef0ccc4c341682bf88cf4e97a50ac8b083098340 | [
"MIT"
] | 1 | 2020-11-14T18:15:41.000Z | 2020-11-14T18:15:41.000Z | setup.py | dmateusp/pre-commit-hooks | ef0ccc4c341682bf88cf4e97a50ac8b083098340 | [
"MIT"
] | 6 | 2020-11-14T18:15:06.000Z | 2020-11-27T20:02:19.000Z | setup.py | dmateusp/pre-commit-hooks | ef0ccc4c341682bf88cf4e97a50ac8b083098340 | [
"MIT"
] | 1 | 2020-05-05T10:54:32.000Z | 2020-05-05T10:54:32.000Z | from setuptools import find_packages
from setuptools import setup
setup(
name='pre-commit-hooks',
description='Some out-of-the-box hooks for pre-commit',
url='https://github.com/Lucas-C/pre-commit-hooks',
version='1.1.9',
author='Lucas Cimon',
author_email='lucas.cimon@gmail.com',
platfor... | 32.682927 | 70 | 0.616418 | from setuptools import find_packages
from setuptools import setup
setup(
name='pre-commit-hooks',
description='Some out-of-the-box hooks for pre-commit',
url='https://github.com/Lucas-C/pre-commit-hooks',
version='1.1.9',
author='Lucas Cimon',
author_email='lucas.cimon@gmail.com',
platfor... | true | true |
f76d6ccde7153563c8c46baf67cfa0af92bcba82 | 5,906 | py | Python | ase_notebook/atoms_convert.py | PhilippRue/ase-notebook | 46205d7e1b0e5a48a3ca61d84d4ee877eea19e62 | [
"MIT"
] | 7 | 2019-11-10T20:45:11.000Z | 2022-02-07T22:01:35.000Z | ase_notebook/atoms_convert.py | PhilippRue/ase-notebook | 46205d7e1b0e5a48a3ca61d84d4ee877eea19e62 | [
"MIT"
] | 18 | 2019-11-10T19:09:15.000Z | 2022-01-13T01:49:05.000Z | ase_notebook/atoms_convert.py | PhilippRue/ase-notebook | 46205d7e1b0e5a48a3ca61d84d4ee877eea19e62 | [
"MIT"
] | 3 | 2019-12-27T17:33:58.000Z | 2021-08-17T13:43:52.000Z | """Module for serializing ``ase.Atoms``."""
# TODO very recent versions of ase.Atoms have `todict` and `fromdict` methods, ands
# see: https://gitlab.com/ase/ase/atoms.py and
# https://gitlab.com/ase/ase/blob/master/ase/io/jsonio.py
import datetime
import json
import ase
from ase.constraints import dict2constraint
imp... | 32.273224 | 86 | 0.60447 | import datetime
import json
import ase
from ase.constraints import dict2constraint
import numpy as np
class ASEEncoder(json.JSONEncoder):
def default(self, obj):
if hasattr(obj, "todict"):
d = obj.todict()
if not isinstance(d, dict):
raise RuntimeError(
... | true | true |
f76d6d82a72cdc740993691bdf9b3476554e9ed1 | 407 | py | Python | src/_test/testSimply.py | ChengShusss/spt | f68e6b317ae64237aec5d0a058064804a28996d1 | [
"MIT"
] | null | null | null | src/_test/testSimply.py | ChengShusss/spt | f68e6b317ae64237aec5d0a058064804a28996d1 | [
"MIT"
] | null | null | null | src/_test/testSimply.py | ChengShusss/spt | f68e6b317ae64237aec5d0a058064804a28996d1 | [
"MIT"
] | null | null | null | #!/usr/local/bin/python3
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
# Setup, and create the data to plot
y = np.random.rand(100000)
y[50000:] *= 2
y[np.geomspace(10, 50000, 400).astype(int)] = -1
mpl.rcParams['path.simplify'] = True
mpl.rcParams['path.simplify_threshold'] = 0.0
plt.p... | 21.421053 | 48 | 0.719902 |
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
y = np.random.rand(100000)
y[50000:] *= 2
y[np.geomspace(10, 50000, 400).astype(int)] = -1
mpl.rcParams['path.simplify'] = True
mpl.rcParams['path.simplify_threshold'] = 0.0
plt.plot(y)
plt.show()
mpl.rcParams['path.simplify_threshold'] = 1... | true | true |
f76d6deeaca3acfe1190b3bb052071a0cf831f52 | 3,819 | py | Python | scripts/gestureClassifier.py | DennisMelamed/crazyFrog | 25ffa0e6616f7195d034189eef7348d16157215e | [
"MIT"
] | 2 | 2018-01-19T13:16:36.000Z | 2018-01-19T18:39:35.000Z | scripts/gestureClassifier.py | DennisMelamed/crazyFrog | 25ffa0e6616f7195d034189eef7348d16157215e | [
"MIT"
] | null | null | null | scripts/gestureClassifier.py | DennisMelamed/crazyFrog | 25ffa0e6616f7195d034189eef7348d16157215e | [
"MIT"
] | 1 | 2018-09-28T14:30:59.000Z | 2018-09-28T14:30:59.000Z | #
#Authors: Owen Levin, Dennis Melamed
#
import numpy as np
from sklearn import neighbors, datasets
import pickle
import glob
import os
import time
import rospy
import pprint
from leap_motion.msg import leapros
from std_msgs.msg import Int32
gesture_class_nums = { "0":0,#
"1":1,#
... | 30.798387 | 112 | 0.612464 | import numpy as np
from sklearn import neighbors, datasets
import pickle
import glob
import os
import time
import rospy
import pprint
from leap_motion.msg import leapros
from std_msgs.msg import Int32
gesture_class_nums = { "0":0, "1":1, "2":2, ... | false | true |
f76d6e5ab5612cc18eee283bec82673abec909be | 20,775 | py | Python | src/sage/tensor/modules/free_module_homset.py | defeo/sage | d8822036a9843bd4d75845024072515ede56bcb9 | [
"BSL-1.0"
] | 2 | 2018-06-30T01:37:35.000Z | 2018-06-30T01:37:39.000Z | src/sage/tensor/modules/free_module_homset.py | boothby/sage | 1b1e6f608d1ef8ee664bb19e991efbbc68cbd51f | [
"BSL-1.0"
] | null | null | null | src/sage/tensor/modules/free_module_homset.py | boothby/sage | 1b1e6f608d1ef8ee664bb19e991efbbc68cbd51f | [
"BSL-1.0"
] | null | null | null | r"""
Sets of morphisms between free modules
The class :class:`FreeModuleHomset` implements sets of homomorphisms between
two free modules of finite rank over the same commutative ring.
AUTHORS:
- Eric Gourgoulhon, Michal Bejger (2014-2015): initial version
REFERENCES:
- Chaps. 13, 14 of R. Godement : *Algebra*, He... | 38.615242 | 107 | 0.560529 | from __future__ import absolute_import
from sage.categories.homset import Homset
from sage.tensor.modules.free_module_morphism import FiniteRankFreeModuleMorphism
from sage.tensor.modules.free_module_automorphism import FreeModuleAutomorphism
from sage.tensor.modules.free_module_tensor import FreeModuleTensor
class F... | true | true |
f76d6f45ffd51ea559e535dafc2a8e3bb8bc8974 | 2,377 | py | Python | transformer/ffn_layer.py | upc-arco/PCA-DIRIE-Pruning | 697ce664786e9791c7cf8911e642b3e6e70d7b98 | [
"Apache-2.0"
] | null | null | null | transformer/ffn_layer.py | upc-arco/PCA-DIRIE-Pruning | 697ce664786e9791c7cf8911e642b3e6e70d7b98 | [
"Apache-2.0"
] | null | null | null | transformer/ffn_layer.py | upc-arco/PCA-DIRIE-Pruning | 697ce664786e9791c7cf8911e642b3e6e70d7b98 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 33.478873 | 76 | 0.717711 |
import tensorflow as tf
from pruning import custom_layers
class FeedForwardNetwork(tf.keras.layers.Layer):
def __init__(self, hidden_size, filter_size, relu_dropout):
super(FeedForwardNetwork, self).__init__()
self.hidden_size = hidden_size
self.filter_size = filter_size
self.relu_dropout = relu_d... | true | true |
f76d70b5315f25d4b703dd0dd4d999f46f5a98d1 | 18,051 | py | Python | tracks/Fumiaki_Loop.py | dp770/aws_deepracer_worksheet | 162b8f1c643c5b8ece33b9f9a35b7b4a513f905f | [
"MIT"
] | 1 | 2022-02-28T23:13:02.000Z | 2022-02-28T23:13:02.000Z | tracks/Fumiaki_Loop.py | dp770/aws_deepracer_worksheet | 162b8f1c643c5b8ece33b9f9a35b7b4a513f905f | [
"MIT"
] | 1 | 2022-01-10T17:22:33.000Z | 2022-03-14T23:44:03.000Z | tracks/Fumiaki_Loop.py | dp770/aws_deepracer_worksheet | 162b8f1c643c5b8ece33b9f9a35b7b4a513f905f | [
"MIT"
] | 1 | 2022-01-16T10:45:30.000Z | 2022-01-16T10:45:30.000Z | track_width = 0.9143985009502611
track_original = [(1.3333835005760193, -2.8131200075149536), (1.183136522769928, -2.8104419708251953),
(1.0328985452651978, -2.8073339462280273), (0.8826694488525391, -2.8037965297698975),
(0.7324512302875519, -2.7998324632644653), (0.5822446346282959... | 100.843575 | 106 | 0.649992 | track_width = 0.9143985009502611
track_original = [(1.3333835005760193, -2.8131200075149536), (1.183136522769928, -2.8104419708251953),
(1.0328985452651978, -2.8073339462280273), (0.8826694488525391, -2.8037965297698975),
(0.7324512302875519, -2.7998324632644653), (0.5822446346282959... | true | true |
f76d70cdfda07bd24bd4240a9b371c7c2671323b | 22,783 | py | Python | nova/tests/unit/api/openstack/compute/contrib/test_multiple_create.py | TMaddox/nova | e5c169d15528a8e2eadb8eca668ea0d183cf8648 | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/api/openstack/compute/contrib/test_multiple_create.py | TMaddox/nova | e5c169d15528a8e2eadb8eca668ea0d183cf8648 | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/api/openstack/compute/contrib/test_multiple_create.py | TMaddox/nova | e5c169d15528a8e2eadb8eca668ea0d183cf8648 | [
"Apache-2.0"
] | 2 | 2016-06-13T09:26:10.000Z | 2020-07-24T01:23:26.000Z | # Copyright 2013 IBM Corp.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 38.746599 | 79 | 0.589562 |
import datetime
import uuid
from oslo_config import cfg
import webob
from nova.api.openstack.compute import plugins
from nova.api.openstack.compute.plugins.v3 import block_device_mapping as \
block_device_mapping_v21
from nova.api.openstack.compute.plugins.v3 import multiple_create as \
multiple_create_v21
f... | true | true |
f76d710a27fea44323785fc1996f45d43d4ec537 | 6,488 | py | Python | eyeTrackingUsingOpenCV.py | batucimenn/eyeTrackingUsingOpenCV | 4f6c3249cb52f04208405a9ac48ccf41d0d38364 | [
"MIT"
] | null | null | null | eyeTrackingUsingOpenCV.py | batucimenn/eyeTrackingUsingOpenCV | 4f6c3249cb52f04208405a9ac48ccf41d0d38364 | [
"MIT"
] | null | null | null | eyeTrackingUsingOpenCV.py | batucimenn/eyeTrackingUsingOpenCV | 4f6c3249cb52f04208405a9ac48ccf41d0d38364 | [
"MIT"
] | null | null | null | import cv2
import numpy as np
import dlib
import time
import matplotlib.pyplot as plt
from math import hypot,ceil
#cap = cv2.VideoCapture("projectvideo.mp4")
cap = cv2.VideoCapture(0)
liste=[]
detector = dlib.get_frontal_face_detector()
predictor = dlib.shape_predictor("shape_predictor_68_face_landmarks.dat... | 38.619048 | 125 | 0.606196 | import cv2
import numpy as np
import dlib
import time
import matplotlib.pyplot as plt
from math import hypot,ceil
cap = cv2.VideoCapture(0)
liste=[]
detector = dlib.get_frontal_face_detector()
predictor = dlib.shape_predictor("shape_predictor_68_face_landmarks.dat")
def midpoint(p1 ,p2):
return int((... | true | true |
f76d71c9f25c7972983bac4a6794423f1c9053f9 | 194 | py | Python | api/admin.py | igor-markin/Social-Network-API | d4653606b30a728030dad61d27d96b0588d5c478 | [
"Apache-2.0"
] | null | null | null | api/admin.py | igor-markin/Social-Network-API | d4653606b30a728030dad61d27d96b0588d5c478 | [
"Apache-2.0"
] | null | null | null | api/admin.py | igor-markin/Social-Network-API | d4653606b30a728030dad61d27d96b0588d5c478 | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
from .models import Comment, Follow, Group, Post
admin.site.register(Post)
admin.site.register(Group)
admin.site.register(Comment)
admin.site.register(Follow)
| 21.555556 | 48 | 0.804124 | from django.contrib import admin
from .models import Comment, Follow, Group, Post
admin.site.register(Post)
admin.site.register(Group)
admin.site.register(Comment)
admin.site.register(Follow)
| true | true |
f76d71f082f7f7c99ffd48c06ffbf3f94091cacd | 3,602 | py | Python | bindings/python/ensmallen/datasets/string/gemmatimonadetesbacteriumkbs708.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/gemmatimonadetesbacteriumkbs708.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/gemmatimonadetesbacteriumkbs708.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 3 | 2021-01-14T02:20:59.000Z | 2021-08-04T19:09:52.000Z | """
This file offers the methods to automatically retrieve the graph Gemmatimonadetes bacterium KBS708.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: prote... | 33.351852 | 223 | 0.681566 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen import Graph
def GemmatimonadetesBacteriumKbs708(
directed: bool = False,
preprocess: bool = True,
load_nodes: bool = True,
verbose: int = 2,
cache: bool = True,
cache_path: str = "g... | true | true |
f76d722d3f4e6c27bac76f91de1d5e5204f51e9c | 12,582 | py | Python | gunicorn/http/wsgi.py | CharaD7/gunicorn | 58108ef7e6836fc545f0614846ffed61f34c48fd | [
"MIT"
] | null | null | null | gunicorn/http/wsgi.py | CharaD7/gunicorn | 58108ef7e6836fc545f0614846ffed61f34c48fd | [
"MIT"
] | null | null | null | gunicorn/http/wsgi.py | CharaD7/gunicorn | 58108ef7e6836fc545f0614846ffed61f34c48fd | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -
#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.
import io
import logging
import os
import re
import sys
from gunicorn._compat import unquote_to_wsgi_str
from gunicorn.six import string_types, binary_type, reraise
from gunicorn import SERVE... | 31.220844 | 78 | 0.573677 |
import io
import logging
import os
import re
import sys
from gunicorn._compat import unquote_to_wsgi_str
from gunicorn.six import string_types, binary_type, reraise
from gunicorn import SERVER_SOFTWARE
import gunicorn.util as util
try:
from os import sendfile
except ImportError:
try:
from ._sendf... | true | true |
f76d72828499ae3073484fce6a655abfb0175a67 | 14,986 | py | Python | src/poliastro/twobody/propagation.py | jtegedor/poliastro | 48c854a4ad5500116f7c09ca171f77a60e2de04b | [
"MIT"
] | 1 | 2022-03-06T17:35:20.000Z | 2022-03-06T17:35:20.000Z | src/poliastro/twobody/propagation.py | jtegedor/poliastro | 48c854a4ad5500116f7c09ca171f77a60e2de04b | [
"MIT"
] | null | null | null | src/poliastro/twobody/propagation.py | jtegedor/poliastro | 48c854a4ad5500116f7c09ca171f77a60e2de04b | [
"MIT"
] | null | null | null | """The following script holds the different high level functions for the
different propagators available at poliastro:
+-------------+------------+-----------------+-----------------+
| Propagator | Elliptical | Parabolic | Hyperbolic |
+-------------+------------+-----------------+-----------------+
| fa... | 29.099029 | 99 | 0.575804 | import numpy as np
from astropy import units as u
from astropy.coordinates import CartesianDifferential, CartesianRepresentation
from scipy.integrate import DOP853, solve_ivp
from poliastro.core.propagation import (
danby as danby_fast,
farnocchia as farnocchia_fast,
func_twobody,
gooding as gooding_fa... | true | true |
f76d728453b41f0b1b9d19a478a896b394cae288 | 331 | py | Python | codershq/challenge/apps.py | saeedhassan/CodersHQ | 6c029c8f3f4507d02b6253aae87ec64cf8b7e04b | [
"MIT"
] | 1 | 2022-02-03T00:57:37.000Z | 2022-02-03T00:57:37.000Z | codershq/challenge/apps.py | saeedhassan/CodersHQ | 6c029c8f3f4507d02b6253aae87ec64cf8b7e04b | [
"MIT"
] | null | null | null | codershq/challenge/apps.py | saeedhassan/CodersHQ | 6c029c8f3f4507d02b6253aae87ec64cf8b7e04b | [
"MIT"
] | 1 | 2022-02-27T16:08:16.000Z | 2022-02-27T16:08:16.000Z | from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class ChallengeConfig(AppConfig):
name = "codershq.challenge"
verbose_name = _("Challenges")
def ready(self):
try:
import codershq.challenge.signals # noqa F401
except ImportError:
... | 23.642857 | 58 | 0.673716 | from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class ChallengeConfig(AppConfig):
name = "codershq.challenge"
verbose_name = _("Challenges")
def ready(self):
try:
import codershq.challenge.signals except ImportError:
pass
| true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.