hexsha
stringlengths
40
40
size
int64
4
996k
ext
stringclasses
8 values
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
4
245
max_stars_repo_name
stringlengths
6
130
max_stars_repo_head_hexsha
stringlengths
40
40
max_stars_repo_licenses
listlengths
1
10
max_stars_count
int64
1
191k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
4
245
max_issues_repo_name
stringlengths
6
130
max_issues_repo_head_hexsha
stringlengths
40
40
max_issues_repo_licenses
listlengths
1
10
max_issues_count
int64
1
67k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
4
245
max_forks_repo_name
stringlengths
6
130
max_forks_repo_head_hexsha
stringlengths
40
40
max_forks_repo_licenses
listlengths
1
10
max_forks_count
int64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
4
996k
avg_line_length
float64
1.33
58.2k
max_line_length
int64
2
323k
alphanum_fraction
float64
0
0.97
content_no_comment
stringlengths
0
946k
is_comment_constant_removed
bool
2 classes
is_sharp_comment_removed
bool
1 class
f72cd9912a6e17b5b29517176042c7b23c21a2e0
557
py
Python
DiseaseIdentifier/DiseaseClassify/migrations/0001_initial.py
Rosan93/Disease-Identifier
6bf311c833ecaa3769ebf09c6d752a9ec7ebfdb4
[ "Apache-2.0" ]
null
null
null
DiseaseIdentifier/DiseaseClassify/migrations/0001_initial.py
Rosan93/Disease-Identifier
6bf311c833ecaa3769ebf09c6d752a9ec7ebfdb4
[ "Apache-2.0" ]
18
2020-01-28T22:44:38.000Z
2021-06-10T18:55:20.000Z
DiseaseIdentifier/DiseaseClassify/migrations/0001_initial.py
RoshanGurungSr/Disease-Identifier
6bf311c833ecaa3769ebf09c6d752a9ec7ebfdb4
[ "Apache-2.0" ]
null
null
null
# Generated by Django 2.2.1 on 2019-05-15 08:29 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='UploadImage', fields=[ ('id', models.AutoFi...
24.217391
114
0.574506
from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='UploadImage', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serial...
true
true
f72cdab5d2b024368267933b507634792f303004
472
py
Python
venv/Scripts/easy_install-3.8-script.py
rushermonza/CoronavirusWebScraper
4c7d31dbb51ae7d791c620673ca6f36d1ef43e3e
[ "MIT" ]
1
2020-04-04T04:55:20.000Z
2020-04-04T04:55:20.000Z
venv/Scripts/easy_install-3.8-script.py
AntoData/CoronavirusWebScraper
4c7d31dbb51ae7d791c620673ca6f36d1ef43e3e
[ "MIT" ]
null
null
null
venv/Scripts/easy_install-3.8-script.py
AntoData/CoronavirusWebScraper
4c7d31dbb51ae7d791c620673ca6f36d1ef43e3e
[ "MIT" ]
null
null
null
#!C:\Users\ingov\PycharmProjects\CoronavirusWebScraper\venv\Scripts\python.exe # EASY-INSTALL-ENTRY-SCRIPT: 'setuptools==40.8.0','console_scripts','easy_install-3.8' __requires__ = 'setuptools==40.8.0' import re import sys from pkg_resources import load_entry_point if __name__ == '__main__': sys.argv[0] = re.sub(r...
36.307692
87
0.70339
__requires__ = 'setuptools==40.8.0' import re import sys from pkg_resources import load_entry_point if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) sys.exit( load_entry_point('setuptools==40.8.0', 'console_scripts', 'easy_install-3.8')() )
true
true
f72cdb329eab3ceed1d52538e15d5d30dc8b84c0
9,798
py
Python
sphinx-doc/conf.py
kmoskovtsev/HOOMD-Blue-fork
99560563a5ba9e082b513764bae51a84f48fdc70
[ "BSD-3-Clause" ]
null
null
null
sphinx-doc/conf.py
kmoskovtsev/HOOMD-Blue-fork
99560563a5ba9e082b513764bae51a84f48fdc70
[ "BSD-3-Clause" ]
null
null
null
sphinx-doc/conf.py
kmoskovtsev/HOOMD-Blue-fork
99560563a5ba9e082b513764bae51a84f48fdc70
[ "BSD-3-Clause" ]
null
null
null
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # HOOMD-blue documentation build configuration file, created by # sphinx-quickstart on Sun Mar 13 13:14:54 2016. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this #...
32.66
95
0.716881
import sys import os sys.path.insert(0, os.path.abspath('..')) extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.autosummary', 'sphinx.ext.napoleon', 'sphinx.ext.intersphinx', 'sphinx.ext.mathjax' ] intersphinx_mapping = {'python': ('https://docs.python.org/3', None)} aut...
true
true
f72cdbc3ff47642e64c41dd8ddf1126531344739
1,481
py
Python
trac/upgrades/db45.py
NetSpida/trac
6ad75b926591e114ba504f6a72a38fd305d77fb1
[ "BSD-3-Clause" ]
null
null
null
trac/upgrades/db45.py
NetSpida/trac
6ad75b926591e114ba504f6a72a38fd305d77fb1
[ "BSD-3-Clause" ]
null
null
null
trac/upgrades/db45.py
NetSpida/trac
6ad75b926591e114ba504f6a72a38fd305d77fb1
[ "BSD-3-Clause" ]
null
null
null
# -*- coding: utf-8 -*- # # Copyright (C) 2017 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac.edgewall.com/license.html. # # This software consists of vo...
33.659091
72
0.665766
import re from trac.upgrades import backup_config_file def do_upgrade(env, version, cursor): config = env.config section = 'notification' re_template_var = re.compile(r'\$([\w.]+)') def update_template(name): old_value = config.get(section, name) if old_value: ...
true
true
f72cdbeb98f60ad142bf63a1d749cae5063e128a
13,596
py
Python
train_shape.py
EXJUSTICE/pointnet2
749a38fde6370fc7dee535855008bc5bc8468c0e
[ "MIT" ]
null
null
null
train_shape.py
EXJUSTICE/pointnet2
749a38fde6370fc7dee535855008bc5bc8468c0e
[ "MIT" ]
null
null
null
train_shape.py
EXJUSTICE/pointnet2
749a38fde6370fc7dee535855008bc5bc8468c0e
[ "MIT" ]
null
null
null
''' Single-GPU training. Will use H5 dataset in default. If using normal, will shift to the normal dataset. ''' import argparse import math from datetime import datetime import h5py import numpy as np import tensorflow.compat.v1 as tf tf.disable_v2_behavior() import socket import importlib import os import sys ...
42.62069
186
0.629009
''' Single-GPU training. Will use H5 dataset in default. If using normal, will shift to the normal dataset. ''' import argparse import math from datetime import datetime import h5py import numpy as np import tensorflow.compat.v1 as tf tf.disable_v2_behavior() import socket import importlib import os import sys ...
false
true
f72cdbf3665a2f5be56dde69f5e801552be52144
4,726
py
Python
Code/PostProcessing/Cloud.py
ChimieleCode/OpenSees_Script
58dcd187e5eda1bf92f8f2c4fc83b74d9108372d
[ "MIT" ]
null
null
null
Code/PostProcessing/Cloud.py
ChimieleCode/OpenSees_Script
58dcd187e5eda1bf92f8f2c4fc83b74d9108372d
[ "MIT" ]
null
null
null
Code/PostProcessing/Cloud.py
ChimieleCode/OpenSees_Script
58dcd187e5eda1bf92f8f2c4fc83b74d9108372d
[ "MIT" ]
null
null
null
import csv import math from ModelOptions import compute_local_fragility from PostProcessing.SectionGaps import global_DCR_DS1, global_DCR_DS2, global_DCR_DST, demand_capacity_ratio_DS1_matrix, demand_capacity_ratio_DS2_matrix, demand_capacity_ratio_DST_matrix from AnalysisDefinition.TimeHistory import spectral_re...
45.883495
1,734
0.566018
import csv import math from ModelOptions import compute_local_fragility from PostProcessing.SectionGaps import global_DCR_DS1, global_DCR_DS2, global_DCR_DST, demand_capacity_ratio_DS1_matrix, demand_capacity_ratio_DS2_matrix, demand_capacity_ratio_DST_matrix from AnalysisDefinition.TimeHistory import spectral_re...
true
true
f72cdcf0abad5566c247daf49ce163498192f41a
727
py
Python
stats/data.py
1in1/Python-Baseball
4c76d65330ff7eb88c87057be02bbddb50dd325b
[ "MIT" ]
null
null
null
stats/data.py
1in1/Python-Baseball
4c76d65330ff7eb88c87057be02bbddb50dd325b
[ "MIT" ]
null
null
null
stats/data.py
1in1/Python-Baseball
4c76d65330ff7eb88c87057be02bbddb50dd325b
[ "MIT" ]
null
null
null
import os import glob import pandas as pd game_files = glob.glob(os.path.join(os.getcwd(), 'games', '*.EVE')) game_files.sort() game_frames = [] for game_file in game_files: game_frame = pd.read_csv(game_file, names=['type','multi2','multi3','multi4','multi5','multi6','event']) game_frames.append(game_frame) ...
30.291667
108
0.678129
import os import glob import pandas as pd game_files = glob.glob(os.path.join(os.getcwd(), 'games', '*.EVE')) game_files.sort() game_frames = [] for game_file in game_files: game_frame = pd.read_csv(game_file, names=['type','multi2','multi3','multi4','multi5','multi6','event']) game_frames.append(game_frame) ...
true
true
f72cdd30f4d4087803dd4184985189860ea51326
2,545
py
Python
examples/other_examples/PyFstat_example_twoF_cumulative.py
RobertRosca/PyFstat
1c9568bb3dc87c3d33aeb41b3f572e9990665372
[ "MIT" ]
16
2020-01-28T08:40:02.000Z
2022-03-02T05:26:50.000Z
examples/other_examples/PyFstat_example_twoF_cumulative.py
RobertRosca/PyFstat
1c9568bb3dc87c3d33aeb41b3f572e9990665372
[ "MIT" ]
294
2020-02-04T17:15:26.000Z
2022-03-30T13:53:48.000Z
examples/other_examples/PyFstat_example_twoF_cumulative.py
RobertRosca/PyFstat
1c9568bb3dc87c3d33aeb41b3f572e9990665372
[ "MIT" ]
10
2020-02-04T16:57:55.000Z
2022-02-03T00:12:25.000Z
""" Cumulative coherent 2F ====================== Compute the cumulative coherent F-statistic of a signal candidate. """ import os import numpy as np import pyfstat from pyfstat.helper_functions import get_predict_fstat_parameters_from_dict label = "PyFstat_example_twoF_cumulative" outdir = os.path.join("PyFstat_e...
25.45
85
0.633792
import os import numpy as np import pyfstat from pyfstat.helper_functions import get_predict_fstat_parameters_from_dict label = "PyFstat_example_twoF_cumulative" outdir = os.path.join("PyFstat_example_data", label) gw_data = { "sqrtSX": 1e-23, "tstart": 1000000000, "duration": 100 * 86400, "detect...
true
true
f72cdd942be71ea6f27d319f22d0edf089185019
69,689
py
Python
src/transformers/models/unispeech/modeling_unispeech.py
bugface/transformers
ba286fe7d51db12ad663effac83bed8199dd7141
[ "Apache-2.0" ]
2
2022-01-12T13:10:05.000Z
2022-01-12T13:10:28.000Z
src/transformers/models/unispeech/modeling_unispeech.py
bugface/transformers
ba286fe7d51db12ad663effac83bed8199dd7141
[ "Apache-2.0" ]
2
2022-03-08T04:58:59.000Z
2022-03-19T03:45:14.000Z
src/transformers/models/unispeech/modeling_unispeech.py
bugface/transformers
ba286fe7d51db12ad663effac83bed8199dd7141
[ "Apache-2.0" ]
null
null
null
# coding=utf-8 # Copyright 2021 The Fairseq Authors and the HuggingFace Inc. team. 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/...
43.967823
164
0.676606
import math import warnings from dataclasses import dataclass from typing import Optional, Tuple, Union import numpy as np import torch import torch.utils.checkpoint from torch import nn from torch.nn import CrossEntropyLoss from ...activations import ACT2FN from ...deepspeed import is_deepspeed_zero3_...
true
true
f72cde285309d6d399c8446c716859a2af197049
294
py
Python
product/serializers.py
RKatana/inventory-app-django
a31614237daa5a2d62e30e51b9e573968ef3f0c0
[ "Apache-2.0" ]
null
null
null
product/serializers.py
RKatana/inventory-app-django
a31614237daa5a2d62e30e51b9e573968ef3f0c0
[ "Apache-2.0" ]
null
null
null
product/serializers.py
RKatana/inventory-app-django
a31614237daa5a2d62e30e51b9e573968ef3f0c0
[ "Apache-2.0" ]
null
null
null
from rest_framework import serializers from product.models import Product class ProductSerializer(serializers.ModelSerializer): class Meta: model = Product fields = '__all__' class ProductListSerializer(serializers.ModelSerializer): class Meta: model = Product fields = ('store',)
21
57
0.785714
from rest_framework import serializers from product.models import Product class ProductSerializer(serializers.ModelSerializer): class Meta: model = Product fields = '__all__' class ProductListSerializer(serializers.ModelSerializer): class Meta: model = Product fields = ('store',)
true
true
f72cde9e2a18d5047df425b607f0e92be3a3846e
1,685
py
Python
example/app/odnoklassniki.py
NorthIsUp/django-social-auth
9afedc8ea777b32611d43c1c367babe2e3b18a90
[ "BSD-2-Clause", "BSD-3-Clause" ]
863
2015-01-01T00:42:07.000Z
2022-03-30T02:47:18.000Z
example/app/odnoklassniki.py
JohnieLee/django-social-auth
de36265a4799c435751d9af42ddf6fe7e7a90e0a
[ "BSD-2-Clause", "BSD-3-Clause" ]
101
2015-01-08T00:28:16.000Z
2022-03-07T03:11:19.000Z
example/app/odnoklassniki.py
JohnieLee/django-social-auth
de36265a4799c435751d9af42ddf6fe7e7a90e0a
[ "BSD-2-Clause", "BSD-3-Clause" ]
256
2015-01-02T16:55:36.000Z
2022-03-04T11:10:47.000Z
# -*- coding:utf-8 -*- from django.conf import settings from django.contrib.auth import BACKEND_SESSION_KEY, logout from django.contrib.auth.models import AnonymousUser from django.http import HttpResponse from django.shortcuts import redirect from django.views.generic.base import TemplateView from social_auth.views im...
42.125
132
0.706231
from django.conf import settings from django.contrib.auth import BACKEND_SESSION_KEY, logout from django.contrib.auth.models import AnonymousUser from django.http import HttpResponse from django.shortcuts import redirect from django.views.generic.base import TemplateView from social_auth.views import complete SANDBOX...
true
true
f72cdf8621755d98f90f575e4d4b84f0878e736f
973
py
Python
setup.py
tjsego/simservice
1ca1df4c6644f22217645575719cfa72f5b9f895
[ "MIT" ]
1
2021-08-08T03:15:47.000Z
2021-08-08T03:15:47.000Z
setup.py
tjsego/simservice
1ca1df4c6644f22217645575719cfa72f5b9f895
[ "MIT" ]
null
null
null
setup.py
tjsego/simservice
1ca1df4c6644f22217645575719cfa72f5b9f895
[ "MIT" ]
null
null
null
import os from setuptools import setup __version__ = open(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'VERSION.txt')).readline().strip() setup( name='simservice', version=__version__, description='A library for building simulation services in Python', url='https://github.com/tjsego/simser...
29.484848
110
0.626927
import os from setuptools import setup __version__ = open(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'VERSION.txt')).readline().strip() setup( name='simservice', version=__version__, description='A library for building simulation services in Python', url='https://github.com/tjsego/simser...
true
true
f72cdfc48dda33940d0a57929d4878e17ec7d72c
1,102
py
Python
exercicios-com-listas/exercicio12.py
diegolinkk/exercicios-python-brasil
3bf7bdf0e98cdd06c115eedae4fa01e0c25fdba5
[ "MIT" ]
null
null
null
exercicios-com-listas/exercicio12.py
diegolinkk/exercicios-python-brasil
3bf7bdf0e98cdd06c115eedae4fa01e0c25fdba5
[ "MIT" ]
null
null
null
exercicios-com-listas/exercicio12.py
diegolinkk/exercicios-python-brasil
3bf7bdf0e98cdd06c115eedae4fa01e0c25fdba5
[ "MIT" ]
null
null
null
#Foram anotadas as idades e infos de 30 alunos. Faça um Programa que determine quantos alunos com mais de 13 anos # possuem altura inferior à média de altura desses alunos. from random import random,randint alunos = [] for _ in range(30): altura = 0 #zera porque senão altura não entra no laço novamente ida...
25.627907
114
0.686025
from random import random,randint alunos = [] for _ in range(30): altura = 0 idade = randint(1,90) while altura < 1.40: altura = random() * 2 aluno = [] aluno.append(round(altura,2)) aluno.append(idade) alunos.append(aluno) media_alturas = 0 for altura,idade in al...
true
true
f72ce0eb629e9199e4a7dbe67896f97abd42dbec
4,636
py
Python
python/src/di_bq.py
cedadev/ceda-di
5d7e21f28ead02d226c19f2831bc261897300b0f
[ "BSD-3-Clause-Clear" ]
5
2015-04-17T08:52:34.000Z
2020-07-02T13:32:41.000Z
python/src/di_bq.py
cedadev/ceda-di
5d7e21f28ead02d226c19f2831bc261897300b0f
[ "BSD-3-Clause-Clear" ]
14
2015-01-07T10:30:34.000Z
2020-08-13T11:04:00.000Z
python/src/di_bq.py
cedadev/ceda-di
5d7e21f28ead02d226c19f2831bc261897300b0f
[ "BSD-3-Clause-Clear" ]
2
2016-01-27T11:31:34.000Z
2017-05-18T13:37:18.000Z
#!/usr/bin/env python """ `di_bq.py` is a wrapper around the standard ceda-di tools to help parallelise the processing of files using a batch queue. This tool has two main functions: * Generate lists of files to be processed in individual jobs by the queue * Dispatch archive processing jobs to the batch queue ...
30.906667
82
0.596204
import json import os from docopt import docopt from ceda_di import __version__ from ceda_di.extract import Extract import ceda_di.util.cmd as cmd def dump_to_json(output_directory, seq, file_list): out_name = "{seq}.json".format(seq=seq) out_path = os.path.join(output_directory, out_name) with ope...
true
true
f72ce0efe3d0f872e2ed83a0a3cbfa7d5c6e9f5e
9,361
py
Python
layers/box_utils.py
sashuIya/ssd.pytorch
fe7d8722414fef4cce32f67422c896ef0c45d6bc
[ "MIT" ]
1
2019-04-03T16:48:43.000Z
2019-04-03T16:48:43.000Z
layers/box_utils.py
sashuIya/ssd.pytorch
fe7d8722414fef4cce32f67422c896ef0c45d6bc
[ "MIT" ]
null
null
null
layers/box_utils.py
sashuIya/ssd.pytorch
fe7d8722414fef4cce32f67422c896ef0c45d6bc
[ "MIT" ]
null
null
null
import torch def point_form(boxes): """ Convert prior_boxes to (xmin, ymin, xmax, ymax) representation for comparison to point form ground truth data. Args: boxes: (tensor) center-size default boxes from priorbox layers. Return: boxes: (tensor) Converted xmin, ymin, xmax, ymax form of ...
39.167364
80
0.609443
import torch def point_form(boxes): return torch.cat((boxes[:, :2] - boxes[:, 2:]/2, boxes[:, :2] + boxes[:, 2:]/2), 1) def center_size(boxes): return torch.cat((boxes[:, 2:] + boxes[:, :2])/2, boxes[:, 2:] - boxes[:, :2], 1) def intersect(box_a, box_b)...
true
true
f72ce180f1675a5345ae733b6da480edb5ada453
1,749
py
Python
test_package/conanfile.py
Twon/units
7f64e55d044c8a8d9a5c6d4e4f55167409910749
[ "MIT" ]
null
null
null
test_package/conanfile.py
Twon/units
7f64e55d044c8a8d9a5c6d4e4f55167409910749
[ "MIT" ]
null
null
null
test_package/conanfile.py
Twon/units
7f64e55d044c8a8d9a5c6d4e4f55167409910749
[ "MIT" ]
null
null
null
# The MIT License (MIT) # # Copyright (c) 2018 Mateusz Pusz # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modi...
39.75
80
0.732419
from conans import ConanFile, tools, RunEnvironment from conan.tools.cmake import CMakeToolchain, CMake, CMakeDeps import os class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" def generate(self): tc = CMakeToolchain(self, generator=os.getenv(...
true
true
f72ce1a65a7b1d2ab102ec79f285ac7ea3eedaeb
49,449
py
Python
coremltools/converters/mil/frontend/torch/test/test_torch_ops.py
freedomtan/coremltools
5ee9b537b81c44c140a2fa7571e547dfaa24e1ea
[ "BSD-3-Clause" ]
1
2020-12-23T15:42:01.000Z
2020-12-23T15:42:01.000Z
coremltools/converters/mil/frontend/torch/test/test_torch_ops.py
freedomtan/coremltools
5ee9b537b81c44c140a2fa7571e547dfaa24e1ea
[ "BSD-3-Clause" ]
null
null
null
coremltools/converters/mil/frontend/torch/test/test_torch_ops.py
freedomtan/coremltools
5ee9b537b81c44c140a2fa7571e547dfaa24e1ea
[ "BSD-3-Clause" ]
null
null
null
# Copyright (c) 2020, Apple Inc. All rights reserved. # # Use of this source code is governed by a BSD-3-clause license that can be # found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause import sys from coremltools.models.utils import _python_version from coremltools.models.utils import...
33.076254
145
0.563105
import sys from coremltools.models.utils import _python_version from coremltools.models.utils import _macos_version from coremltools.converters.mil import testing_reqs from coremltools.converters.mil.testing_reqs import * from .testing_utils import * from coremltools import TensorType, ImageType, RangeDim backen...
true
true
f72ce252a89798bc51b81ba3b3a05a173b92e02c
8,096
py
Python
Natural Language Processing with Attention Models/Week 4 - Chatbot/w4_unittest.py
meet-seth/Coursera-Deep-Learning
6fbf9d406468c825ffa1ff2e177dbfd43084bace
[ "MIT" ]
362
2020-10-08T07:34:25.000Z
2022-03-30T05:11:30.000Z
NLP/Learn_by_deeplearning.ai/Course 4 - Attention Models /Labs/Week 4/w4_unittest.py
abcd1758323829/skills
195fad43e99de5efe6491817ad2b79e12665cc2a
[ "MIT" ]
7
2020-07-07T16:10:23.000Z
2021-06-04T08:17:55.000Z
NLP/Learn_by_deeplearning.ai/Course 4 - Attention Models /Labs/Week 4/w4_unittest.py
abcd1758323829/skills
195fad43e99de5efe6491817ad2b79e12665cc2a
[ "MIT" ]
238
2020-10-08T12:01:31.000Z
2022-03-25T08:10:42.000Z
import numpy as np import trax #from trax import layers as tl #from trax.fastmath import numpy as fastnp #from trax.supervised import training # UNIT TEST for UNQ_C1 def test_get_conversation(target): data = {'file1.json': {'log':[{'text': 'hi'}, {'text': 'hello'}, ...
31.874016
580
0.561018
import numpy as np import trax def test_get_conversation(target): data = {'file1.json': {'log':[{'text': 'hi'}, {'text': 'hello'}, {'text': 'nice'}]}, 'file2.json':{'log':[{'text': 'a b'}, {'text'...
true
true
f72ce29ddb1dc2f405d1811a6553b8fcc76db122
7,445
py
Python
many_requests/many_requests_.py
0xflotus/many_requests
dab3963eff471669f7b372cf488a2d9623270fab
[ "MIT" ]
null
null
null
many_requests/many_requests_.py
0xflotus/many_requests
dab3963eff471669f7b372cf488a2d9623270fab
[ "MIT" ]
null
null
null
many_requests/many_requests_.py
0xflotus/many_requests
dab3963eff471669f7b372cf488a2d9623270fab
[ "MIT" ]
null
null
null
import logging from json import JSONDecodeError from typing import List, Optional, Dict, Union import asks import trio from asks.errors import BadHttpResponse from asks.response_objects import Response from h11 import RemoteProtocolError from .easy_async import EasyAsync, delayed, zip_kw from .common import BadRespo...
41.361111
127
0.595567
import logging from json import JSONDecodeError from typing import List, Optional, Dict, Union import asks import trio from asks.errors import BadHttpResponse from asks.response_objects import Response from h11 import RemoteProtocolError from .easy_async import EasyAsync, delayed, zip_kw from .common import BadRespo...
true
true
f72ce2a2454d1eafcfe45c1437983329f74f1dde
1,804
py
Python
src/robot/parsing/restsupport.py
phil-davis/robotframework
4d4ce686cbe01e293bb86ea6ff34330e8c45fc43
[ "ECL-2.0", "Apache-2.0" ]
2
2019-09-21T17:13:24.000Z
2019-09-24T19:13:25.000Z
src/robot/parsing/restsupport.py
phil-davis/robotframework
4d4ce686cbe01e293bb86ea6ff34330e8c45fc43
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
src/robot/parsing/restsupport.py
phil-davis/robotframework
4d4ce686cbe01e293bb86ea6ff34330e8c45fc43
[ "ECL-2.0", "Apache-2.0" ]
1
2019-12-30T14:05:02.000Z
2019-12-30T14:05:02.000Z
# Copyright 2008-2015 Nokia Networks # Copyright 2016- Robot Framework Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 ...
32.214286
75
0.720621
from robot.errors import DataError try: from docutils.core import publish_doctree from docutils.parsers.rst.directives import register_directive from docutils.parsers.rst.directives.body import CodeBlock except ImportError: raise DataError("Using reStructuredText test data requires havin...
true
true
f72ce2fc8328c2744c2230cbb122e8c573eb15fd
3,512
py
Python
app/app/settings.py
mlobina/recipe-app-API
0ded3c37a84c109c469d1dd7db015e8d73d3e9f6
[ "MIT" ]
null
null
null
app/app/settings.py
mlobina/recipe-app-API
0ded3c37a84c109c469d1dd7db015e8d73d3e9f6
[ "MIT" ]
null
null
null
app/app/settings.py
mlobina/recipe-app-API
0ded3c37a84c109c469d1dd7db015e8d73d3e9f6
[ "MIT" ]
1
2021-08-25T06:29:11.000Z
2021-08-25T06:29:11.000Z
""" Django settings for app project. Generated by 'django-admin startproject' using Django 3.2.6. For more information on this file, see https://docs.djangoproject.com/en/3.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.2/ref/settings/ """ from pathlib imp...
25.266187
91
0.691059
from pathlib import Path import os BASE_DIR = Path(__file__).resolve().parent.parent SECRET_KEY = 'django-insecure-sumebxzlqerp)6^8g!b%n-)r03)4pxwioril1^4igma-3_iw=c' DEBUG = True ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'dj...
true
true
f72ce338215fc493ab34b010dba156b5b7042cc3
948
py
Python
barbican/model/migration/alembic_migrations/versions/4ecde3a3a72a_add_cas_column_to_project_quotas_table.py
mail2nsrajesh/barbican
d16d932b77486e9b2f8c6d30e628a6e66517b1a6
[ "Apache-2.0" ]
1
2020-03-01T05:01:57.000Z
2020-03-01T05:01:57.000Z
barbican/model/migration/alembic_migrations/versions/4ecde3a3a72a_add_cas_column_to_project_quotas_table.py
kkutysllb/barbican
7b14d983e0dce6dcffe9781b05c52335b8203fc7
[ "Apache-2.0" ]
5
2019-08-14T06:46:03.000Z
2021-12-13T20:01:25.000Z
barbican/model/migration/alembic_migrations/versions/4ecde3a3a72a_add_cas_column_to_project_quotas_table.py
kkutysllb/barbican
7b14d983e0dce6dcffe9781b05c52335b8203fc7
[ "Apache-2.0" ]
2
2020-03-15T01:24:15.000Z
2020-07-22T20:34:26.000Z
# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under...
27.882353
75
0.741561
revision = '4ecde3a3a72a' down_revision = '10220ccbe7fa' from alembic import op import sqlalchemy as sa def upgrade(): op.add_column( 'project_quotas', sa.Column('cas', sa.Integer(), nullable=True))
true
true
f72ce5c56cac97953d6d62c376de59376e33bee5
1,625
py
Python
ParameterFiles/params_bootes_3as_ext.py
dunkenj/eazy-pype
9cb8ac765d659ace36c00293a5809fc4a066e1ec
[ "MIT" ]
1
2019-07-25T10:55:18.000Z
2019-07-25T10:55:18.000Z
ParameterFiles/params_bootes_3as_ext.py
dunkenj/eazy-pype
9cb8ac765d659ace36c00293a5809fc4a066e1ec
[ "MIT" ]
null
null
null
ParameterFiles/params_bootes_3as_ext.py
dunkenj/eazy-pype
9cb8ac765d659ace36c00293a5809fc4a066e1ec
[ "MIT" ]
1
2018-12-18T16:31:41.000Z
2018-12-18T16:31:41.000Z
""" Main inputs: (Change for all fields) """ eazypath = '/data2/ken/photoz/eazy-photoz/src/eazy' working_folder = '/data2/ken/photoz/bootes_3as_ext' photometry_catalog = 'Bootes_merged_Icorr_2014a_all_ap3_mags.zs.fits.mod' photometry_format = 'fits' filter_file = 'filter.bootes_mbrown_2014a.res' translate_file = 'bro...
18.895349
94
0.687385
eazypath = '/data2/ken/photoz/eazy-photoz/src/eazy' working_folder = '/data2/ken/photoz/bootes_3as_ext' photometry_catalog = 'Bootes_merged_Icorr_2014a_all_ap3_mags.zs.fits.mod' photometry_format = 'fits' filter_file = 'filter.bootes_mbrown_2014a.res' translate_file = 'brown.zphot.2014.translate' zspec_col = 'z_spec'...
true
true
f72ce61d9bb99f838eedbbc565639f110f2dfc86
14,763
py
Python
tf_agents/bandits/agents/neural_linucb_agent_test.py
PeterDomanski/agents
63c1c76f16f2068a637b26282c34a8825583e73e
[ "Apache-2.0" ]
1
2021-07-16T04:44:19.000Z
2021-07-16T04:44:19.000Z
tf_agents/bandits/agents/neural_linucb_agent_test.py
PeterDomanski/agents
63c1c76f16f2068a637b26282c34a8825583e73e
[ "Apache-2.0" ]
null
null
null
tf_agents/bandits/agents/neural_linucb_agent_test.py
PeterDomanski/agents
63c1c76f16f2068a637b26282c34a8825583e73e
[ "Apache-2.0" ]
null
null
null
# coding=utf-8 # Copyright 2018 The TF-Agents Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
40.446575
110
0.721398
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os from absl.testing import parameterized import numpy as np import tensorflow as tf import tensorflow_probability as tfp from tf_agents.bandits.agents import neural_linucb_agent from tf...
true
true
f72ce6309a00519d759cb64bf82d33c3718dba6a
2,373
py
Python
src/fhir_types/FHIR_AdverseEvent_SuspectEntity.py
anthem-ai/fhir-types
42348655fb3a9b3f131b911d6bc0782da8c14ce4
[ "Apache-2.0" ]
2
2022-02-03T00:51:30.000Z
2022-02-03T18:42:43.000Z
src/fhir_types/FHIR_AdverseEvent_SuspectEntity.py
anthem-ai/fhir-types
42348655fb3a9b3f131b911d6bc0782da8c14ce4
[ "Apache-2.0" ]
null
null
null
src/fhir_types/FHIR_AdverseEvent_SuspectEntity.py
anthem-ai/fhir-types
42348655fb3a9b3f131b911d6bc0782da8c14ce4
[ "Apache-2.0" ]
null
null
null
from typing import Any, List, Literal, TypedDict from .FHIR_AdverseEvent_Causality import FHIR_AdverseEvent_Causality from .FHIR_Reference import FHIR_Reference from .FHIR_string import FHIR_string # Actual or potential/avoided event causing unintended physical injury resulting from or contributed to by medical care...
98.875
836
0.785925
from typing import Any, List, Literal, TypedDict from .FHIR_AdverseEvent_Causality import FHIR_AdverseEvent_Causality from .FHIR_Reference import FHIR_Reference from .FHIR_string import FHIR_string FHIR_AdverseEvent_SuspectEntity = TypedDict( "FHIR_AdverseEvent_SuspectEntity", { "id": FHIR_s...
true
true
f72ce673fa0c764781f68e1466651c550042bccc
13,709
py
Python
src/attributecode/transform.py
oneforthidiot/aboutcode-toolkit
666cc8857aadaeb4e07c540c817c831b0f3234e2
[ "Apache-2.0" ]
1
2021-01-02T08:16:55.000Z
2021-01-02T08:16:55.000Z
src/attributecode/transform.py
oneforthidiot/aboutcode-toolkit
666cc8857aadaeb4e07c540c817c831b0f3234e2
[ "Apache-2.0" ]
null
null
null
src/attributecode/transform.py
oneforthidiot/aboutcode-toolkit
666cc8857aadaeb4e07c540c817c831b0f3234e2
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python # -*- coding: utf8 -*- # ============================================================================ # Copyright (c) 2013-2020 nexB Inc. http://www.nexb.com/ - All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in complianc...
34.358396
87
0.665183
from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals from collections import Counter from collections import OrderedDict import io import json import attr from attributecode import CRITICAL from attributecode import Error from attributeco...
true
true
f72ce7712b5c7dee583c54beb8325116fc9f9df8
1,742
py
Python
util.py
marcelkotze007/mk007---ML-Python-library
307e51762fc821588206440daa2c18a6128f4aec
[ "MIT" ]
null
null
null
util.py
marcelkotze007/mk007---ML-Python-library
307e51762fc821588206440daa2c18a6128f4aec
[ "MIT" ]
null
null
null
util.py
marcelkotze007/mk007---ML-Python-library
307e51762fc821588206440daa2c18a6128f4aec
[ "MIT" ]
null
null
null
# https://deeplearningcourses.com/c/data-science-supervised-machine-learning-in-python # https://www.udemy.com/data-science-supervised-machine-learning-in-python from __future__ import print_function, division from builtins import range, input # Note: you may need to update your version of future # sudo pip install -U ...
32.259259
86
0.596441
from __future__ import print_function, division from builtins import range, input import numpy as np import pandas as pd def get_data(limit=None): print("Reading in and transforming data...") df = pd.read_csv('train.csv') data = df.values np.random.shuffle(data) X = data[:, 1:] print(X[40...
true
true
f72ce7ae5cf820ccf1451c8e5cde1d89a16c1e52
3,007
py
Python
pbj/electrostatics/pb_formulation/formulations/direct_external.py
bem4solvation/pbj
4fa9c111596359192539787ae241a79d4316b15b
[ "MIT" ]
null
null
null
pbj/electrostatics/pb_formulation/formulations/direct_external.py
bem4solvation/pbj
4fa9c111596359192539787ae241a79d4316b15b
[ "MIT" ]
1
2022-02-18T17:34:37.000Z
2022-02-18T17:34:37.000Z
pbj/electrostatics/pb_formulation/formulations/direct_external.py
bem4solvation/pbj
4fa9c111596359192539787ae241a79d4316b15b
[ "MIT" ]
null
null
null
import numpy as np import bempp.api import os from bempp.api.operators.boundary import sparse, laplace, modified_helmholtz from .common import calculate_potential_one_surface invert_potential = True def verify_parameters(self): return True def lhs(self): dirichl_space = self.dirichl_space neumann_space...
30.373737
88
0.638178
import numpy as np import bempp.api import os from bempp.api.operators.boundary import sparse, laplace, modified_helmholtz from .common import calculate_potential_one_surface invert_potential = True def verify_parameters(self): return True def lhs(self): dirichl_space = self.dirichl_space neumann_space...
true
true
f72ce81173cc5c6016efe5504b76f86ecabf1edf
245
py
Python
python/merge.py
mannyrivera2010/rdf4j-learning
ef5bc6aeac0c16265605f4e7b577255fb48f96f7
[ "Apache-2.0" ]
null
null
null
python/merge.py
mannyrivera2010/rdf4j-learning
ef5bc6aeac0c16265605f4e7b577255fb48f96f7
[ "Apache-2.0" ]
null
null
null
python/merge.py
mannyrivera2010/rdf4j-learning
ef5bc6aeac0c16265605f4e7b577255fb48f96f7
[ "Apache-2.0" ]
null
null
null
import glob file_list = glob.glob("data/*.csv") for file_name in file_list: with open(file_name, 'r') as open_file: for inner_line in open_file: if "gender" not in inner_line: print(inner_line.strip())
22.272727
43
0.62449
import glob file_list = glob.glob("data/*.csv") for file_name in file_list: with open(file_name, 'r') as open_file: for inner_line in open_file: if "gender" not in inner_line: print(inner_line.strip())
true
true
f72ce8530a8392dc1dd22292d6d0dcfb86f65a5a
2,885
py
Python
pyramid_request_log/request_log.py
MoiTux/pyramid-request-log
31852bbf09e4f416f93c7720ecd9eca8cfe32d38
[ "MIT" ]
1
2017-08-07T10:22:16.000Z
2017-08-07T10:22:16.000Z
pyramid_request_log/request_log.py
MoiTux/pyramid-request-log
31852bbf09e4f416f93c7720ecd9eca8cfe32d38
[ "MIT" ]
null
null
null
pyramid_request_log/request_log.py
MoiTux/pyramid-request-log
31852bbf09e4f416f93c7720ecd9eca8cfe32d38
[ "MIT" ]
null
null
null
import logging import sys import time from pyramid.events import NewResponse, NewRequest from pyramid.events import subscriber if sys.version_info[0] < 3: str = basestring log = logging.getLogger(__name__) unlog_pattern = None unlog_route = None authenticated_id = '' @subscriber(NewRequest) def log_request(e...
27.47619
79
0.597574
import logging import sys import time from pyramid.events import NewResponse, NewRequest from pyramid.events import subscriber if sys.version_info[0] < 3: str = basestring log = logging.getLogger(__name__) unlog_pattern = None unlog_route = None authenticated_id = '' @subscriber(NewRequest) def log_request(e...
true
true
f72cea9211379eec544b1b493a257f6c5b6255c7
1,066
py
Python
api/utils/data_utils.py
wtomin/Multitask-Emotion-Recognition-with-Incomplete-Labels
e6df7ffc9b0318fdce405e40993c79785b47c785
[ "MIT" ]
74
2020-03-08T15:29:00.000Z
2022-03-05T14:57:33.000Z
api/utils/data_utils.py
wtomin/Multitask-Emotion-Recognition-with-Incomplete-Labels
e6df7ffc9b0318fdce405e40993c79785b47c785
[ "MIT" ]
19
2020-03-06T08:56:51.000Z
2022-03-27T05:07:35.000Z
api/utils/data_utils.py
wtomin/Multitask-Emotion-Recognition-with-Incomplete-Labels
e6df7ffc9b0318fdce405e40993c79785b47c785
[ "MIT" ]
23
2020-03-20T08:19:55.000Z
2022-03-16T17:40:09.000Z
from PIL import Image import numbers class RandomCrop(object): def __init__(self, size, v): if isinstance(size, numbers.Number): self.size = (int(size), int(size)) else: self.size = size self.v = v def __call__(self, img): w, h = img.size th, tw =...
31.352941
115
0.545028
from PIL import Image import numbers class RandomCrop(object): def __init__(self, size, v): if isinstance(size, numbers.Number): self.size = (int(size), int(size)) else: self.size = size self.v = v def __call__(self, img): w, h = img.size th, tw =...
true
true
f72ceaaf5ad093604d4d028c26cd964e13cd6018
9,644
py
Python
tests/test_authority.py
scottp-dpaw/azure-activedirectory-library-for-python
3305d666c064e62f8c15526fb82b5cba02a11b80
[ "MIT" ]
2
2018-03-05T07:54:23.000Z
2018-07-10T14:53:32.000Z
tests/test_authority.py
scottp-dpaw/azure-activedirectory-library-for-python
3305d666c064e62f8c15526fb82b5cba02a11b80
[ "MIT" ]
null
null
null
tests/test_authority.py
scottp-dpaw/azure-activedirectory-library-for-python
3305d666c064e62f8c15526fb82b5cba02a11b80
[ "MIT" ]
1
2020-10-26T20:07:07.000Z
2020-10-26T20:07:07.000Z
#------------------------------------------------------------------------------ # # Copyright (c) Microsoft Corporation. # All rights reserved. # # This code is licensed under the MIT License. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentatio...
42.672566
138
0.687578
import sys import requests import httpretty import six try: import unittest2 as unittest except ImportError: import unittest try: from unittest import mock except ImportError: import mock import adal from adal.authority import Authority from adal import log from adal.authen...
true
true
f72ceae57491507ca3020763b8de106a6f696481
486
py
Python
DjangoAPI/MyApi/migrations/0001_initial.py
sni710/Django_api
a40d049586d9396c3b1bea4cd82177c573b24c17
[ "Apache-2.0" ]
2
2020-08-27T11:26:35.000Z
2021-03-20T16:27:20.000Z
DjangoAPI/MyApi/migrations/0001_initial.py
ankit98040/Django-ML-Project
3e50f51e56aa34bb8a7ae31f4955a10e57176ea7
[ "Apache-2.0" ]
null
null
null
DjangoAPI/MyApi/migrations/0001_initial.py
ankit98040/Django-ML-Project
3e50f51e56aa34bb8a7ae31f4955a10e57176ea7
[ "Apache-2.0" ]
null
null
null
# Generated by Django 3.0.6 on 2020-08-26 04:50 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='MyFile', fields=[ ('id', models.AutoField(a...
22.090909
114
0.569959
from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='MyFile', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=F...
true
true
f72ceb176086bf9c83e429c918a55d39155ac895
3,556
py
Python
spyder/plugins/tours/container.py
fumitoh/spyder
12294fec88a2f61c756538ac38bd748d8e7b3f82
[ "MIT" ]
1
2021-07-08T01:27:25.000Z
2021-07-08T01:27:25.000Z
spyder/plugins/tours/container.py
fumitoh/spyder
12294fec88a2f61c756538ac38bd748d8e7b3f82
[ "MIT" ]
null
null
null
spyder/plugins/tours/container.py
fumitoh/spyder
12294fec88a2f61c756538ac38bd748d8e7b3f82
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2009- Spyder Project Contributors # # Distributed under the terms of the MIT License # (see spyder/__init__.py for details) # --------------------------------------------------------------------...
30.135593
80
0.53009
from collections import OrderedDict from spyder.api.exceptions import SpyderAPIError from spyder.api.translations import get_translation from spyder.api.widgets.main_container import PluginMainContainer from spyder.plugins.tours.tours import TourIdentifiers from spyder.plugins.tours.widgets import An...
true
true
f72ceb2273d8e23fd38d9723f4f39d414670b675
375
py
Python
Python/Swap Case.py
BiswajitDeb/My_all_programs
4717cfc0b3b1aeda75f8eec0b7ff643e8556d262
[ "Unlicense" ]
null
null
null
Python/Swap Case.py
BiswajitDeb/My_all_programs
4717cfc0b3b1aeda75f8eec0b7ff643e8556d262
[ "Unlicense" ]
null
null
null
Python/Swap Case.py
BiswajitDeb/My_all_programs
4717cfc0b3b1aeda75f8eec0b7ff643e8556d262
[ "Unlicense" ]
null
null
null
def swap_case(s): k = [] l = list(s) for i in l: j = "" if i.islower(): j = i.upper() elif i.isupper(): j = i.lower() else: k.append(i) k.append(j) final = ''.join(k) return final if __name__ == '__main__': ...
16.304348
26
0.416
def swap_case(s): k = [] l = list(s) for i in l: j = "" if i.islower(): j = i.upper() elif i.isupper(): j = i.lower() else: k.append(i) k.append(j) final = ''.join(k) return final if __name__ == '__main__': ...
true
true
f72ced6147cf08a6b779747e4e46d56e84081e4e
1,139
py
Python
plenum/test/view_change/test_start_view_change_ts_set.py
andkononykhin/indy-plenum-copy
46c48feaf75e5578c9dceb76d4b6d09f7e63add5
[ "Apache-2.0" ]
1
2019-03-19T23:44:56.000Z
2019-03-19T23:44:56.000Z
plenum/test/view_change/test_start_view_change_ts_set.py
andkononykhin/indy-plenum-copy
46c48feaf75e5578c9dceb76d4b6d09f7e63add5
[ "Apache-2.0" ]
null
null
null
plenum/test/view_change/test_start_view_change_ts_set.py
andkononykhin/indy-plenum-copy
46c48feaf75e5578c9dceb76d4b6d09f7e63add5
[ "Apache-2.0" ]
2
2017-12-13T21:14:54.000Z
2021-06-06T15:48:03.000Z
from contextlib import ExitStack import pytest from plenum.test.helper import create_new_test_node @pytest.fixture(scope="module") def create_node_and_not_start(testNodeClass, node_config_helper_class, tconf, tdir, ...
33.5
74
0.515364
from contextlib import ExitStack import pytest from plenum.test.helper import create_new_test_node @pytest.fixture(scope="module") def create_node_and_not_start(testNodeClass, node_config_helper_class, tconf, tdir, ...
true
true
f72ced80e9d31b06e29ceff3d3a4092de61f6141
8,950
py
Python
test/test_cognon_extended.py
pauh/neuron
c08f7033f954373617d7a58eb1e5b88f91ac1a27
[ "Apache-2.0" ]
3
2018-08-25T22:03:37.000Z
2019-04-15T10:59:14.000Z
test/test_cognon_extended.py
pauh/neuron
c08f7033f954373617d7a58eb1e5b88f91ac1a27
[ "Apache-2.0" ]
null
null
null
test/test_cognon_extended.py
pauh/neuron
c08f7033f954373617d7a58eb1e5b88f91ac1a27
[ "Apache-2.0" ]
null
null
null
# Copyright 2013 Pau Haro Negre # based on C++ code by Carl Staelin Copyright 2009-2011 # # See the NOTICE file distributed with this work for additional information # regarding copyright ownership. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with...
30.13468
75
0.562682
from cognon_extended import Neuron from cognon_extended import Synapse from cognon_extended import Word from cognon_extended import WordSet from nose.tools import assert_false from nose.tools import assert_greater_equal from nose.tools import assert_in from nose.tools import assert_is_none from nose...
true
true
f72ced891d0ab304ac2986df0441a610cd13e4c7
896
py
Python
2020/day25/day25.py
ChrisCh7/advent-of-code
d6f1dda4a67aae18ac1e15b9eccb3e6e94d705c1
[ "Unlicense" ]
3
2020-12-03T23:20:27.000Z
2020-12-03T23:20:53.000Z
2020/day25/day25.py
ChrisCh7/advent-of-code
d6f1dda4a67aae18ac1e15b9eccb3e6e94d705c1
[ "Unlicense" ]
null
null
null
2020/day25/day25.py
ChrisCh7/advent-of-code
d6f1dda4a67aae18ac1e15b9eccb3e6e94d705c1
[ "Unlicense" ]
null
null
null
def main(): with open('in.txt') as file: card_pubkey, door_pubkey = map(lambda n: int(n), file.read().splitlines()) print('card public key:', card_pubkey) print('door public key:', door_pubkey) print('card loop size:', card_loop_size := get_loop_size(card_pubkey)) print('door loop size:', ...
24.888889
82
0.65067
def main(): with open('in.txt') as file: card_pubkey, door_pubkey = map(lambda n: int(n), file.read().splitlines()) print('card public key:', card_pubkey) print('door public key:', door_pubkey) print('card loop size:', card_loop_size := get_loop_size(card_pubkey)) print('door loop size:', ...
true
true
f72cedd7827c3a103f775708f54a774487557133
4,338
py
Python
doom/test.py
luxinglong/ViZDoom-SL
fbc54c401b1ca320e9e804f2c97fdedc5d0c534d
[ "MIT" ]
null
null
null
doom/test.py
luxinglong/ViZDoom-SL
fbc54c401b1ca320e9e804f2c97fdedc5d0c534d
[ "MIT" ]
null
null
null
doom/test.py
luxinglong/ViZDoom-SL
fbc54c401b1ca320e9e804f2c97fdedc5d0c534d
[ "MIT" ]
null
null
null
import sys import argparse import numpy as np from actions import ActionBuilder from game import Game # use_continuous speed action_combinations crouch freelook FALSY_STRINGS = {'off', 'false', '0'} TRUTHY_STRINGS = {'on', 'true', '1'} def bool_flag(string): """ Parse boolean arguments from th...
37.396552
78
0.605579
import sys import argparse import numpy as np from actions import ActionBuilder from game import Game FALSY_STRINGS = {'off', 'false', '0'} TRUTHY_STRINGS = {'on', 'true', '1'} def bool_flag(string): if string.lower() in FALSY_STRINGS: return False elif string.lower() in TRUTHY_STRING...
true
true
f72cef269ff93973871d0381495aa221dec684e9
576
py
Python
processdata/migrations/0001_initial.py
shinysong/covid19-dashboard
c4c536e3781caecb7f1cfcfdb27c1324fe493eb2
[ "MIT" ]
null
null
null
processdata/migrations/0001_initial.py
shinysong/covid19-dashboard
c4c536e3781caecb7f1cfcfdb27c1324fe493eb2
[ "MIT" ]
null
null
null
processdata/migrations/0001_initial.py
shinysong/covid19-dashboard
c4c536e3781caecb7f1cfcfdb27c1324fe493eb2
[ "MIT" ]
null
null
null
# Generated by Django 3.0.7 on 2022-03-29 07:12 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='test_api', fields=[ ('id', models.AutoField...
24
114
0.548611
from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='test_api', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize...
true
true
f72cefc08416d058c79ffed4f4ba0c15d2eb9ff0
17,944
py
Python
homeassistant/components/climate/wink.py
jamescurtin/home-assistant
6a9968ccb9b0082f5629e50955549d432aba7d90
[ "Apache-2.0" ]
2
2020-02-20T18:47:55.000Z
2021-11-09T11:33:28.000Z
homeassistant/components/climate/wink.py
moose51789/home-assistant
63c9d59d5455850fd4b37c2475fe6f10effb5245
[ "Apache-2.0" ]
1
2021-02-08T20:56:06.000Z
2021-02-08T20:56:06.000Z
homeassistant/components/climate/wink.py
moose51789/home-assistant
63c9d59d5455850fd4b37c2475fe6f10effb5245
[ "Apache-2.0" ]
1
2019-09-15T04:45:12.000Z
2019-09-15T04:45:12.000Z
""" Support for Wink thermostats, Air Conditioners, and Water Heaters. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/climate.wink/ """ import logging import asyncio from homeassistant.components.wink import WinkDevice, DOMAIN from homeassistant.compone...
33.729323
77
0.615805
import logging import asyncio from homeassistant.components.wink import WinkDevice, DOMAIN from homeassistant.components.climate import ( STATE_AUTO, STATE_COOL, STATE_HEAT, ClimateDevice, ATTR_TARGET_TEMP_HIGH, ATTR_TARGET_TEMP_LOW, ATTR_TEMPERATURE, STATE_FAN_ONLY, ATTR_CURRENT_HUMIDITY, STATE_ECO, S...
true
true
f72ceff1b9b1d547913aa773c1b821be3ae401f9
55
py
Python
contest/abc120/A.py
mola1129/atcoder
1d3b18cb92d0ba18c41172f49bfcd0dd8d29f9db
[ "MIT" ]
null
null
null
contest/abc120/A.py
mola1129/atcoder
1d3b18cb92d0ba18c41172f49bfcd0dd8d29f9db
[ "MIT" ]
null
null
null
contest/abc120/A.py
mola1129/atcoder
1d3b18cb92d0ba18c41172f49bfcd0dd8d29f9db
[ "MIT" ]
null
null
null
A,B,C = map(int, input().split()) print(min(B//A,C))
18.333333
34
0.545455
A,B,C = map(int, input().split()) print(min(B//A,C))
true
true
f72cf037943e51b4783520ebbf6f67e18bf38ba4
3,648
py
Python
src/Calibration.py
Mohamed-Abdulaty/UDACITY-CarND-P2-Advanced-Lane-Lines
e5d5fdff45c523a4f17635897b9de4b2e50d273d
[ "MIT" ]
null
null
null
src/Calibration.py
Mohamed-Abdulaty/UDACITY-CarND-P2-Advanced-Lane-Lines
e5d5fdff45c523a4f17635897b9de4b2e50d273d
[ "MIT" ]
null
null
null
src/Calibration.py
Mohamed-Abdulaty/UDACITY-CarND-P2-Advanced-Lane-Lines
e5d5fdff45c523a4f17635897b9de4b2e50d273d
[ "MIT" ]
null
null
null
import os import cv2 import numpy as np class Calibration: def __init__( self, source_images_directory, destination_image_sub_directory, chessboard_shape, logger ): self.source_images_directory = source_images_directory self.destination_image_sub_...
41.931034
110
0.621436
import os import cv2 import numpy as np class Calibration: def __init__( self, source_images_directory, destination_image_sub_directory, chessboard_shape, logger ): self.source_images_directory = source_images_directory self.destination_image_sub_...
true
true
f72cf0613aadf94eb6e2c98f6e1c046325378d82
1,979
py
Python
dove/utils/bed.py
barslmn/dove
df6344286633422219c0e93e15d4327f9d082041
[ "MIT" ]
null
null
null
dove/utils/bed.py
barslmn/dove
df6344286633422219c0e93e15d4327f9d082041
[ "MIT" ]
null
null
null
dove/utils/bed.py
barslmn/dove
df6344286633422219c0e93e15d4327f9d082041
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- __author__ = 'bars' from io import StringIO import pandas as pd from collections import defaultdict class Bed: """description""" def __init__(self, bed_file, mode='file'): self.bed_file = bed_file self.mode = mode def get_header(self): lines_to_skip = 0 ...
29.984848
54
0.471956
__author__ = 'bars' from io import StringIO import pandas as pd from collections import defaultdict class Bed: def __init__(self, bed_file, mode='file'): self.bed_file = bed_file self.mode = mode def get_header(self): lines_to_skip = 0 header = defaultdict(list) if ...
true
true
f72cf0c8eddcbcd99e6cd753b8ca73ce4cc13dcd
10,400
py
Python
nnutils/dibr_kaolin.py
junzhezhang/cmr
f0b2ded813535493f124852ce64b26efa761a35c
[ "MIT" ]
null
null
null
nnutils/dibr_kaolin.py
junzhezhang/cmr
f0b2ded813535493f124852ce64b26efa761a35c
[ "MIT" ]
null
null
null
nnutils/dibr_kaolin.py
junzhezhang/cmr
f0b2ded813535493f124852ce64b26efa761a35c
[ "MIT" ]
null
null
null
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import scipy.misc import tqdm import cv2 import torch from nnutils import geom_utils # from kaolin.graphics.dib_renderer.rasterizer import linear_rasterizer # from kaolin.graphics.dib_ren...
38.80597
151
0.559038
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import scipy.misc import tqdm import cv2 import torch from nnutils import geom_utils from kaolin.graphics.dib_renderer.renderer.texrender import TexRender from kaolin.graphics.dib_rend...
true
true
f72cf0ce56facdb68d763f793fbd3901d57d4555
4,872
py
Python
sensors/jira_sensor.py
viveksyngh/stackstorm-jira
d08bc9b78bb5a5cce1c6e84c1f947f1ba3088d26
[ "Apache-2.0" ]
null
null
null
sensors/jira_sensor.py
viveksyngh/stackstorm-jira
d08bc9b78bb5a5cce1c6e84c1f947f1ba3088d26
[ "Apache-2.0" ]
null
null
null
sensors/jira_sensor.py
viveksyngh/stackstorm-jira
d08bc9b78bb5a5cce1c6e84c1f947f1ba3088d26
[ "Apache-2.0" ]
1
2020-01-22T16:35:49.000Z
2020-01-22T16:35:49.000Z
# See ./requirements.txt for requirements. import os from jira.client import JIRA from st2reactor.sensor.base import PollingSensor class JIRASensor(PollingSensor): ''' Sensor will monitor for any new projects created in JIRA and emit trigger instance when one is created. ''' def __init__(self, ...
37.767442
84
0.610016
import os from jira.client import JIRA from st2reactor.sensor.base import PollingSensor class JIRASensor(PollingSensor): def __init__(self, sensor_service, config=None, poll_interval=5): super(JIRASensor, self).__init__(sensor_service=sensor_service, config=con...
true
true
f72cf166961a193b694eac3676ad404f15972d73
6,202
py
Python
__init__.py
kriswans/logBlizzard
56ac597b4a499fa331742d441cb42c8c99360e0e
[ "MIT" ]
null
null
null
__init__.py
kriswans/logBlizzard
56ac597b4a499fa331742d441cb42c8c99360e0e
[ "MIT" ]
null
null
null
__init__.py
kriswans/logBlizzard
56ac597b4a499fa331742d441cb42c8c99360e0e
[ "MIT" ]
null
null
null
""" Author: Kris Swanson, kriswans@cisco.com Tested with Python 3.6.1 on WIN10 """ import socket import struct import time import sys import multiprocessing import datetime import glob import json from crypto import Crypto as cryp from syslog import syslog from nodemanager import NodeManager as nm from localsearch i...
27.442478
241
0.565946
import socket import struct import time import sys import multiprocessing import datetime import glob import json from crypto import Crypto as cryp from syslog import syslog from nodemanager import NodeManager as nm from localsearch import SearchLocal as sl def logMonitor_Rx(password,params): print("Starting R...
true
true
f72cf1840ab9da367881e535c5609e8a88e5c71b
1,349
py
Python
actor/skills/grass_cutter.py
tamamiyasita/Roguelike-Tutorial-2020
db4d4e5369010567bc39bdd404c4f3a7998670fd
[ "MIT" ]
null
null
null
actor/skills/grass_cutter.py
tamamiyasita/Roguelike-Tutorial-2020
db4d4e5369010567bc39bdd404c4f3a7998670fd
[ "MIT" ]
null
null
null
actor/skills/grass_cutter.py
tamamiyasita/Roguelike-Tutorial-2020
db4d4e5369010567bc39bdd404c4f3a7998670fd
[ "MIT" ]
null
null
null
from constants import * from data import IMAGE_ID from random import randint from actor.skills.base_skill import BaseSkill from util import dice class GrassCutter(BaseSkill): def __init__(self, x=0, y=0, name="grass_cutter"): super().__init__( name=name, image=IMAGE_ID[name], ...
24.089286
104
0.575982
from constants import * from data import IMAGE_ID from random import randint from actor.skills.base_skill import BaseSkill from util import dice class GrassCutter(BaseSkill): def __init__(self, x=0, y=0, name="grass_cutter"): super().__init__( name=name, image=IMAGE_ID[name], ...
true
true
f72cf2ba17b0645159849d98585fab8cba690efd
3,280
py
Python
enroll_certificates.py
marcelojcn/psd2-tpp-enroller
86a03287e74a38f1ebb0d46886c2fc0ec0345ff2
[ "MIT" ]
2
2021-03-23T05:07:53.000Z
2021-07-04T20:42:20.000Z
enroll_certificates.py
marcelojcn/psd2-tpp-enroller
86a03287e74a38f1ebb0d46886c2fc0ec0345ff2
[ "MIT" ]
null
null
null
enroll_certificates.py
marcelojcn/psd2-tpp-enroller
86a03287e74a38f1ebb0d46886c2fc0ec0345ff2
[ "MIT" ]
1
2021-03-22T05:45:38.000Z
2021-03-22T05:45:38.000Z
import argparse from src.openbanking_tpp_proxy.proxy import Proxy if __name__ == '__main__': parser = argparse.ArgumentParser(description="Process parametes for certificate enrollment") parser.add_argument('--api_url', type=str, required=True, help='API url needed for certificate inte...
46.857143
96
0.559451
import argparse from src.openbanking_tpp_proxy.proxy import Proxy if __name__ == '__main__': parser = argparse.ArgumentParser(description="Process parametes for certificate enrollment") parser.add_argument('--api_url', type=str, required=True, help='API url needed for certificate inte...
true
true
f72cf2bd30e710234b5f0ce409d6c011a60b05e1
827
py
Python
tests/test_service.py
GameServerGurus/Nitrado-SDK
d72536be5def0b51a7ac89ccf62e35095f4ea705
[ "MIT" ]
1
2022-02-01T18:12:00.000Z
2022-02-01T18:12:00.000Z
tests/test_service.py
GameServerGurus/Nitrado-SDK
d72536be5def0b51a7ac89ccf62e35095f4ea705
[ "MIT" ]
1
2022-01-31T21:04:53.000Z
2022-02-01T02:16:52.000Z
tests/test_service.py
GameServerGurus/Nitrado-SDK
d72536be5def0b51a7ac89ccf62e35095f4ea705
[ "MIT" ]
null
null
null
import os from nitrado import Service, initialize_client def set_client(): url = "https://api.nitrado.net/" key = os.getenv('NITRADO_KEY') initialize_client(key, url) def test_services(): set_client() services = Service.all() assert len(services) > 0 def test_logs(): set_client() s...
17.229167
46
0.636034
import os from nitrado import Service, initialize_client def set_client(): url = "https://api.nitrado.net/" key = os.getenv('NITRADO_KEY') initialize_client(key, url) def test_services(): set_client() services = Service.all() assert len(services) > 0 def test_logs(): set_client() s...
true
true
f72cf30f4db51c6f09ee40560b05c6f53cdebd84
5,436
py
Python
sdk/python/pulumi_aws/ec2/vpn_connection_route.py
mdop-wh/pulumi-aws
05bb32e9d694dde1c3b76d440fd2cd0344d23376
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
sdk/python/pulumi_aws/ec2/vpn_connection_route.py
mdop-wh/pulumi-aws
05bb32e9d694dde1c3b76d440fd2cd0344d23376
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
sdk/python/pulumi_aws/ec2/vpn_connection_route.py
mdop-wh/pulumi-aws
05bb32e9d694dde1c3b76d440fd2cd0344d23376
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Dict, List, Mapping, Optional, Tuple, Union from .. import ...
42.46875
134
0.653054
import warnings import pulumi import pulumi.runtime from typing import Any, Dict, List, Mapping, Optional, Tuple, Union from .. import _utilities, _tables __all__ = ['VpnConnectionRoute'] class VpnConnectionRoute(pulumi.CustomResource): def __init__(__self__, resource_name: str, ...
true
true
f72cf317b227f69aee075f4d4a76f6668cb37c7e
10,749
py
Python
qa/rpc-tests/maxuploadtarget.py
minblock/lua
ee6ef8f49bfc9569e7c568fc6546fa16dbe14585
[ "MIT" ]
null
null
null
qa/rpc-tests/maxuploadtarget.py
minblock/lua
ee6ef8f49bfc9569e7c568fc6546fa16dbe14585
[ "MIT" ]
null
null
null
qa/rpc-tests/maxuploadtarget.py
minblock/lua
ee6ef8f49bfc9569e7c568fc6546fa16dbe14585
[ "MIT" ]
null
null
null
#!/usr/bin/env python2 # # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from test_framework.mininode import * from test_framework.test_framework import LUASCOINTestFramework from test_framework.util import * import time ''...
40.409774
140
0.655224
from test_framework.mininode import * from test_framework.test_framework import LUASCOINTestFramework from test_framework.util import * import time ''' Test behavior of -maxuploadtarget. * Verify that getdata requests for old blocks (>1week) are dropped if uploadtarget has been reached. * Verify that getdata re...
false
true
f72cf3e78bbce35be30e75fc278005c291dd24d7
3,977
py
Python
src/beanmachine/ppl/inference/proposer/nmc/single_site_half_space_nmc_proposer.py
horizon-blue/beanmachine-1
b13e4e3e28ffb860947eb8046863b0cabb581222
[ "MIT" ]
1
2021-12-22T13:19:14.000Z
2021-12-22T13:19:14.000Z
src/beanmachine/ppl/inference/proposer/nmc/single_site_half_space_nmc_proposer.py
horizon-blue/beanmachine-1
b13e4e3e28ffb860947eb8046863b0cabb581222
[ "MIT" ]
null
null
null
src/beanmachine/ppl/inference/proposer/nmc/single_site_half_space_nmc_proposer.py
horizon-blue/beanmachine-1
b13e4e3e28ffb860947eb8046863b0cabb581222
[ "MIT" ]
null
null
null
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import logging from typing import Tuple import torch import torch.distributions as dist from beanmachine.ppl.inference.proposer.single_site...
38.61165
104
0.670355
import logging from typing import Tuple import torch import torch.distributions as dist from beanmachine.ppl.inference.proposer.single_site_ancestral_proposer import ( SingleSiteAncestralProposer, ) from beanmachine.ppl.legacy.inference.proposer.newtonian_monte_carlo_utils import ( is_valid, hessian_o...
true
true
f72cf4a833b1d28314f79d0d0b59dfce9cb476dc
627
py
Python
setup.py
peterpaohuang/depablo-box
edf21fa7f2bcd7009136a2e14b802d004b12b406
[ "MIT" ]
1
2019-08-06T15:45:34.000Z
2019-08-06T15:45:34.000Z
setup.py
peterpaohuang/depablo-box
edf21fa7f2bcd7009136a2e14b802d004b12b406
[ "MIT" ]
null
null
null
setup.py
peterpaohuang/depablo-box
edf21fa7f2bcd7009136a2e14b802d004b12b406
[ "MIT" ]
null
null
null
import subprocess print("Installing required packages...") subprocess.check_output(['conda','install','--yes','--file','requirements.txt']) print("Installed requirements") print("Installing openbabel...") subprocess.check_output(['conda','install','--yes','-c','openbabel', 'openbabel']) print("Installed openbabel") pri...
48.230769
86
0.728868
import subprocess print("Installing required packages...") subprocess.check_output(['conda','install','--yes','--file','requirements.txt']) print("Installed requirements") print("Installing openbabel...") subprocess.check_output(['conda','install','--yes','-c','openbabel', 'openbabel']) print("Installed openbabel") pri...
true
true
f72cf697921980b575ca1e6593cdff20ac9b8c90
2,031
py
Python
v3/htmlexample_module.py
ambadhan/OnlinePythonTutor
857bab941fbde20f1f020b05b7723094ddead62a
[ "MIT" ]
17
2021-12-09T11:31:44.000Z
2021-12-29T03:07:14.000Z
v3/htmlexample_module.py
heysachin/OnlinePythonTutor
0dcdacc7ff5be504dd6a47236ebc69dc0069f991
[ "MIT" ]
22
2017-09-17T03:59:16.000Z
2017-11-14T17:33:57.000Z
v3/htmlexample_module.py
heysachin/OnlinePythonTutor
0dcdacc7ff5be504dd6a47236ebc69dc0069f991
[ "MIT" ]
12
2021-12-09T11:31:46.000Z
2022-01-07T03:14:46.000Z
# Example module for Online Python Tutor # Philip Guo # 2013-08-03 # To get the Online Python Tutor backend to import this custom module, # add its filename ('htmlexample_module') to the CUSTOM_MODULE_IMPORTS # tuple in pg_logger.py # To see an example of this module at work, write the following code in # http://pyth...
28.208333
96
0.613983
class ColorTable: def __init__(self, num_rows, num_columns): self.num_rows = num_rows self.num_columns = num_columns self.table = [] for i in range(self.num_rows): new_lst = ['' for e in range(self.num_columns)] self.table.append(new_lst...
true
true
f72cf6de2f57109ea400d2d7cfa8931507537fd0
3,018
py
Python
examples/epd_2in13_test.py
philipempl/ResearchyPi
74cf9cc78ace39d1d843b2b64fe39704aaafe778
[ "MIT" ]
null
null
null
examples/epd_2in13_test.py
philipempl/ResearchyPi
74cf9cc78ace39d1d843b2b64fe39704aaafe778
[ "MIT" ]
null
null
null
examples/epd_2in13_test.py
philipempl/ResearchyPi
74cf9cc78ace39d1d843b2b64fe39704aaafe778
[ "MIT" ]
null
null
null
#!/usr/bin/python # -*- coding:utf-8 -*- import sys import os picdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'pic') libdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'lib') if os.path.exists(libdir): sys.path.append(libdir) import logging from ...
32.106383
90
0.611995
import sys import os picdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'pic') libdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'lib') if os.path.exists(libdir): sys.path.append(libdir) import logging from waveshare_epd import epd2in13 import ti...
true
true
f72cf7000c24d4d32e896071d41604079d19da89
3,666
py
Python
mpsci/distributions/binomial.py
WarrenWeckesser/mpsci
675f0f3b76700529558a3bae2a1b2ca09552233b
[ "BSD-2-Clause" ]
7
2019-03-27T17:25:41.000Z
2022-03-31T03:55:29.000Z
mpsci/distributions/binomial.py
WarrenWeckesser/mpsci
675f0f3b76700529558a3bae2a1b2ca09552233b
[ "BSD-2-Clause" ]
2
2019-05-09T16:09:45.000Z
2021-01-04T03:55:09.000Z
mpsci/distributions/binomial.py
WarrenWeckesser/mpsci
675f0f3b76700529558a3bae2a1b2ca09552233b
[ "BSD-2-Clause" ]
null
null
null
""" Binomial distribution --------------------- """ import mpmath from ..fun import logbinomial __all__ = ['pmf', 'logpmf', 'cdf', 'sf', 'mean', 'var'] def _validate_np(n, p): if p < 0 or p > 1: raise ValueError('p must be in the range [0, 1]') if n < 0: raise ValueError('n must be a nonne...
30.297521
78
0.563011
import mpmath from ..fun import logbinomial __all__ = ['pmf', 'logpmf', 'cdf', 'sf', 'mean', 'var'] def _validate_np(n, p): if p < 0 or p > 1: raise ValueError('p must be in the range [0, 1]') if n < 0: raise ValueError('n must be a nonnegative integer.') return def pmf(k, n, p): ...
true
true
f72cf726678d2cd74a55d44450a33b0c8d9c834f
792
py
Python
pytezos/rpc/errors.py
arvidj/pytezos
a8545d9408f086eba91b4af7e12c488672144ff6
[ "MIT" ]
1
2020-08-11T02:31:24.000Z
2020-08-11T02:31:24.000Z
pytezos/rpc/errors.py
arvidj/pytezos
a8545d9408f086eba91b4af7e12c488672144ff6
[ "MIT" ]
null
null
null
pytezos/rpc/errors.py
arvidj/pytezos
a8545d9408f086eba91b4af7e12c488672144ff6
[ "MIT" ]
1
2022-03-20T19:01:00.000Z
2022-03-20T19:01:00.000Z
from pytezos.rpc.node import RpcError class MichelsonBadContractParameter(RpcError, error_id='michelson_v1.bad_contract_parameter'): """ Either no parameter was supplied to a contract with a non-unit parameter type, a non-unit parameter was passed to an account, or a parameter was supplied of the wrong type ...
28.285714
118
0.736111
from pytezos.rpc.node import RpcError class MichelsonBadContractParameter(RpcError, error_id='michelson_v1.bad_contract_parameter'): class MichelsonBadReturn(RpcError, error_id='michelson_v1.bad_return'): class MichelsonRuntimeError(RpcError, error_id='michelson_v1'): class TezArithmeticError(RpcError, error_id...
true
true
f72cf8174f5a2872015dadbef99938a1a8e72272
1,116
py
Python
thingsboard_gateway/storage/event_storage_reader_pointer.py
xinge-ok/thingsboard-gateway
6dab6030a6becf0ce9d34bc95a3a1f1e0838cb14
[ "Apache-2.0" ]
1
2020-02-24T09:08:35.000Z
2020-02-24T09:08:35.000Z
thingsboard_gateway/storage/event_storage_reader_pointer.py
xinge-ok/thingsboard-gateway
6dab6030a6becf0ce9d34bc95a3a1f1e0838cb14
[ "Apache-2.0" ]
null
null
null
thingsboard_gateway/storage/event_storage_reader_pointer.py
xinge-ok/thingsboard-gateway
6dab6030a6becf0ce9d34bc95a3a1f1e0838cb14
[ "Apache-2.0" ]
null
null
null
# Copyright 2019. ThingsBoard # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
28.615385
78
0.662186
class EventStorageReaderPointer: def __init__(self, file, line): self.file = file self.line = line def __eq__(self, other): return self.file == other.file and self.line == other.line def __hash__(self): return hash((self.file, self.line)) def get_file(s...
true
true
f72cf8cdaafe9d7009fc1fbe038716d9fe13a281
81,150
py
Python
pandas/tests/frame/test_analytics.py
dhimmel/pandas
776fed3ab63d74ddef6e5af1a702b10c2a30bbb6
[ "BSD-3-Clause" ]
1
2018-08-01T05:39:55.000Z
2018-08-01T05:39:55.000Z
pandas/tests/frame/test_analytics.py
dhimmel/pandas
776fed3ab63d74ddef6e5af1a702b10c2a30bbb6
[ "BSD-3-Clause" ]
null
null
null
pandas/tests/frame/test_analytics.py
dhimmel/pandas
776fed3ab63d74ddef6e5af1a702b10c2a30bbb6
[ "BSD-3-Clause" ]
1
2019-05-26T12:57:52.000Z
2019-05-26T12:57:52.000Z
# -*- coding: utf-8 -*- from __future__ import print_function import warnings from datetime import timedelta import operator import pytest from string import ascii_lowercase from numpy import nan from numpy.random import randn import numpy as np from pandas.compat import lrange, PY35 from pandas import (compat, isn...
37.656613
79
0.509698
from __future__ import print_function import warnings from datetime import timedelta import operator import pytest from string import ascii_lowercase from numpy import nan from numpy.random import randn import numpy as np from pandas.compat import lrange, PY35 from pandas import (compat, isna, notna, DataFrame, Se...
true
true
f72cf916fbd8ea467321863ca89fb57083e4ec13
36,218
py
Python
pydca/meanfield_dca/meanfield_dca.py
MehariBZ/pydca
034e0707a13e6e43da1343630047d47caeca896e
[ "MIT" ]
1
2021-03-28T01:57:38.000Z
2021-03-28T01:57:38.000Z
pydca/meanfield_dca/meanfield_dca.py
MehariBZ/pydca
034e0707a13e6e43da1343630047d47caeca896e
[ "MIT" ]
null
null
null
pydca/meanfield_dca/meanfield_dca.py
MehariBZ/pydca
034e0707a13e6e43da1343630047d47caeca896e
[ "MIT" ]
null
null
null
from __future__ import absolute_import, division from . import msa_numerics from pydca.fasta_reader import fasta_reader import logging import numpy as np """This module implements Direc Coupling Analysis (DCA) of residue coevolution for protein and RNA sequences using the mean-field algorithm. The final coevolution sc...
36.881874
120
0.585344
from __future__ import absolute_import, division from . import msa_numerics from pydca.fasta_reader import fasta_reader import logging import numpy as np logger = logging.getLogger(__name__) class MeanFieldDCAException(Exception): class MeanFieldDCA: def __init__(self, msa_file_name, biomolecule, pseudocount=No...
true
true
f72cf9518bb05b881c788963248acf6812065892
2,110
py
Python
pyDist/MultiKeyData.py
alekLukanen/pyDist
ffb2c3feb20afba078fec7381c8785eb1e2b0543
[ "MIT" ]
5
2017-12-24T08:11:16.000Z
2019-02-07T22:13:26.000Z
pyDist/MultiKeyData.py
alekLukanen/pyDist
ffb2c3feb20afba078fec7381c8785eb1e2b0543
[ "MIT" ]
1
2021-06-01T23:17:31.000Z
2021-06-01T23:17:31.000Z
pyDist/MultiKeyData.py
alekLukanen/pyDist
ffb2c3feb20afba078fec7381c8785eb1e2b0543
[ "MIT" ]
null
null
null
class MultiKeyData(object): def __init__(self): self._keys = {} self._values = {} self._links = {} self._index = 0 def __add_item(self, key, value): if key not in self._keys: self._keys[key] = self._index self._values[self._index] = value ...
24.534884
75
0.505687
class MultiKeyData(object): def __init__(self): self._keys = {} self._values = {} self._links = {} self._index = 0 def __add_item(self, key, value): if key not in self._keys: self._keys[key] = self._index self._values[self._index] = value ...
true
true
f72cf995acdc249a52c5780d6bbc9e63253eff06
18,720
py
Python
awesometkinter/utils.py
python-gui-application/AwesomeTkinter
73f638ac432bafbbd4296588a3d20f27f8570577
[ "MIT" ]
61
2020-09-16T14:22:08.000Z
2022-03-18T07:38:15.000Z
awesometkinter/utils.py
python-gui-application/AwesomeTkinter
73f638ac432bafbbd4296588a3d20f27f8570577
[ "MIT" ]
10
2020-09-15T10:52:24.000Z
2021-12-24T00:57:22.000Z
awesometkinter/utils.py
python-gui-application/AwesomeTkinter
73f638ac432bafbbd4296588a3d20f27f8570577
[ "MIT" ]
6
2020-11-17T06:33:01.000Z
2021-11-05T08:04:29.000Z
import base64 import math import platform import tkinter as tk from tkinter import ttk import PIL from PIL import Image, ImageTk, ImageColor, ImageDraw, ImageFilter import hashlib import io def identify_operating_system(): """identify current operating system Returns: (str): 'Windows', 'Linux', or 'D...
30.291262
119
0.595459
import base64 import math import platform import tkinter as tk from tkinter import ttk import PIL from PIL import Image, ImageTk, ImageColor, ImageDraw, ImageFilter import hashlib import io def identify_operating_system(): return platform.system() def calc_md5(binary_data): return hashlib.md5(binary_data)....
true
true
f72cfc43e5ce6dc5144f575469244b87366239db
16,996
py
Python
arguments.py
wakafengfan/CPM-1-Finetune
b2c30bd94df31bcd6ee75ba90c347113563d4075
[ "MIT" ]
60
2020-12-14T01:51:49.000Z
2021-06-14T05:54:45.000Z
arguments.py
wakafengfan/CPM-1-Finetune
b2c30bd94df31bcd6ee75ba90c347113563d4075
[ "MIT" ]
29
2020-12-16T13:04:52.000Z
2021-06-10T12:29:11.000Z
arguments.py
wakafengfan/CPM-1-Finetune
b2c30bd94df31bcd6ee75ba90c347113563d4075
[ "MIT" ]
11
2020-12-24T07:17:39.000Z
2021-06-11T07:37:22.000Z
# coding=utf-8 # Copyright (c) 2019, NVIDIA CORPORATION. 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 re...
49.695906
89
0.600435
import argparse import os import torch import deepspeed def add_model_config_args(parser): group = parser.add_argument_group('model', 'model configuration') group.add_argument('--pretrained-bert', action='store_true', help='use a pretrained bert-large-uncased model ins...
true
true
f72cfd482c15f282554b38514a3e096adee885e0
22,294
py
Python
configs/video_detect.py
me714/Dwin_Transformer
825a63869c46db4ef83ccc31d479bbd971ffd47c
[ "Apache-2.0" ]
null
null
null
configs/video_detect.py
me714/Dwin_Transformer
825a63869c46db4ef83ccc31d479bbd971ffd47c
[ "Apache-2.0" ]
null
null
null
configs/video_detect.py
me714/Dwin_Transformer
825a63869c46db4ef83ccc31d479bbd971ffd47c
[ "Apache-2.0" ]
1
2022-03-15T06:21:57.000Z
2022-03-15T06:21:57.000Z
import argparse import math import os import shutil import time import numpy as np from pathlib import Path from ensemble_boxes import * import copy import cv2 import torch import torch.backends.cudnn as cudnn from numpy import random import matplotlib.pyplot as plt from itertools import combinations import random fro...
44.322068
157
0.540056
import argparse import math import os import shutil import time import numpy as np from pathlib import Path from ensemble_boxes import * import copy import cv2 import torch import torch.backends.cudnn as cudnn from numpy import random import matplotlib.pyplot as plt from itertools import combinations import random fro...
true
true
f72cfd7e4073d6621ae92411769b73ecd011c187
3,768
py
Python
api/vk_methods.py
greenjew/deeploma
499de7ad844546acf0760aa00096d66216fd3ee9
[ "MIT" ]
null
null
null
api/vk_methods.py
greenjew/deeploma
499de7ad844546acf0760aa00096d66216fd3ee9
[ "MIT" ]
null
null
null
api/vk_methods.py
greenjew/deeploma
499de7ad844546acf0760aa00096d66216fd3ee9
[ "MIT" ]
1
2020-07-08T16:26:18.000Z
2020-07-08T16:26:18.000Z
import requests as r import pandas as pd import time from datetime import datetime import re TOKEN_VK = '23acc95023acc95023acc9504023c092a1223ac23acc9507ef4dc240205bcafea27244d' # vk service token version = 5.101 def get_members(group_id): try_count = 0 while try_count < 2: try: respon...
35.885714
114
0.522293
import requests as r import pandas as pd import time from datetime import datetime import re TOKEN_VK = '23acc95023acc95023acc9504023c092a1223ac23acc9507ef4dc240205bcafea27244d' version = 5.101 def get_members(group_id): try_count = 0 while try_count < 2: try: response = r.get('https:...
true
true
f72cfe472a8204ac2f26dd570050027f127c9500
956
py
Python
examples/OGLE-BLG-ECL-234840/plot_v8.py
NewCPM/MCPM
9fb9b7725ccc4452701be47d103ab61f81b4595b
[ "MIT" ]
2
2018-04-10T22:35:11.000Z
2018-05-16T21:00:40.000Z
examples/OGLE-BLG-ECL-234840/plot_v8.py
CPM-project/MCPM
9fb9b7725ccc4452701be47d103ab61f81b4595b
[ "MIT" ]
null
null
null
examples/OGLE-BLG-ECL-234840/plot_v8.py
CPM-project/MCPM
9fb9b7725ccc4452701be47d103ab61f81b4595b
[ "MIT" ]
null
null
null
import matplotlib.pyplot as plt from matplotlib import gridspec import numpy as np in_data = "run_6/run_6_e2_phot_prf_limit.dat" in_model = "run_6/run_6_e2_phot.res" out_file = "run_6/plot_eb234840_v8.png" kwargs = {'color': 'red', 'marker': '.', 'ls': 'none'} x_lim = [7500., 7528.] y_lim = [-4000., 500.] kwargs_1 ...
23.9
69
0.676778
import matplotlib.pyplot as plt from matplotlib import gridspec import numpy as np in_data = "run_6/run_6_e2_phot_prf_limit.dat" in_model = "run_6/run_6_e2_phot.res" out_file = "run_6/plot_eb234840_v8.png" kwargs = {'color': 'red', 'marker': '.', 'ls': 'none'} x_lim = [7500., 7528.] y_lim = [-4000., 500.] kwargs_1 ...
true
true
f72cfecb9a75e28d76c6235057fe3ad2011e3f3f
4,092
py
Python
code/txburstML.py
astrophys/Python_Debugging_Examples
510b4b6966166dddc14eda3f6813700386d2324f
[ "MIT" ]
null
null
null
code/txburstML.py
astrophys/Python_Debugging_Examples
510b4b6966166dddc14eda3f6813700386d2324f
[ "MIT" ]
null
null
null
code/txburstML.py
astrophys/Python_Debugging_Examples
510b4b6966166dddc14eda3f6813700386d2324f
[ "MIT" ]
null
null
null
#!/usr/bin/python3 import argparse import pandas as pd import numpy as np import warnings warnings.filterwarnings('ignore') from joblib import delayed,Parallel import os def whichKeep(est_params): kon = np.array(est_params)[:,0] koff = np.array(est_params)[:,1] ksyn = np.array(est_params)[:,2] which_ko...
35.582609
137
0.631232
import argparse import pandas as pd import numpy as np import warnings warnings.filterwarnings('ignore') from joblib import delayed,Parallel import os def whichKeep(est_params): kon = np.array(est_params)[:,0] koff = np.array(est_params)[:,1] ksyn = np.array(est_params)[:,2] which_kon = ~(kon < 2*1e-3...
true
true
f72cffe0eeccd3aa5694823b8d218f07ea6e87a0
1,413
py
Python
AI hack/Codes and Samples/image_process.py
AdarshSrivatsa98/AIhackathon
147f6f2ada2ebf1ba6e87df3c3d1d6ee964ac7ee
[ "BSD-3-Clause" ]
1
2021-03-29T04:27:27.000Z
2021-03-29T04:27:27.000Z
codes and samples/image_process.py
SrivatsaAdarsh/Obstacle-Detection-using-CNN
008940faffb8a9977b8dcc7a21dda4f328f0a81f
[ "MIT" ]
null
null
null
codes and samples/image_process.py
SrivatsaAdarsh/Obstacle-Detection-using-CNN
008940faffb8a9977b8dcc7a21dda4f328f0a81f
[ "MIT" ]
null
null
null
import time import cv2 import sys import os,os.path path = sys.argv[1] data_path=sys.argv[2] fpsLimit = 0.8 index = 0 currentFrame=0 intframe =0 startTime = time.time() # Playing video from file: cap = cv2.VideoCapture(str(path)) try: if not os.path.exists('data_path'): os.makedi...
25.690909
64
0.521585
import time import cv2 import sys import os,os.path path = sys.argv[1] data_path=sys.argv[2] fpsLimit = 0.8 index = 0 currentFrame=0 intframe =0 startTime = time.time() cap = cv2.VideoCapture(str(path)) try: if not os.path.exists('data_path'): os.makedirs('data_path') except OSE...
true
true
f72cffe6fb7e02f2604f6918e08414a09ad9a4c2
2,529
py
Python
recommendations_system/ffm/ffm.py
mmikolajczak/recommendation_system_hetrec2011_movielens
3ae13e62605ffbf5517bc2079e086a400de48748
[ "MIT" ]
4
2019-12-04T08:42:21.000Z
2020-06-07T07:22:08.000Z
recommendations_system/ffm/ffm.py
mmikolajczak/recommendation_system_hetrec2011_movielens
3ae13e62605ffbf5517bc2079e086a400de48748
[ "MIT" ]
null
null
null
recommendations_system/ffm/ffm.py
mmikolajczak/recommendation_system_hetrec2011_movielens
3ae13e62605ffbf5517bc2079e086a400de48748
[ "MIT" ]
null
null
null
import subprocess import warnings import os.path as osp import os import numpy as np # Note: libffm doesn't handle relative paths very well, hence abspath used. class FFM: def __init__(self, train_binary_path, predict_binary_path, model_path=None): self.train_binary_path = osp.abspath(train_binary_path) ...
41.459016
118
0.644128
import subprocess import warnings import os.path as osp import os import numpy as np class FFM: def __init__(self, train_binary_path, predict_binary_path, model_path=None): self.train_binary_path = osp.abspath(train_binary_path) self.predict_binary_path = osp.abspath(predict_binary_path) ...
true
true
f72d0142e44b378e8893afaa8b5bbafa3e81c8da
2,259
py
Python
src/EmailAlert/fancymail.py
JyotiSunkara/Energy-Monitoring-And-Control
efba4ac611e7054b78492ccf5e758a81621c8d6d
[ "MIT" ]
1
2020-06-27T03:25:11.000Z
2020-06-27T03:25:11.000Z
src/EmailAlert/fancymail.py
JyotiSunkara/Energy-Monitoring-And-Control
efba4ac611e7054b78492ccf5e758a81621c8d6d
[ "MIT" ]
null
null
null
src/EmailAlert/fancymail.py
JyotiSunkara/Energy-Monitoring-And-Control
efba4ac611e7054b78492ccf5e758a81621c8d6d
[ "MIT" ]
null
null
null
from smtplib import SMTP from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from jinja2 import Environment, FileSystemLoader import os from_email = 'krbdashboard@outlook.com' password = 'ArushiSinghal' env = Environment( loader=FileSystemLoader('./templates/')) def get_contacts(...
25.670455
71
0.555556
from smtplib import SMTP from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from jinja2 import Environment, FileSystemLoader import os from_email = 'krbdashboard@outlook.com' password = 'ArushiSinghal' env = Environment( loader=FileSystemLoader('./templates/')) def get_contacts(...
true
true
f72d017e70b5e4176196a0457bdf724775bda1b5
5,587
py
Python
sdk/python/pulumi_azure_nextgen/apimanagement/latest/get_api_release.py
pulumi/pulumi-azure-nextgen
452736b0a1cf584c2d4c04666e017af6e9b2c15c
[ "Apache-2.0" ]
31
2020-09-21T09:41:01.000Z
2021-02-26T13:21:59.000Z
sdk/python/pulumi_azure_nextgen/apimanagement/latest/get_api_release.py
pulumi/pulumi-azure-nextgen
452736b0a1cf584c2d4c04666e017af6e9b2c15c
[ "Apache-2.0" ]
231
2020-09-21T09:38:45.000Z
2021-03-01T11:16:03.000Z
sdk/python/pulumi_azure_nextgen/apimanagement/latest/get_api_release.py
pulumi/pulumi-azure-nextgen
452736b0a1cf584c2d4c04666e017af6e9b2c15c
[ "Apache-2.0" ]
4
2020-09-29T14:14:59.000Z
2021-02-10T20:38:16.000Z
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union from ... import _utilities, _tables __a...
36.279221
190
0.65026
import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union from ... import _utilities, _tables __all__ = [ 'GetApiReleaseResult', 'AwaitableGetApiReleaseResult', 'get_api_release', ] warnings.warn("""The 'latest' version is deprecated. Please migrate...
true
true
f72d018e06b47ce1c3e6edeff90355eca52ef202
15,137
py
Python
apps/resume/views.py
ozet-team/ozet-server
4772d37339634adee6ace65a5e2380df4bd22bbb
[ "MIT" ]
null
null
null
apps/resume/views.py
ozet-team/ozet-server
4772d37339634adee6ace65a5e2380df4bd22bbb
[ "MIT" ]
4
2021-11-27T14:15:55.000Z
2021-12-10T12:59:44.000Z
apps/resume/views.py
ozet-team/ozet-server
4772d37339634adee6ace65a5e2380df4bd22bbb
[ "MIT" ]
null
null
null
from django.utils.functional import cached_property from drf_spectacular.types import OpenApiTypes from drf_spectacular.utils import extend_schema, OpenApiExample, OpenApiParameter from rest_framework.exceptions import NotFound from rest_framework.generics import ( ListCreateAPIView, RetrieveUpdateAPIView, ...
37.375309
117
0.658321
from django.utils.functional import cached_property from drf_spectacular.types import OpenApiTypes from drf_spectacular.utils import extend_schema, OpenApiExample, OpenApiParameter from rest_framework.exceptions import NotFound from rest_framework.generics import ( ListCreateAPIView, RetrieveUpdateAPIView, ...
true
true
f72d027eb1356111f2daf107008ee00d025ad541
2,954
py
Python
find_deathdomains.py
caspase-like-homolog-identifier/c14_witcher
e2c481607b85fed749daec0e9b3b29b65d6b448f
[ "MIT" ]
null
null
null
find_deathdomains.py
caspase-like-homolog-identifier/c14_witcher
e2c481607b85fed749daec0e9b3b29b65d6b448f
[ "MIT" ]
null
null
null
find_deathdomains.py
caspase-like-homolog-identifier/c14_witcher
e2c481607b85fed749daec0e9b3b29b65d6b448f
[ "MIT" ]
null
null
null
#!/usr/bin/env python from run_hmmer import RunHmmer from Bio import SearchIO import pandas as pd import collections import random import tempfile import argparse import pprint import glob import sys class FindDeathDomains(RunHmmer): def __init__(self, seqfile, dd_hmm_path, *hmmersearch_args): """ Sub...
31.094737
133
0.58497
from run_hmmer import RunHmmer from Bio import SearchIO import pandas as pd import collections import random import tempfile import argparse import pprint import glob import sys class FindDeathDomains(RunHmmer): def __init__(self, seqfile, dd_hmm_path, *hmmersearch_args): self.dd_hmm_paths...
true
true
f72d032ec7455ded65fafe668268d74e9cbda5cc
2,306
py
Python
models.py
phpwizz/SimpelApi
c2a5f28fff752fb84e99568a3e0dab5c37e03c94
[ "MIT" ]
1
2018-07-14T08:43:25.000Z
2018-07-14T08:43:25.000Z
models.py
phpwizz/SimpelApi
c2a5f28fff752fb84e99568a3e0dab5c37e03c94
[ "MIT" ]
null
null
null
models.py
phpwizz/SimpelApi
c2a5f28fff752fb84e99568a3e0dab5c37e03c94
[ "MIT" ]
null
null
null
import os import sys from sqlalchemy import Column, ForeignKey, Integer, String from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relationship from sqlalchemy import create_engine from passlib.apps import custom_app_context as pwd_context import random, string from itsdangerous import(T...
26.813953
103
0.641804
import os import sys from sqlalchemy import Column, ForeignKey, Integer, String from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relationship from sqlalchemy import create_engine from passlib.apps import custom_app_context as pwd_context import random, string from itsdangerous import(T...
true
true
f72d04129209f13907fb9ece50d3696c445c1bc3
11,522
py
Python
gammapy/catalog/tests/test_hess.py
watsonjj/gammapy
8d2498c8f63f73d1fbe4ba81ab02d9e72552df67
[ "BSD-3-Clause" ]
null
null
null
gammapy/catalog/tests/test_hess.py
watsonjj/gammapy
8d2498c8f63f73d1fbe4ba81ab02d9e72552df67
[ "BSD-3-Clause" ]
null
null
null
gammapy/catalog/tests/test_hess.py
watsonjj/gammapy
8d2498c8f63f73d1fbe4ba81ab02d9e72552df67
[ "BSD-3-Clause" ]
null
null
null
# Licensed under a 3-clause BSD style license - see LICENSE.rst from collections import Counter import pytest import numpy as np from numpy.testing import assert_allclose from astropy import units as u from astropy.coordinates import SkyCoord, Angle from astropy.table import Table from ...utils.testing import assert_qu...
37.167742
87
0.661083
from collections import Counter import pytest import numpy as np from numpy.testing import assert_allclose from astropy import units as u from astropy.coordinates import SkyCoord, Angle from astropy.table import Table from ...utils.testing import assert_quantity_allclose from ...utils.testing import requires_data, req...
true
true
f72d04c38d826a7bc9753a2f6f269707d60b54c5
2,335
py
Python
nmmo/entity/player.py
jsuarez5341/neural-mmo
0828982e8a30641986fdd947ab82f34c008fafde
[ "MIT" ]
230
2019-07-03T06:52:29.000Z
2021-12-10T18:47:37.000Z
nmmo/entity/player.py
jsuarez5341/neural-mmo
0828982e8a30641986fdd947ab82f34c008fafde
[ "MIT" ]
16
2019-10-11T16:51:27.000Z
2021-12-06T14:32:31.000Z
nmmo/entity/player.py
jsuarez5341/neural-mmo
0828982e8a30641986fdd947ab82f34c008fafde
[ "MIT" ]
40
2019-08-02T19:36:38.000Z
2021-12-02T09:59:08.000Z
import numpy as np from pdb import set_trace as T import nmmo from nmmo.systems import ai, equipment from nmmo.lib import material from nmmo.systems.skill import Skills from nmmo.systems.achievement import Diary from nmmo.entity import entity class Player(entity.Entity): def __init__(self, realm, pos, agent, colo...
26.83908
71
0.651392
import numpy as np from pdb import set_trace as T import nmmo from nmmo.systems import ai, equipment from nmmo.lib import material from nmmo.systems.skill import Skills from nmmo.systems.achievement import Diary from nmmo.entity import entity class Player(entity.Entity): def __init__(self, realm, pos, agent, colo...
true
true
f72d0563aa56e9c5a65d9965f487213c64d35e84
3,423
py
Python
newchain_keys/main.py
newtonproject/newchain-keys.py
d8a053d78787dfc4403b57e60d54d0472d59787c
[ "MIT" ]
null
null
null
newchain_keys/main.py
newtonproject/newchain-keys.py
d8a053d78787dfc4403b57e60d54d0472d59787c
[ "MIT" ]
null
null
null
newchain_keys/main.py
newtonproject/newchain-keys.py
d8a053d78787dfc4403b57e60d54d0472d59787c
[ "MIT" ]
null
null
null
from typing import (Any, Union, Type) # noqa: F401 from newchain_keys.datatypes import ( LazyBackend, PublicKey, PrivateKey, Signature, ) from newchain_keys.exceptions import ( ValidationError, ) from newchain_keys.validation import ( validate_message_hash, ) # These must be aliased due to a...
36.414894
95
0.643003
from typing import (Any, Union, Type) from newchain_keys.datatypes import ( LazyBackend, PublicKey, PrivateKey, Signature, ) from newchain_keys.exceptions import ( ValidationError, ) from newchain_keys.validation import ( validate_message_hash, ) _PublicKey = PublicKey _PrivateKey = Priva...
true
true
f72d059384ed8eef053b45a327b0c27c29814ac1
11,111
py
Python
opentelemetry-sdk/tests/metrics/test_metrics.py
3tilley/opentelemetry-python
4ed4fd08db67de69369f87862e43562c2e43fed5
[ "Apache-2.0" ]
null
null
null
opentelemetry-sdk/tests/metrics/test_metrics.py
3tilley/opentelemetry-python
4ed4fd08db67de69369f87862e43562c2e43fed5
[ "Apache-2.0" ]
null
null
null
opentelemetry-sdk/tests/metrics/test_metrics.py
3tilley/opentelemetry-python
4ed4fd08db67de69369f87862e43562c2e43fed5
[ "Apache-2.0" ]
null
null
null
# Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
34.187692
97
0.671587
from logging import WARNING from unittest import TestCase from unittest.mock import MagicMock, Mock, patch from opentelemetry._metrics import NoOpMeter from opentelemetry.sdk._metrics import Meter, MeterProvider from opentelemetry.sdk._metrics.instrument import ( Counter, Histogram, Observab...
true
true
f72d0628837767bf0423dbc36d367e46cce6f424
3,323
py
Python
src/logistic_regression.py
MehdiAbbanaBennani/statistical-optimisation
0de96661ca7ab857639ad14127b97af39321762e
[ "MIT" ]
null
null
null
src/logistic_regression.py
MehdiAbbanaBennani/statistical-optimisation
0de96661ca7ab857639ad14127b97af39321762e
[ "MIT" ]
null
null
null
src/logistic_regression.py
MehdiAbbanaBennani/statistical-optimisation
0de96661ca7ab857639ad14127b97af39321762e
[ "MIT" ]
null
null
null
import numpy as np from tqdm import tqdm from gradient import Gradient class LogisticRegression: def __init__(self, type, mu, gradient_param, data, d=100, theta=None): if theta is None: self.theta = np.random.rand(d) * 2 - 1 else: self.theta = theta self.type = ty...
33.908163
82
0.520012
import numpy as np from tqdm import tqdm from gradient import Gradient class LogisticRegression: def __init__(self, type, mu, gradient_param, data, d=100, theta=None): if theta is None: self.theta = np.random.rand(d) * 2 - 1 else: self.theta = theta self.type = ty...
true
true
f72d0638d4148f7ac1513563b596e331e42a1b8a
1,461
py
Python
Advance_Python/Linked_List/Search_Ele_In_SLL.py
siddharth-143/Python
293f4643a3a13e3b82d23fd8922db54dbb0f12bc
[ "MIT" ]
null
null
null
Advance_Python/Linked_List/Search_Ele_In_SLL.py
siddharth-143/Python
293f4643a3a13e3b82d23fd8922db54dbb0f12bc
[ "MIT" ]
null
null
null
Advance_Python/Linked_List/Search_Ele_In_SLL.py
siddharth-143/Python
293f4643a3a13e3b82d23fd8922db54dbb0f12bc
[ "MIT" ]
null
null
null
""" Python program to search for an element in the linked list using recursion """ class Node: def __init__(self, data): self.data = data self.next = None class Linked_list: def __init__(self): self.head = None self.last_node = None def append(self, data): if s...
26.563636
78
0.590691
class Node: def __init__(self, data): self.data = data self.next = None class Linked_list: def __init__(self): self.head = None self.last_node = None def append(self, data): if self.last_node is None: self.head = Node(data) self.last_node = ...
true
true
f72d0862c33d21e1bd9da9c2c2fa5d10f09f06f4
4,140
py
Python
pystratis/api/federation/tests/test_federation.py
madrazzl3/pystratis
8b78552e753ae1d12f2afb39e9a322a270fbb7b3
[ "MIT" ]
null
null
null
pystratis/api/federation/tests/test_federation.py
madrazzl3/pystratis
8b78552e753ae1d12f2afb39e9a322a270fbb7b3
[ "MIT" ]
null
null
null
pystratis/api/federation/tests/test_federation.py
madrazzl3/pystratis
8b78552e753ae1d12f2afb39e9a322a270fbb7b3
[ "MIT" ]
null
null
null
import pytest from pytest_mock import MockerFixture from pystratis.api.federation.responsemodels import * from pystratis.api.federation import Federation from pystratis.core.networks import StraxMain, CirrusMain def test_all_strax_endpoints_implemented(strax_swagger_json): paths = [key.lower() for key in strax_sw...
38.333333
100
0.700966
import pytest from pytest_mock import MockerFixture from pystratis.api.federation.responsemodels import * from pystratis.api.federation import Federation from pystratis.core.networks import StraxMain, CirrusMain def test_all_strax_endpoints_implemented(strax_swagger_json): paths = [key.lower() for key in strax_sw...
true
true
f72d089f873a7c0b075b4dd30a15b63980100580
20,269
py
Python
tools/ami-creator/scripts/win2019_cuda11_installer.py
mseth10/incubator-mxnet-ci
36a5050b9c7bd720a4aa87d225738400083d611d
[ "Apache-2.0" ]
10
2019-08-19T17:12:52.000Z
2021-11-07T21:25:32.000Z
tools/ami-creator/scripts/win2019_cuda11_installer.py
mseth10/incubator-mxnet-ci
36a5050b9c7bd720a4aa87d225738400083d611d
[ "Apache-2.0" ]
16
2019-10-22T17:07:40.000Z
2022-02-08T23:33:27.000Z
tools/ami-creator/scripts/win2019_cuda11_installer.py
mseth10/incubator-mxnet-ci
36a5050b9c7bd720a4aa87d225738400083d611d
[ "Apache-2.0" ]
15
2019-08-25T18:44:54.000Z
2021-11-07T21:25:25.000Z
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
42.852008
227
0.660763
__author__ = 'Pedro Larroy, Chance Bair, Joe Evans' __version__ = '0.4' import argparse import errno import logging import os import psutil import shutil import subprocess import urllib import stat import tempfile import zipfile from time import sleep from urllib.error import HTTPError import loggin...
true
true
f72d09e2fff6278a2ca4a3ec916f0240a3598469
2,143
py
Python
tests/examples/test_examples.py
ibraheemmmoosa/lightning-flash
c60fef81b27174543d7ad3a4d841faf71ad8536c
[ "Apache-2.0" ]
2
2021-06-25T08:42:36.000Z
2021-06-25T08:49:29.000Z
tests/examples/test_examples.py
edenlightning/lightning-flash
841986aa0081bdeaf785d1ed4c48dd108fa69a78
[ "Apache-2.0" ]
null
null
null
tests/examples/test_examples.py
edenlightning/lightning-flash
841986aa0081bdeaf785d1ed4c48dd108fa69a78
[ "Apache-2.0" ]
null
null
null
# Copyright The PyTorch Lightning team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
31.514706
81
0.674755
import subprocess import sys from pathlib import Path from typing import List, Optional, Tuple import pytest root = Path(__file__).parent.parent.parent def call_script(filepath: str, args: Optional[List[str]] = None, timeout: Optional[int] = 60 * 5) -> Tuple[int, str, st...
true
true
f72d0a505a4a11b305a59432ae84c13cac527366
1,848
py
Python
tests/functional/tests/rbd-mirror/test_rbd_mirror.py
u-kosmonaft-u/ceph-ansible
14c472707c165f77def05826b22885480af3e8f9
[ "Apache-2.0" ]
1,570
2015-01-03T08:38:22.000Z
2022-03-31T09:24:37.000Z
tests/functional/tests/rbd-mirror/test_rbd_mirror.py
u-kosmonaft-u/ceph-ansible
14c472707c165f77def05826b22885480af3e8f9
[ "Apache-2.0" ]
4,964
2015-01-05T10:41:44.000Z
2022-03-31T07:59:49.000Z
tests/functional/tests/rbd-mirror/test_rbd_mirror.py
u-kosmonaft-u/ceph-ansible
14c472707c165f77def05826b22885480af3e8f9
[ "Apache-2.0" ]
1,231
2015-01-04T11:48:16.000Z
2022-03-31T12:15:28.000Z
import pytest import json class TestRbdMirrors(object): @pytest.mark.no_docker def test_rbd_mirror_is_installed(self, node, host): assert host.package("rbd-mirror").is_installed def test_rbd_mirror_service_enabled_and_running(self, node, host): service_name = "ceph-rbd-mirror@rbd-mirror....
42
216
0.62987
import pytest import json class TestRbdMirrors(object): @pytest.mark.no_docker def test_rbd_mirror_is_installed(self, node, host): assert host.package("rbd-mirror").is_installed def test_rbd_mirror_service_enabled_and_running(self, node, host): service_name = "ceph-rbd-mirror@rbd-mirror....
true
true
f72d0b8d703a8988d4c6fdaaab16ad16480f62ab
10,785
py
Python
src/summarycode/summarizer.py
sthagen/nexB-scancode-toolkit
12cc1286df78af898fae76fa339da2bb50ad51b9
[ "Apache-2.0", "CC-BY-4.0" ]
null
null
null
src/summarycode/summarizer.py
sthagen/nexB-scancode-toolkit
12cc1286df78af898fae76fa339da2bb50ad51b9
[ "Apache-2.0", "CC-BY-4.0" ]
null
null
null
src/summarycode/summarizer.py
sthagen/nexB-scancode-toolkit
12cc1286df78af898fae76fa339da2bb50ad51b9
[ "Apache-2.0", "CC-BY-4.0" ]
null
null
null
# # Copyright (c) nexB Inc. and others. All rights reserved. # ScanCode is a trademark of nexB Inc. # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. # See https://github.com/nexB/scancode-toolkit for support or download. # See https://aboutcode.org for more in...
33.915094
99
0.697636
from collections import defaultdict import attr import fingerprints from commoncode.cliutils import POST_SCAN_GROUP, PluggableCommandLineOption from license_expression import Licensing from plugincode.post_scan import PostScanPlugin, post_scan_impl from cluecode.copyrights import CopyrightDetector from packa...
true
true
f72d0b98b7272d4c524f74d442bb17b81bda3d2a
1,257
py
Python
salt/pillar/varstack_pillar.py
preoctopus/salt
aceaaa0e2f2f2ff29a694393bd82bba0d88fa44d
[ "Apache-2.0" ]
3
2015-04-16T18:42:35.000Z
2017-10-30T16:57:49.000Z
salt/pillar/varstack_pillar.py
preoctopus/salt
aceaaa0e2f2f2ff29a694393bd82bba0d88fa44d
[ "Apache-2.0" ]
16
2015-11-18T00:44:03.000Z
2018-10-29T20:48:27.000Z
salt/pillar/varstack_pillar.py
preoctopus/salt
aceaaa0e2f2f2ff29a694393bd82bba0d88fa44d
[ "Apache-2.0" ]
4
2020-11-04T06:28:05.000Z
2022-02-09T10:54:49.000Z
# -*- coding: utf-8 -*- ''' Use `Varstack <https://github.com/conversis/varstack>`_ data as a Pillar source Configuring Varstack ==================== Using varstack in Salt is fairly simple. Just put the following into the config file of your master: .. code-block:: yaml ext_pillar: - varstack: /etc/varst...
22.854545
79
0.703262
from __future__ import absolute_import import logging HAS_VARSTACK = False try: import varstack HAS_VARSTACK = True except ImportError: pass log = logging.getLogger(__name__) __virtualname__ = 'varstack' def __virtual__(): if not HAS_VARSTACK: return False return __virtualname__ ...
true
true
f72d0c4a82e81d1e634b40b84dd34a80b3db88c1
113
py
Python
Codeforces/637B Nastya and Door.py
a3X3k/Competitive-programing-hacktoberfest-2021
bc3997997318af4c5eafad7348abdd9bf5067b4f
[ "Unlicense" ]
12
2021-06-05T09:40:10.000Z
2021-10-07T17:59:51.000Z
Codeforces/637B Nastya and Door.py
a3X3k/Competitive-programing-hacktoberfest-2021
bc3997997318af4c5eafad7348abdd9bf5067b4f
[ "Unlicense" ]
21
2020-10-10T10:41:03.000Z
2020-10-31T10:41:23.000Z
Codeforces/637B Nastya and Door.py
a3X3k/Competitive-programing-hacktoberfest-2021
bc3997997318af4c5eafad7348abdd9bf5067b4f
[ "Unlicense" ]
67
2021-08-01T10:04:52.000Z
2021-10-10T00:25:04.000Z
t = int(input()) for t in range(t): m,d=map(int,input().split()) l = list(map(int,input().split()))
22.6
38
0.530973
t = int(input()) for t in range(t): m,d=map(int,input().split()) l = list(map(int,input().split()))
true
true
f72d0cd7918505dd6a72b02b05dfa02f870e64c9
710
py
Python
News163_Spider/News163_Spider/pipelines.py
a904919863/Spiders_Collection
970aef563971eba5c9dca5dfe1cd8790561941be
[ "MIT" ]
3
2022-02-23T02:44:47.000Z
2022-02-28T06:41:26.000Z
News163_Spider/News163_Spider/pipelines.py
a904919863/Spiders_Collection
970aef563971eba5c9dca5dfe1cd8790561941be
[ "MIT" ]
null
null
null
News163_Spider/News163_Spider/pipelines.py
a904919863/Spiders_Collection
970aef563971eba5c9dca5dfe1cd8790561941be
[ "MIT" ]
null
null
null
# Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html # useful for handling different item types with a single interface from itemadapter import ItemAdapter class News163SpiderPipeline: fp = None ...
25.357143
66
0.64507
# See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html # useful for handling different item types with a single interface from itemadapter import ItemAdapter class News163SpiderPipeline: fp = None def open_spider(self,spider): print('开始爬虫......') self.fp = open('./news163.txt'...
true
true
f72d0f27a1d1b5199bb5a8833ffec4a28cd377c8
2,104
py
Python
PasswordManager/LoginDialog.py
whymatter/PasswordManager
86070a1f998362cfa026e6e6e9b820a2d7ad5f06
[ "MIT" ]
null
null
null
PasswordManager/LoginDialog.py
whymatter/PasswordManager
86070a1f998362cfa026e6e6e9b820a2d7ad5f06
[ "MIT" ]
null
null
null
PasswordManager/LoginDialog.py
whymatter/PasswordManager
86070a1f998362cfa026e6e6e9b820a2d7ad5f06
[ "MIT" ]
null
null
null
import sys import os.path from PyQt5 import QtWidgets, uic from PyQt5.QtWidgets import QApplication, QTableWidgetItem from Crypto.Cipher import AES import json from constants import FILE_NAME, KEY_ENCODING from PwWindow import PwWindow # -*- coding: utf-8 -*- """ Created on Fri Nov 17 13:53:56 2017 @au...
30.492754
93
0.586502
import sys import os.path from PyQt5 import QtWidgets, uic from PyQt5.QtWidgets import QApplication, QTableWidgetItem from Crypto.Cipher import AES import json from constants import FILE_NAME, KEY_ENCODING from PwWindow import PwWindow class LoginDialog(QtWidgets.QDialog): def __init__(self, paren...
true
true
f72d0f3414639adbfb45b04d9d66268327301c51
380
py
Python
apps/db_data/migrations/0018_auto_20200723_2120.py
rhu2001/csua-backend
d2464c7eacfd1d675e0cc08f93f3b5083fa591dc
[ "MIT" ]
null
null
null
apps/db_data/migrations/0018_auto_20200723_2120.py
rhu2001/csua-backend
d2464c7eacfd1d675e0cc08f93f3b5083fa591dc
[ "MIT" ]
null
null
null
apps/db_data/migrations/0018_auto_20200723_2120.py
rhu2001/csua-backend
d2464c7eacfd1d675e0cc08f93f3b5083fa591dc
[ "MIT" ]
null
null
null
# Generated by Django 2.2.12 on 2020-07-24 04:20 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('db_data', '0017_notice'), ] operations = [ migrations.AlterField( model_name='officer', name='officer_since', ...
20
48
0.592105
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('db_data', '0017_notice'), ] operations = [ migrations.AlterField( model_name='officer', name='officer_since', field=models.DateField(blank=True), ...
true
true
f72d0f3e5dbf9fe0132a52a219eaa07ffb21b9cc
4,297
py
Python
npy_append_array/npy_append_array.py
synapticarbors/npy-append-array
bf33483e7c2c50e13c9e55940878ca8217f4d4ad
[ "MIT" ]
null
null
null
npy_append_array/npy_append_array.py
synapticarbors/npy-append-array
bf33483e7c2c50e13c9e55940878ca8217f4d4ad
[ "MIT" ]
null
null
null
npy_append_array/npy_append_array.py
synapticarbors/npy-append-array
bf33483e7c2c50e13c9e55940878ca8217f4d4ad
[ "MIT" ]
null
null
null
import numpy as np import os.path from struct import pack, unpack from io import BytesIO def header_tuple_dict(tuple_in): return { 'shape': tuple_in[0], 'fortran_order': tuple_in[1], 'descr': np.lib.format.dtype_to_descr(tuple_in[2]) } def has_fortran_order(arr): return not arr.fla...
29.431507
78
0.573191
import numpy as np import os.path from struct import pack, unpack from io import BytesIO def header_tuple_dict(tuple_in): return { 'shape': tuple_in[0], 'fortran_order': tuple_in[1], 'descr': np.lib.format.dtype_to_descr(tuple_in[2]) } def has_fortran_order(arr): return not arr.fla...
true
true
f72d0fdb931b1dcc84a293aeef05fc7e649e1c49
23
py
Python
prepack/__init__.py
CargoCodes/PreparePack
3d1d3623c0c86ab02a92a567ed954fb37e18b8fa
[ "MIT" ]
null
null
null
prepack/__init__.py
CargoCodes/PreparePack
3d1d3623c0c86ab02a92a567ed954fb37e18b8fa
[ "MIT" ]
null
null
null
prepack/__init__.py
CargoCodes/PreparePack
3d1d3623c0c86ab02a92a567ed954fb37e18b8fa
[ "MIT" ]
null
null
null
from .prepack import *
11.5
22
0.73913
from .prepack import *
true
true
f72d1029095787de77bafa202e5314c2ea6e90db
262
py
Python
examples/client.py
Scauting-Burgum/RemoteVar
bc3b1ffaace5defed1cd3a3e7042002717a3e44a
[ "MIT" ]
1
2018-06-14T14:59:56.000Z
2018-06-14T14:59:56.000Z
examples/client.py
Scauting-Burgum/ScautEvent-python
bc3b1ffaace5defed1cd3a3e7042002717a3e44a
[ "MIT" ]
null
null
null
examples/client.py
Scauting-Burgum/ScautEvent-python
bc3b1ffaace5defed1cd3a3e7042002717a3e44a
[ "MIT" ]
null
null
null
from ScautEvent.client import EventClient from ScautEvent.common import Event client = EventClient("localhost", 5000) client.listeners["message"] = print client.start() while True: message = input() event = Event("message", message) client.push(event)
18.714286
41
0.748092
from ScautEvent.client import EventClient from ScautEvent.common import Event client = EventClient("localhost", 5000) client.listeners["message"] = print client.start() while True: message = input() event = Event("message", message) client.push(event)
true
true
f72d105dd8903c3509596490416a261c9efa1878
7,239
py
Python
tests/gold_tests/tls/tls_tunnel_forward.test.py
masaori335/trafficserver
58e7e8675c96a5a4eb958a442942892f6e2a0ef4
[ "Apache-2.0" ]
1
2019-10-28T04:36:50.000Z
2019-10-28T04:36:50.000Z
tests/gold_tests/tls/tls_tunnel_forward.test.py
masaori335/trafficserver
58e7e8675c96a5a4eb958a442942892f6e2a0ef4
[ "Apache-2.0" ]
1
2021-06-27T23:06:33.000Z
2021-06-27T23:06:33.000Z
tests/gold_tests/tls/tls_tunnel_forward.test.py
masaori335/trafficserver
58e7e8675c96a5a4eb958a442942892f6e2a0ef4
[ "Apache-2.0" ]
null
null
null
''' ''' # 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");...
60.325
332
0.754524
import os Test.Summary = ''' Test tunneling and forwarding based on SNI ''' ts = Test.MakeATSProcess("ts", select_ports=False) server_foo = Test.MakeOriginServer("server_foo", ssl=True) server_bar = Test.MakeOriginServer("server_bar", ssl=False) server_random = Test.MakeOriginServer("server_random", s...
true
true
f72d1174e70c56ea9c0c9a435927929db9497bbd
1,820
py
Python
resources/WPy32/python-3.10.2/Lib/distutils/tests/test_bdist.py
eladkarako/yt-dlp_kit
6365651111ef4d2f94335cf38bf4d9b0136d42d2
[ "Unlicense" ]
1
2022-03-26T15:43:50.000Z
2022-03-26T15:43:50.000Z
resources/WPy32/python-3.10.2/Lib/distutils/tests/test_bdist.py
eladkarako/yt-dlp_kit
6365651111ef4d2f94335cf38bf4d9b0136d42d2
[ "Unlicense" ]
null
null
null
resources/WPy32/python-3.10.2/Lib/distutils/tests/test_bdist.py
eladkarako/yt-dlp_kit
6365651111ef4d2f94335cf38bf4d9b0136d42d2
[ "Unlicense" ]
1
2022-03-28T19:28:45.000Z
2022-03-28T19:28:45.000Z
"""Tests for distutils.command.bdist.""" import os import unittest from test.support import run_unittest import warnings with warnings.catch_warnings(): warnings.simplefilter('ignore', DeprecationWarning) from distutils.command.bdist import bdist from distutils.tests import support class Buil...
31.929825
77
0.591209
import os import unittest from test.support import run_unittest import warnings with warnings.catch_warnings(): warnings.simplefilter('ignore', DeprecationWarning) from distutils.command.bdist import bdist from distutils.tests import support class BuildTestCase(support.TempdirManager, ...
true
true
f72d1185c8f7b68defcc43981f991746536dc0b5
484
py
Python
speedysvc/toolkit/py_ini/write/conv_to_str.py
mcyph/shmrpc
4e0e972657f677a845eb6e7acbf788535c07117a
[ "Unlicense", "MIT" ]
4
2020-02-11T04:20:57.000Z
2021-06-20T10:03:52.000Z
speedysvc/toolkit/py_ini/write/conv_to_str.py
mcyph/shmrpc
4e0e972657f677a845eb6e7acbf788535c07117a
[ "Unlicense", "MIT" ]
1
2020-09-16T23:18:30.000Z
2020-09-21T10:07:22.000Z
speedysvc/toolkit/py_ini/write/conv_to_str.py
mcyph/shmrpc
4e0e972657f677a845eb6e7acbf788535c07117a
[ "Unlicense", "MIT" ]
null
null
null
def conv_to_str(o): if isinstance(o, str): # Remove initial "u" chars before strings # if no Unicode in them if possible try: o = str(o) except: o = str(o) elif isinstance(o, (list, tuple)): is_tuple = isinstance(o, tuple) o = [conv_to_str...
23.047619
49
0.5
def conv_to_str(o): if isinstance(o, str): try: o = str(o) except: o = str(o) elif isinstance(o, (list, tuple)): is_tuple = isinstance(o, tuple) o = [conv_to_str(i) for i in o] if is_tuple: o = tuple(o) elif isi...
true
true
f72d11981b4d9f232355f2e60ad86e0a43b91b4f
11,383
py
Python
tests/v16/test_enums.py
Jonas628/discovere_ocpp
6456e72a9d6725634725756e67fcfd5be007de79
[ "MIT" ]
null
null
null
tests/v16/test_enums.py
Jonas628/discovere_ocpp
6456e72a9d6725634725756e67fcfd5be007de79
[ "MIT" ]
null
null
null
tests/v16/test_enums.py
Jonas628/discovere_ocpp
6456e72a9d6725634725756e67fcfd5be007de79
[ "MIT" ]
null
null
null
# flake8: noqa from ocpp_d.v16.enums import * def test_authorization_status(): assert AuthorizationStatus.accepted == "Accepted" assert AuthorizationStatus.blocked == "Blocked" assert AuthorizationStatus.expired == "Expired" assert AuthorizationStatus.invalid == "Invalid" assert AuthorizationStatu...
36.136508
68
0.734516
from ocpp_d.v16.enums import * def test_authorization_status(): assert AuthorizationStatus.accepted == "Accepted" assert AuthorizationStatus.blocked == "Blocked" assert AuthorizationStatus.expired == "Expired" assert AuthorizationStatus.invalid == "Invalid" assert AuthorizationStatus.concurrent_t...
true
true
f72d122ad8ca0a487720f9630a8a2086444e3a23
384
py
Python
1stRound/Easy/819 Most Common Word/RegexCounter1.py
ericchen12377/Leetcode-Algorithm-Python
eb58cd4f01d9b8006b7d1a725fc48910aad7f192
[ "MIT" ]
2
2020-04-24T18:36:52.000Z
2020-04-25T00:15:57.000Z
1stRound/Easy/819 Most Common Word/RegexCounter1.py
ericchen12377/Leetcode-Algorithm-Python
eb58cd4f01d9b8006b7d1a725fc48910aad7f192
[ "MIT" ]
null
null
null
1stRound/Easy/819 Most Common Word/RegexCounter1.py
ericchen12377/Leetcode-Algorithm-Python
eb58cd4f01d9b8006b7d1a725fc48910aad7f192
[ "MIT" ]
null
null
null
import collections import re class Solution(object): def mostCommonWord(self, paragraph, banned): """ :type paragraph: str :type banned: List[str] :rtype: str """ paragraph = re.findall(r"\w+", paragraph.lower()) count = collections.Counter(x for x in paragrap...
29.538462
76
0.606771
import collections import re class Solution(object): def mostCommonWord(self, paragraph, banned): paragraph = re.findall(r"\w+", paragraph.lower()) count = collections.Counter(x for x in paragraph if x not in banned) return count.most_common(1)[0][0]
true
true
f72d12744056fae45f212a2dfb4d1368b26b9baf
15,546
py
Python
test/tools.py
jni/asv
f1ec1c157d52c77a799853062dac3468fab3e2ab
[ "BSD-3-Clause" ]
null
null
null
test/tools.py
jni/asv
f1ec1c157d52c77a799853062dac3468fab3e2ab
[ "BSD-3-Clause" ]
3
2018-07-26T17:56:30.000Z
2018-07-27T20:23:27.000Z
test/tools.py
jni/asv
f1ec1c157d52c77a799853062dac3468fab3e2ab
[ "BSD-3-Clause" ]
3
2018-07-25T22:53:31.000Z
2018-09-16T06:14:43.000Z
# Licensed under a 3-clause BSD style license - see LICENSE.rst # -*- coding: utf-8 -*- from __future__ import absolute_import, division, unicode_literals, print_function """ This file contains utilities to generate test repositories. """ import datetime import io import os import threading import time import six im...
29.724665
95
0.607487
from __future__ import absolute_import, division, unicode_literals, print_function import datetime import io import os import threading import time import six import tempfile import textwrap import sys from os.path import abspath, join, dirname, relpath, isdir from contextlib import contextmanager from hashlib imp...
true
true