hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c4628a354b0cddbcb048a1d50ce815aaa040404 | 277 | py | Python | dev_global/dev_global/env.py | FrederichRiver/neutrino3 | c16c6ea824999c012252d0e281473a6ab13fd38e | [
"BSD-3-Clause"
] | 1 | 2021-07-12T11:20:58.000Z | 2021-07-12T11:20:58.000Z | dev_global/dev_global/env.py | FrederichRiver/neutrino3 | c16c6ea824999c012252d0e281473a6ab13fd38e | [
"BSD-3-Clause"
] | null | null | null | dev_global/dev_global/env.py | FrederichRiver/neutrino3 | c16c6ea824999c012252d0e281473a6ab13fd38e | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python3
"""
global environment varibles
"""
PYTHON_VERSION = 3.8
LOCAL_TIME_ZONE = 'Beijing'
PROG_NAME = 'Neutrino'
TIME_FMT = '%Y-%m-%d'
LOG_TIME_FMT = "%Y-%m-%d %H:%M:%S"
GITHUB_URL = "https://github.com/FrederichRiver/neutrino3"
EMAIL = "hezhiyuan_tju@163.com"
| 19.785714 | 58 | 0.696751 |
PYTHON_VERSION = 3.8
LOCAL_TIME_ZONE = 'Beijing'
PROG_NAME = 'Neutrino'
TIME_FMT = '%Y-%m-%d'
LOG_TIME_FMT = "%Y-%m-%d %H:%M:%S"
GITHUB_URL = "https://github.com/FrederichRiver/neutrino3"
EMAIL = "hezhiyuan_tju@163.com"
| true | true |
1c462bb178d3b38b6a5d6e1fcb701ca8021f18d6 | 4,671 | py | Python | src/djangoSrc/app_api/settings.py | dighr/nethope_audio | 8571bd6f621920f3fea085be3879cab15ccfc1e6 | [
"MIT"
] | null | null | null | src/djangoSrc/app_api/settings.py | dighr/nethope_audio | 8571bd6f621920f3fea085be3879cab15ccfc1e6 | [
"MIT"
] | 9 | 2021-03-09T21:01:14.000Z | 2022-03-02T06:01:00.000Z | src/djangoSrc/app_api/settings.py | nethopeorg/nethope_audio | 8571bd6f621920f3fea085be3879cab15ccfc1e6 | [
"MIT"
] | null | null | null | """
Django settings for app_api project.
Generated by 'django-admin startproject' using Django 2.2.6.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
#... | 28.309091 | 98 | 0.673946 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '6xxk%%z1ii*9%j(a-8p63(l&v$fb2de1w2fl24b(@rxzgcpk-8'
DEBUG = True
ALLOWED_HOSTS = ['nethope-pr-assessment.appspot.com', '127.0.0.1']
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'd... | true | true |
1c462c16ea8f0a10483f7cda6cfdbfbea0e74394 | 615 | py | Python | themes/solarized-light.py | ruturajv/powerline-shell | 2c30b504bc1da01e8f0a2bc2723ad5cc70662ec8 | [
"MIT"
] | null | null | null | themes/solarized-light.py | ruturajv/powerline-shell | 2c30b504bc1da01e8f0a2bc2723ad5cc70662ec8 | [
"MIT"
] | null | null | null | themes/solarized-light.py | ruturajv/powerline-shell | 2c30b504bc1da01e8f0a2bc2723ad5cc70662ec8 | [
"MIT"
] | null | null | null | class Color(DefaultColor):
USERNAME_FG = 15
USERNAME_BG = 4
USERNAME_ROOT_BG = 1
HOSTNAME_FG = 15
HOSTNAME_BG = 10
HOME_SPECIAL_DISPLAY = False
PATH_FG = 10
PATH_BG = 7
CWD_FG = 0
SEPARATOR_FG = 14
READONLY_BG = 1
READONLY_FG = 7
REPO_CLEAN_FG = 0
REPO_CLEAN_B... | 17.083333 | 34 | 0.64065 | class Color(DefaultColor):
USERNAME_FG = 15
USERNAME_BG = 4
USERNAME_ROOT_BG = 1
HOSTNAME_FG = 15
HOSTNAME_BG = 10
HOME_SPECIAL_DISPLAY = False
PATH_FG = 10
PATH_BG = 7
CWD_FG = 0
SEPARATOR_FG = 14
READONLY_BG = 1
READONLY_FG = 7
REPO_CLEAN_FG = 0
REPO_CLEAN_B... | true | true |
1c462cdb35036a78451f4184c423dcc60ac9ac47 | 7,497 | py | Python | poptorch/toolbox/Dataloader_h5.py | balewski/neuron_inverter_benchmark | 4ad8a03c07e174728ccea2bc5f24d1ae620966a8 | [
"MIT"
] | null | null | null | poptorch/toolbox/Dataloader_h5.py | balewski/neuron_inverter_benchmark | 4ad8a03c07e174728ccea2bc5f24d1ae620966a8 | [
"MIT"
] | null | null | null | poptorch/toolbox/Dataloader_h5.py | balewski/neuron_inverter_benchmark | 4ad8a03c07e174728ccea2bc5f24d1ae620966a8 | [
"MIT"
] | 1 | 2022-01-14T22:25:20.000Z | 2022-01-14T22:25:20.000Z | __author__ = "Jan Balewski"
__email__ = "janstar1122@gmail.com"
'''
this data loader reads all data upon start, there is no distributed sampler
reads all data at once and serves them from RAM
- optimized for mult-GPU training
- only used block of data from each H5-file
- reads data from common file for all ranks
- a... | 38.25 | 246 | 0.577431 | __author__ = "Jan Balewski"
__email__ = "janstar1122@gmail.com"
import time, os
import random
import h5py
import numpy as np
from pprint import pprint
import copy
from torch.utils.data import Dataset, DataLoader
import torch
import logging
import poptorch
def get_data_loader(params, inpMD,domain,popopts, ve... | true | true |
1c462d72ef28053c69095bed607d4c067e869b96 | 3,358 | py | Python | expression_evaluation.py | mengguoru/expression_evaluation | a2e4dd45611e4577c38b40de3a718ecd5f77c5ae | [
"MIT"
] | null | null | null | expression_evaluation.py | mengguoru/expression_evaluation | a2e4dd45611e4577c38b40de3a718ecd5f77c5ae | [
"MIT"
] | null | null | null | expression_evaluation.py | mengguoru/expression_evaluation | a2e4dd45611e4577c38b40de3a718ecd5f77c5ae | [
"MIT"
] | null | null | null | '''
expression evaluation
author : mengguoru
date : 2016/03/27
'''
import re
class Expression:
def split(self,expr):
'''split numbers and operators into a array,return the array (without whiteSpace)'''
temp = re.split(r"(\+|\-|\*|\/|\(|\))",re.sub(r"\s+",'',expr))
temp2 = []
for ... | 38.159091 | 98 | 0.432102 | import re
class Expression:
def split(self,expr):
temp = re.split(r"(\+|\-|\*|\/|\(|\))",re.sub(r"\s+",'',expr))
temp2 = []
for i in range(len(temp)):
if temp[i] != '':
temp2.append(temp[i])
return temp2
def infix_to_suffix(self,expr):
stack_o... | true | true |
1c4630086ef30c6136a9edabe95d3911ecb465d4 | 13,194 | py | Python | lambda_function.py | rubrikinc/aws-native-secrets-rotation | c1488cc1b6fc2b89d32c83bd220678ee3bebfdbd | [
"MIT"
] | 1 | 2019-12-20T13:35:34.000Z | 2019-12-20T13:35:34.000Z | lambda_function.py | rubrikinc/aws-native-secrets-rotation | c1488cc1b6fc2b89d32c83bd220678ee3bebfdbd | [
"MIT"
] | null | null | null | lambda_function.py | rubrikinc/aws-native-secrets-rotation | c1488cc1b6fc2b89d32c83bd220678ee3bebfdbd | [
"MIT"
] | 2 | 2019-04-01T22:18:58.000Z | 2020-03-13T15:08:26.000Z | #!/usr/local/bin/python3
import boto3
import logging
import os
import ast
import json
import rubrik_cdm
from copy import deepcopy
import urllib3
urllib3.disable_warnings()
logger = logging.getLogger()
logger.setLevel(logging.INFO)
def lambda_handler(event, context):
"""Secrets Manager Rotation Template
This... | 53.417004 | 167 | 0.719948 |
import boto3
import logging
import os
import ast
import json
import rubrik_cdm
from copy import deepcopy
import urllib3
urllib3.disable_warnings()
logger = logging.getLogger()
logger.setLevel(logging.INFO)
def lambda_handler(event, context):
arn = event['SecretId']
token = event['ClientRequestToken']
s... | true | true |
1c4630ae0f50b4044900f2782a2b8d3bff5fdc1e | 401 | py | Python | task_manager_api/task_manager_api/urls.py | LsbProxy/task_manager_api | b014d74aa3cd5bc9952ac04548350d3a08836c8f | [
"MIT"
] | null | null | null | task_manager_api/task_manager_api/urls.py | LsbProxy/task_manager_api | b014d74aa3cd5bc9952ac04548350d3a08836c8f | [
"MIT"
] | null | null | null | task_manager_api/task_manager_api/urls.py | LsbProxy/task_manager_api | b014d74aa3cd5bc9952ac04548350d3a08836c8f | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('', include('auth.urls')),
path('', include('api.urls')),
path('admin/', admin.site.urls),
]
if settings.DEBUG:
urlpatterns += static(... | 26.733333 | 60 | 0.680798 | from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('', include('auth.urls')),
path('', include('api.urls')),
path('admin/', admin.site.urls),
]
if settings.DEBUG:
urlpatterns += static(... | true | true |
1c4631519443af09252e50a84ea2e878f561085d | 20,551 | py | Python | flux_combined_high_binding/model_857.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | flux_combined_high_binding/model_857.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | flux_combined_high_binding/model_857.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | # exported from PySB model 'model'
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU', 'C3pro'])
Monomer('SmacM', ['BaxA'])
Monomer('BaxM', ['BidM', '... | 95.143519 | 798 | 0.804146 |
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU', 'C3pro'])
Monomer('SmacM', ['BaxA'])
Monomer('BaxM', ['BidM', 'BaxA'])
Monomer('Apop', ['C3pro', ... | true | true |
1c4631a70ee71cb407b8c93a4400df836801fe55 | 1,365 | py | Python | examples/cellular_example.py | timhunderwood/numpy-to-stl | eea305ae30bb4aa5882d7c66edebe76173da8b06 | [
"MIT"
] | 1 | 2020-12-29T08:56:48.000Z | 2020-12-29T08:56:48.000Z | examples/cellular_example.py | timhunderwood/numpy-to-stl | eea305ae30bb4aa5882d7c66edebe76173da8b06 | [
"MIT"
] | null | null | null | examples/cellular_example.py | timhunderwood/numpy-to-stl | eea305ae30bb4aa5882d7c66edebe76173da8b06 | [
"MIT"
] | 1 | 2021-06-16T02:06:40.000Z | 2021-06-16T02:06:40.000Z | import cellular
import numpy
import mpl_toolkits.mplot3d
import matplotlib.pyplot as plt
import numpy_to_stl
def get_simulated_world(cells_per_day, rule, number_of_days):
world = cellular.World(cells_per_day, rule, ones=False)
world.simulate(number_of_days)
world.display(landscape=True)
return numpy.v... | 29.673913 | 88 | 0.745788 | import cellular
import numpy
import mpl_toolkits.mplot3d
import matplotlib.pyplot as plt
import numpy_to_stl
def get_simulated_world(cells_per_day, rule, number_of_days):
world = cellular.World(cells_per_day, rule, ones=False)
world.simulate(number_of_days)
world.display(landscape=True)
return numpy.v... | true | true |
1c463309478ab2730838c468b3402f7a8124d47e | 3,752 | py | Python | elasticlogger/hooks/elasticsearch/elasticsearch.py | danteay/elasticlogger | 3182e3d1d34564a5e95aaef3c10239d162eb691a | [
"MIT"
] | 1 | 2021-06-27T10:17:16.000Z | 2021-06-27T10:17:16.000Z | elasticlogger/hooks/elasticsearch/elasticsearch.py | danteay/elasticlogger | 3182e3d1d34564a5e95aaef3c10239d162eb691a | [
"MIT"
] | 4 | 2021-06-29T19:41:39.000Z | 2021-09-23T21:47:22.000Z | elasticlogger/hooks/elasticsearch/elasticsearch.py | danteay/elasticlogger | 3182e3d1d34564a5e95aaef3c10239d162eb691a | [
"MIT"
] | 1 | 2022-03-14T18:27:42.000Z | 2022-03-14T18:27:42.000Z | """Elastic search hook function."""
import os
import re
from datetime import datetime
from logging import CRITICAL, DEBUG, ERROR, INFO, WARNING
from typing import Any, AnyStr, Dict, NoReturn, Optional
from elasticsearch import Elasticsearch
from elasticlogger import utils
from elasticlogger.hooks import HookContext
... | 32.068376 | 114 | 0.661247 |
import os
import re
from datetime import datetime
from logging import CRITICAL, DEBUG, ERROR, INFO, WARNING
from typing import Any, AnyStr, Dict, NoReturn, Optional
from elasticsearch import Elasticsearch
from elasticlogger import utils
from elasticlogger.hooks import HookContext
from elasticlogger.ports.elasticsear... | true | true |
1c4633fe467d2a4c8b937c02025f2e49b2342f56 | 420 | py | Python | instapics/forms.py | UMULISA12/Instagram_Ip | 169c9326ef247c85808d9b7b8989c59740887615 | [
"MIT"
] | null | null | null | instapics/forms.py | UMULISA12/Instagram_Ip | 169c9326ef247c85808d9b7b8989c59740887615 | [
"MIT"
] | null | null | null | instapics/forms.py | UMULISA12/Instagram_Ip | 169c9326ef247c85808d9b7b8989c59740887615 | [
"MIT"
] | null | null | null | from .models import Image,Profile,Comment
from django import forms
class NewImageForm(forms.ModelForm):
class Meta:
model=Image
exclude=['profile','pub_date','name','likes','comments']
class NewProfileForm(forms.ModelForm):
class Meta:
model=Profile
exclude=['user']
class NewC... | 24.705882 | 64 | 0.666667 | from .models import Image,Profile,Comment
from django import forms
class NewImageForm(forms.ModelForm):
class Meta:
model=Image
exclude=['profile','pub_date','name','likes','comments']
class NewProfileForm(forms.ModelForm):
class Meta:
model=Profile
exclude=['user']
class NewC... | true | true |
1c4634872f7d494377366f5d864db3ecea175182 | 1,794 | py | Python | dataset/dataset_test.py | Beta3-Data/FacialLandmark-Live-Training | 10b2b464f1deb015a7f152bb14f120f0dc6f9de2 | [
"MIT"
] | null | null | null | dataset/dataset_test.py | Beta3-Data/FacialLandmark-Live-Training | 10b2b464f1deb015a7f152bb14f120f0dc6f9de2 | [
"MIT"
] | null | null | null | dataset/dataset_test.py | Beta3-Data/FacialLandmark-Live-Training | 10b2b464f1deb015a7f152bb14f120f0dc6f9de2 | [
"MIT"
] | null | null | null | from __future__ import print_function, division
import os
import torch
import pandas as pd
from skimage import io, transform
import numpy as np
import matplotlib.pyplot as plt
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms, utils
from FaceLandmarksDataset import FaceLandmar... | 30.40678 | 75 | 0.682832 | from __future__ import print_function, division
import os
import torch
import pandas as pd
from skimage import io, transform
import numpy as np
import matplotlib.pyplot as plt
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms, utils
from FaceLandmarksDataset import FaceLandmar... | true | true |
1c4634bf1a119368bd2b1ab2cfa1775e8ec4d0ce | 9,856 | py | Python | pyzoo/test/zoo/automl/model/test_Seq2Seq.py | Wesley-Du/analytics-zoo | e4ca11b219a43bceec99aba39cf30c8aa368e8b3 | [
"Apache-2.0"
] | 35 | 2020-07-03T06:31:12.000Z | 2020-07-12T08:38:10.000Z | pyzoo/test/zoo/automl/model/test_Seq2Seq.py | Angelina319/analytics-zoo | 439f2c99d657fb20a5ff4bf510869616402ba0cf | [
"Apache-2.0"
] | 2 | 2018-10-31T01:20:05.000Z | 2018-11-02T06:06:35.000Z | pyzoo/test/zoo/automl/model/test_Seq2Seq.py | Angelina319/analytics-zoo | 439f2c99d657fb20a5ff4bf510869616402ba0cf | [
"Apache-2.0"
] | 4 | 2019-02-25T03:26:56.000Z | 2019-03-06T04:41:31.000Z | #
# Copyright 2018 Analytics Zoo Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 48.078049 | 94 | 0.581879 |
import shutil
import tempfile
import pytest
from test.zoo.pipeline.utils.test_utils import ZooTestCase
from zoo.automl.model.Seq2Seq import *
from zoo.automl.feature.time_sequence import TimeSequenceFeatureTransformer
from numpy.testing import assert_array_almost_equal
class TestSeq2Seq(ZooTestCase)... | true | true |
1c46378d907548f7177d7694871d9e0601053adf | 61,104 | py | Python | python/ccxt/bitfinex2.py | Jsn2win/ccxt | fff369de2192a3b7c71ab1d29d0923db8d5af913 | [
"MIT"
] | null | null | null | python/ccxt/bitfinex2.py | Jsn2win/ccxt | fff369de2192a3b7c71ab1d29d0923db8d5af913 | [
"MIT"
] | null | null | null | python/ccxt/bitfinex2.py | Jsn2win/ccxt | fff369de2192a3b7c71ab1d29d0923db8d5af913 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.bitfinex import bitfinex
import hashlib
import math
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import Authe... | 41.539089 | 207 | 0.45961 |
port bitfinex
import hashlib
import math
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import ArgumentsRequired
from ccxt.base.errors import BadRequest
from ccxt.base.errors import BadSymbol
from ccxt.base.errors import InsufficientFunds
from ccxt.b... | true | true |
1c46380a9d4866b842ff9a1c2591e0d1ba1f4588 | 11,345 | py | Python | nuitka/tree/ReformulationDictionaryCreation.py | em3ndez/Nuitka | a5a036a94c1842d1cd72f27c0c67461798fdf977 | [
"Apache-2.0"
] | 1 | 2019-09-09T19:27:43.000Z | 2019-09-09T19:27:43.000Z | nuitka/tree/ReformulationDictionaryCreation.py | em3ndez/Nuitka | a5a036a94c1842d1cd72f27c0c67461798fdf977 | [
"Apache-2.0"
] | 1 | 2019-02-21T13:05:17.000Z | 2019-02-21T13:05:17.000Z | nuitka/tree/ReformulationDictionaryCreation.py | em3ndez/Nuitka | a5a036a94c1842d1cd72f27c0c67461798fdf977 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... | 36.362179 | 87 | 0.603967 |
from nuitka.nodes.AssignNodes import (
StatementAssignmentVariable,
StatementDelVariable,
StatementReleaseVariable,
)
from nuitka.nodes.AttributeNodes import ExpressionAttributeLookup
from nuitka.nodes.BuiltinIteratorNodes import ExpressionBuiltinIter1
from nuitka.nodes.BuiltinNextNodes im... | true | true |
1c46385a5596d5e0bd98b187dbff517c3d1d3c1c | 20,549 | py | Python | flux_combined_high_binding/model_741.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | flux_combined_high_binding/model_741.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | flux_combined_high_binding/model_741.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | # exported from PySB model 'model'
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU', 'C3pro'])
Monomer('SmacM', ['BaxA'])
Monomer('BaxM', ['BidM', '... | 95.134259 | 798 | 0.804127 |
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU', 'C3pro'])
Monomer('SmacM', ['BaxA'])
Monomer('BaxM', ['BidM', 'BaxA'])
Monomer('Apop', ['C3pro', ... | true | true |
1c463a5d7cdbdef19a2f8ee060198069e58e05e9 | 549 | py | Python | core/utils.py | matiaspacheco/cms_wehaa | 999f49344c453afd1cf8f11f36ac6b56b2b7f130 | [
"MIT"
] | null | null | null | core/utils.py | matiaspacheco/cms_wehaa | 999f49344c453afd1cf8f11f36ac6b56b2b7f130 | [
"MIT"
] | null | null | null | core/utils.py | matiaspacheco/cms_wehaa | 999f49344c453afd1cf8f11f36ac6b56b2b7f130 | [
"MIT"
] | null | null | null | # Standard Python library imports.
import math
import re
# Core Django imports.
from django.utils.html import strip_tags
def count_words(html_string):
# html_string = """
# <h1>This is a title</h1>
# """
word_string = strip_tags(html_string)
matching_words = re.findall(r'\w+', word_string)
cou... | 26.142857 | 67 | 0.714026 |
import math
import re
from django.utils.html import strip_tags
def count_words(html_string):
# <h1>This is a title</h1>
# """
word_string = strip_tags(html_string)
matching_words = re.findall(r'\w+', word_string)
count = len(matching_words)
return count
def read_time(html_string):
... | true | true |
1c463a5ecbad7e73fb57009519d7ca474d07af2c | 2,566 | py | Python | web-api/favorites/views.py | Egor4ik325/anyberry | 87787f82f1cec0f32d9d7c7384e7b2771f34af3c | [
"MIT"
] | 1 | 2021-09-12T16:28:52.000Z | 2021-09-12T16:28:52.000Z | web-api/favorites/views.py | Egor4ik325/anyberry | 87787f82f1cec0f32d9d7c7384e7b2771f34af3c | [
"MIT"
] | 2 | 2021-09-06T08:31:56.000Z | 2021-09-06T08:35:25.000Z | web-api/favorites/views.py | Egor4ik325/anyberry | 87787f82f1cec0f32d9d7c7384e7b2771f34af3c | [
"MIT"
] | null | null | null | from berries.models import Berry
from berries.serializers import BerrySerializer
from django.core.cache import cache
from rest_framework import status
from rest_framework.authentication import SessionAuthentication
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from ... | 32.897436 | 69 | 0.687062 | from berries.models import Berry
from berries.serializers import BerrySerializer
from django.core.cache import cache
from rest_framework import status
from rest_framework.authentication import SessionAuthentication
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from ... | true | true |
1c463a9792c032fff33e3627f78835a1ae9c2a50 | 4,436 | py | Python | elastalert/kibana_external_url_formatter.py | buratinopy/elastalert2 | 27deb8a61dd48798c4686ec95d3e48909903a694 | [
"Apache-2.0"
] | null | null | null | elastalert/kibana_external_url_formatter.py | buratinopy/elastalert2 | 27deb8a61dd48798c4686ec95d3e48909903a694 | [
"Apache-2.0"
] | null | null | null | elastalert/kibana_external_url_formatter.py | buratinopy/elastalert2 | 27deb8a61dd48798c4686ec95d3e48909903a694 | [
"Apache-2.0"
] | null | null | null | import boto3
import os
from urllib.parse import parse_qsl, urlencode, urljoin, urlparse, urlsplit, urlunsplit
import requests
from requests import RequestException
from requests.auth import AuthBase, HTTPBasicAuth
from elastalert.auth import RefeshableAWSRequestsAuth
from elastalert.util import EAException
def appen... | 31.913669 | 86 | 0.665014 | import boto3
import os
from urllib.parse import parse_qsl, urlencode, urljoin, urlparse, urlsplit, urlunsplit
import requests
from requests import RequestException
from requests.auth import AuthBase, HTTPBasicAuth
from elastalert.auth import RefeshableAWSRequestsAuth
from elastalert.util import EAException
def appen... | true | true |
1c463b00bcc93f690abe0126cebd12479e2b2c5d | 1,568 | py | Python | cirq/optimizers/drop_negligible.py | sleichen/Cirq | 02f715203406d1f2af2d86e7561af09a2cdd4d45 | [
"Apache-2.0"
] | 1 | 2020-05-20T00:08:33.000Z | 2020-05-20T00:08:33.000Z | cirq/optimizers/drop_negligible.py | sleichen/Cirq | 02f715203406d1f2af2d86e7561af09a2cdd4d45 | [
"Apache-2.0"
] | null | null | null | cirq/optimizers/drop_negligible.py | sleichen/Cirq | 02f715203406d1f2af2d86e7561af09a2cdd4d45 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 37.333333 | 78 | 0.714286 |
from typing import TYPE_CHECKING
from cirq import protocols
from cirq.circuits import optimization_pass, circuit as _circuit
if TYPE_CHECKING:
from typing import List, Tuple
from cirq import ops
class DropNegligible(optimization_pass.OptimizationPass):
def __init__(self, tolerance: ... | true | true |
1c463cf1cadf9635379497394d42b7e870640036 | 5,782 | py | Python | egs/wenetspeech/ASR/local/text2token.py | zhu-han/icefall | 9f6c748b3098e3e32c704c27c40ec31f2e9d376c | [
"Apache-2.0"
] | null | null | null | egs/wenetspeech/ASR/local/text2token.py | zhu-han/icefall | 9f6c748b3098e3e32c704c27c40ec31f2e9d376c | [
"Apache-2.0"
] | null | null | null | egs/wenetspeech/ASR/local/text2token.py | zhu-han/icefall | 9f6c748b3098e3e32c704c27c40ec31f2e9d376c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2017 Johns Hopkins University (authors: Shinji Watanabe)
# 2022 Xiaomi Corp. (authors: Mingshuang Luo)
#
# See ../../../../LICENSE for clarification regarding multiple authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you m... | 29.350254 | 78 | 0.5422 |
import argparse
import codecs
import re
import sys
from typing import List
from pypinyin import lazy_pinyin, pinyin
is_python2 = sys.version_info[0] == 2
def exist_or_not(i, match_pos):
start_pos = None
end_pos = None
for pos in match_pos:
if pos[0] <= i < pos[1]:
... | true | true |
1c463d061e46a0550d594d6f027f9723b5d225f9 | 43 | py | Python | streams/rewinder/__init__.py | adrn/streams | 6478d37309ba1dff4e13e8e46b93eafb4ef36431 | [
"MIT"
] | null | null | null | streams/rewinder/__init__.py | adrn/streams | 6478d37309ba1dff4e13e8e46b93eafb4ef36431 | [
"MIT"
] | null | null | null | streams/rewinder/__init__.py | adrn/streams | 6478d37309ba1dff4e13e8e46b93eafb4ef36431 | [
"MIT"
] | null | null | null | from .core import *
from .sampler import *
| 14.333333 | 22 | 0.72093 | from .core import *
from .sampler import *
| true | true |
1c463e35fe5e172b70142ced199c9afc204daeb5 | 662 | py | Python | main.py | wang-h/backend-app-fastapi-sqlite | c155229e7187e381457730a40a9d660c0e98440d | [
"MIT"
] | null | null | null | main.py | wang-h/backend-app-fastapi-sqlite | c155229e7187e381457730a40a9d660c0e98440d | [
"MIT"
] | null | null | null | main.py | wang-h/backend-app-fastapi-sqlite | c155229e7187e381457730a40a9d660c0e98440d | [
"MIT"
] | null | null | null | from fastapi import FastAPI
from starlette.middleware.cors import CORSMiddleware
from app.api.api_v1.api import api_router
from app.core.config import settings
app = FastAPI(
title=settings.PROJECT_NAME,
openapi_url="{}/openapi.json".format(settings.API_V1_STR)
)
# 设置跨域请求允许来源
# Set all CORS enabled origins
... | 26.48 | 68 | 0.712991 | from fastapi import FastAPI
from starlette.middleware.cors import CORSMiddleware
from app.api.api_v1.api import api_router
from app.core.config import settings
app = FastAPI(
title=settings.PROJECT_NAME,
openapi_url="{}/openapi.json".format(settings.API_V1_STR)
)
if settings.BACKEND_CORS_ORIGINS:
app.... | true | true |
1c463e704757405d935040c3c1db9e5051f1a01b | 3,160 | py | Python | src/python/WMCore/WMRuntime/ScriptInvoke.py | vkuznet/WMCore | 001cc51651052405a7ecd811cde91da611b1dc57 | [
"Apache-2.0"
] | 21 | 2015-11-19T16:18:45.000Z | 2021-12-02T18:20:39.000Z | src/python/WMCore/WMRuntime/ScriptInvoke.py | vkuznet/WMCore | 001cc51651052405a7ecd811cde91da611b1dc57 | [
"Apache-2.0"
] | 5,671 | 2015-01-06T14:38:52.000Z | 2022-03-31T22:11:14.000Z | src/python/WMCore/WMRuntime/ScriptInvoke.py | vkuznet/WMCore | 001cc51651052405a7ecd811cde91da611b1dc57 | [
"Apache-2.0"
] | 67 | 2015-01-21T15:55:38.000Z | 2022-02-03T19:53:13.000Z | #!/usr/bin/env python
"""
_ScriptInvoker_
Util to invoke a Runtime Script and provide it with access to the
various bits of the job that it will need to access via the WMTaskSpace
library
This script will be invoked at runtime from the directory & subshell
environment in which the Runtime Script implementation needs ... | 26.115702 | 77 | 0.631013 |
from __future__ import print_function
from builtins import object
import logging
import os
import sys
import traceback
import WMCore.WMRuntime.Bootstrap as Bootstrap
from WMCore.WMRuntime.ScriptFactory import getScript
class ScriptInvoke(object):
def __init__(self, stepModule, scriptModule):
self.ste... | true | true |
1c463f729b93fc1c6c11094196c373a30b659ac2 | 15,805 | py | Python | libs/remote_exec.py | dedwards-tech/fio-tools | 7d328cff9ba3c5e67c3df23ffb064361e64eac06 | [
"BSD-2-Clause"
] | null | null | null | libs/remote_exec.py | dedwards-tech/fio-tools | 7d328cff9ba3c5e67c3df23ffb064361e64eac06 | [
"BSD-2-Clause"
] | null | null | null | libs/remote_exec.py | dedwards-tech/fio-tools | 7d328cff9ba3c5e67c3df23ffb064361e64eac06 | [
"BSD-2-Clause"
] | null | null | null | #! /usr/bin/python
# This is a script to simplify the creation of and use of an SSH connection between
# a proxyvm (Linux) and an ESXi host (SSH shell). It allows for command line execution
# and parsing of output without depending on the use of SSH key exchange.
#
# The parmiko library provides the helpers to proces... | 37.188235 | 186 | 0.624739 |
"""
Utilities for makeing ssh connections to an ESXi host.
"""
import argparse
import paramiko
import yaml
import string
import os, sys
from time import sleep
from time import time
from scp import SCPClient
import threading;
CFG_DEF_TARGET_USER = "root";
CFG_DEF_TARGET_PWD = "pass!Q@W#E";
def Ad... | false | true |
1c4640c71ced2b43dbfbe2cdd9de56a41d3e64a9 | 100,233 | py | Python | superset/views/core.py | Altizon/incubator-superset | e55fe43ca67a29518674a1a2137a3dbd4f166864 | [
"Apache-2.0"
] | null | null | null | superset/views/core.py | Altizon/incubator-superset | e55fe43ca67a29518674a1a2137a3dbd4f166864 | [
"Apache-2.0"
] | 5 | 2021-02-02T22:53:35.000Z | 2022-03-29T22:28:22.000Z | superset/views/core.py | mhassant/apache-superset-multi-tenancy | e55fe43ca67a29518674a1a2137a3dbd4f166864 | [
"Apache-2.0"
] | 2 | 2017-12-20T02:44:05.000Z | 2018-02-09T07:19:49.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 36.382214 | 98 | 0.582992 |
import logging
import re
from contextlib import closing
from datetime import datetime, timedelta
from typing import Any, cast, Dict, List, Optional, Union
from urllib import parse
import backoff
import msgpack
import pandas as pd
import pyarrow as pa
import simplejson as json
from flask import abort, ... | true | true |
1c4641077fa1b4a1700437711e9267173cfd5410 | 160 | py | Python | lights/gridlight_off.py | bprevost/brad_demo | 7c071709f763627d870e2b9e55be332e6af5f4c3 | [
"MIT"
] | null | null | null | lights/gridlight_off.py | bprevost/brad_demo | 7c071709f763627d870e2b9e55be332e6af5f4c3 | [
"MIT"
] | null | null | null | lights/gridlight_off.py | bprevost/brad_demo | 7c071709f763627d870e2b9e55be332e6af5f4c3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import board
import neopixel
NUMPIXELS = 50
pixels = neopixel.NeoPixel(board.D21, NUMPIXELS)
pixels.fill((0, 0, 0)) # Turn off pixels
| 16 | 48 | 0.73125 |
import board
import neopixel
NUMPIXELS = 50
pixels = neopixel.NeoPixel(board.D21, NUMPIXELS)
pixels.fill((0, 0, 0))
| true | true |
1c4641397d7bb7c30bef7cad7ee43801ba62d268 | 2,251 | py | Python | dmgui_au/utilities/find_dropbox.py | Swanson-Hysell-Group/demag_gui_au | d1a233a82ec52dd5907bfee6885668a8c84ae892 | [
"BSD-3-Clause"
] | null | null | null | dmgui_au/utilities/find_dropbox.py | Swanson-Hysell-Group/demag_gui_au | d1a233a82ec52dd5907bfee6885668a8c84ae892 | [
"BSD-3-Clause"
] | null | null | null | dmgui_au/utilities/find_dropbox.py | Swanson-Hysell-Group/demag_gui_au | d1a233a82ec52dd5907bfee6885668a8c84ae892 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import shutil
try:
import json
except:
pass
def find_dropbox():
"""
Attempts to find local Dropbox folder using json file that Dropbox writes to
users' home directory. Will additionally search for `Hargraves_Data` folder
in th... | 34.106061 | 95 | 0.58685 |
import os
import sys
import shutil
try:
import json
except:
pass
def find_dropbox():
if os.path.isfile(os.path.expanduser(os.path.join("~", ".dropbox", "info.json"))):
drpbx_info_file = os.path.expanduser(os.path.join("~", ".dropbox", "info.json"))
drpbx_info = open(drpbx_info_file, 'r'... | true | true |
1c46440c615bf74cb4301b1593107054081dbfd6 | 440 | py | Python | venv/Scripts/easy_install-script.py | TG-Techie/HackUMass0111 | 603344064605979b85a2e142caf7a2a7439d60f5 | [
"MIT"
] | null | null | null | venv/Scripts/easy_install-script.py | TG-Techie/HackUMass0111 | 603344064605979b85a2e142caf7a2a7439d60f5 | [
"MIT"
] | 1 | 2019-10-19T09:24:56.000Z | 2019-10-20T05:37:06.000Z | venv/Scripts/easy_install-script.py | TG-Techie/HackUMass0111 | 603344064605979b85a2e142caf7a2a7439d60f5 | [
"MIT"
] | 1 | 2019-10-18T14:18:28.000Z | 2019-10-18T14:18:28.000Z | #!C:\Users\danhi\hackumass0111\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'setuptools==40.8.0','console_scripts','easy_install'
__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)?$', '... | 33.846154 | 83 | 0.693182 |
__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')()
)
| true | true |
1c464563ae1c020a956ead49bce39b9e88737950 | 223 | py | Python | cannes_accomodation/tests/test_accomodation.py | Xogiga/CPOA_INEC_SAVIGNY_VALADE | f33a9e9448f011bcc56abc0c2270bf0c3d9ae43a | [
"MIT"
] | null | null | null | cannes_accomodation/tests/test_accomodation.py | Xogiga/CPOA_INEC_SAVIGNY_VALADE | f33a9e9448f011bcc56abc0c2270bf0c3d9ae43a | [
"MIT"
] | null | null | null | cannes_accomodation/tests/test_accomodation.py | Xogiga/CPOA_INEC_SAVIGNY_VALADE | f33a9e9448f011bcc56abc0c2270bf0c3d9ae43a | [
"MIT"
] | null | null | null | class TestAccomodation:
def test_list_accomodation(self, client):
response = client.get('/accomodation')
assert response.status_code == 200
def test_update_accomodation(client):
pass
| 27.875 | 47 | 0.672646 | class TestAccomodation:
def test_list_accomodation(self, client):
response = client.get('/accomodation')
assert response.status_code == 200
def test_update_accomodation(client):
pass
| true | true |
1c4645726b27358a00869176f220b50c08f8f957 | 7,264 | py | Python | client/log.py | diophung/pyre-check | a488698d86b06b550c0e6e133009c1f396925af2 | [
"MIT"
] | null | null | null | client/log.py | diophung/pyre-check | a488698d86b06b550c0e6e133009c1f396925af2 | [
"MIT"
] | null | null | null | client/log.py | diophung/pyre-check | a488698d86b06b550c0e6e133009c1f396925af2 | [
"MIT"
] | null | null | null | # Copyright (c) 2016-present, Facebook, Inc.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import copy
import io
import logging
import os
import re
import sys
import threading
import time
from typing import List # noqa
LOG = logging.get... | 27.938462 | 87 | 0.58549 |
import copy
import io
import logging
import os
import re
import sys
import threading
import time
from typing import List
LOG = logging.getLogger(__name__)
PERFORMANCE = 15
PROMPT = 50
SUCCESS = 60
stdout = io.StringIO()
class Color:
YELLOW = "\033[33m"
RED = "\033[31m"
class Format:
BOLD = "\... | true | true |
1c4645c2167dbdc5384e8afc9db3098d68ffbf3f | 3,666 | py | Python | scripts/launch_test.py | amarildolikmeta/oac-explore | e3d63992a4ff33c8df593941f498457e94f81eb8 | [
"MIT"
] | null | null | null | scripts/launch_test.py | amarildolikmeta/oac-explore | e3d63992a4ff33c8df593941f498457e94f81eb8 | [
"MIT"
] | null | null | null | scripts/launch_test.py | amarildolikmeta/oac-explore | e3d63992a4ff33c8df593941f498457e94f81eb8 | [
"MIT"
] | 1 | 2021-12-13T15:38:41.000Z | 2021-12-13T15:38:41.000Z | import json
import sys
sys.path.append("../")
from trainer.particle_trainer import ParticleTrainer
from trainer.gaussian_trainer import GaussianTrainer
from trainer.trainer import SACTrainer
import numpy as np
import torch
from main import env_producer, get_policy_producer, get_q_producer
from utils.pythonplusplus impo... | 30.04918 | 95 | 0.678396 | import json
import sys
sys.path.append("../")
from trainer.particle_trainer import ParticleTrainer
from trainer.gaussian_trainer import GaussianTrainer
from trainer.trainer import SACTrainer
import numpy as np
import torch
from main import env_producer, get_policy_producer, get_q_producer
from utils.pythonplusplus impo... | true | true |
1c464629dbe7ff667eaf19f42c16ee577f2ed4fd | 1,277 | py | Python | Echoo/echoo.py | UsedToBe97/Echoo | b08069170bf470415b9fd91fcb943214b69805b8 | [
"MIT"
] | null | null | null | Echoo/echoo.py | UsedToBe97/Echoo | b08069170bf470415b9fd91fcb943214b69805b8 | [
"MIT"
] | null | null | null | Echoo/echoo.py | UsedToBe97/Echoo | b08069170bf470415b9fd91fcb943214b69805b8 | [
"MIT"
] | null | null | null | # import logging
# logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
# level=logging.INFO)
import os
import argparse
import telegram
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters
def main(token, chat_id, msg):
bot = telegram.Bot(to... | 30.404762 | 101 | 0.648395 |
import os
import argparse
import telegram
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters
def main(token, chat_id, msg):
bot = telegram.Bot(token=token)
bot.send_message(chat_id=chat_id, text=msg)
def run():
parser = argparse.ArgumentParser(description=r'''Echoo:: A tool l... | true | true |
1c464866312c86c67ec166f6a47982af30b5e1bc | 9,752 | py | Python | src/v5.1/resources/swagger_client/models/tpdm_teacher_candidate_academic_record_reference.py | xmarcosx/edfi-notebook | 0564ebdf1d0f45a9d25056e7e61369f0a837534d | [
"Apache-2.0"
] | 2 | 2021-04-27T17:18:17.000Z | 2021-04-27T19:14:39.000Z | src/v5.1/resources/swagger_client/models/tpdm_teacher_candidate_academic_record_reference.py | xmarcosx/edfi-notebook | 0564ebdf1d0f45a9d25056e7e61369f0a837534d | [
"Apache-2.0"
] | null | null | null | src/v5.1/resources/swagger_client/models/tpdm_teacher_candidate_academic_record_reference.py | xmarcosx/edfi-notebook | 0564ebdf1d0f45a9d25056e7e61369f0a837534d | [
"Apache-2.0"
] | 1 | 2022-01-06T09:43:11.000Z | 2022-01-06T09:43:11.000Z | # coding: utf-8
"""
Ed-Fi Operational Data Store API
The Ed-Fi ODS / API enables applications to read and write education data stored in an Ed-Fi ODS through a secure REST interface. *** > *Note: Consumers of ODS / API information should sanitize all data for display and storage. The ODS / API provides reas... | 39.642276 | 482 | 0.675759 |
import pprint
import re
import six
from swagger_client.configuration import Configuration
class TpdmTeacherCandidateAcademicRecordReference(object):
swagger_types = {
'education_organization_id': 'int',
'school_year': 'int',
'teacher_candidate_identifier': 'str',
'term_des... | true | true |
1c464912ecb97ea85dc0a43a1776142eb3f9360b | 1,613 | py | Python | sip/examples/flask_processing_controller/app/api/subarray_list.py | SKA-ScienceDataProcessor/integration-prototype | 5875dc0489f707232534ce75daf3707f909bcd15 | [
"BSD-3-Clause"
] | 3 | 2016-11-08T02:27:05.000Z | 2018-01-22T13:26:11.000Z | sip/examples/flask_processing_controller/app/api/subarray_list.py | SKA-ScienceDataProcessor/integration-prototype | 5875dc0489f707232534ce75daf3707f909bcd15 | [
"BSD-3-Clause"
] | 87 | 2016-11-24T11:09:01.000Z | 2021-03-25T22:23:59.000Z | sip/examples/flask_processing_controller/app/api/subarray_list.py | SKA-ScienceDataProcessor/integration-prototype | 5875dc0489f707232534ce75daf3707f909bcd15 | [
"BSD-3-Clause"
] | 10 | 2016-05-18T09:41:36.000Z | 2019-07-04T10:19:24.000Z | # -*- coding: utf-8 -*-
"""Sub array route"""
import logging
from flask import Blueprint, request
from flask_api import status
from .utils import get_root_url, missing_db_response
from config_db import SchedulingBlockDbClient
BP = Blueprint('subarray_list:', __name__)
DB = SchedulingBlockDbClient()
LOG = logging.get... | 27.810345 | 63 | 0.67018 |
import logging
from flask import Blueprint, request
from flask_api import status
from .utils import get_root_url, missing_db_response
from config_db import SchedulingBlockDbClient
BP = Blueprint('subarray_list:', __name__)
DB = SchedulingBlockDbClient()
LOG = logging.getLogger('SIP.EC.PCI')
@BP.route('/subarrays'... | true | true |
1c46491789a2b206ec7a467f93eaa6eeb029b3c1 | 4,899 | py | Python | train_face_recognition.py | JustinWingChungHui/okkindred_facial_recognition | e6744e604d0bf25f9024a2ef2ba7ca9d0760c8b1 | [
"MIT"
] | null | null | null | train_face_recognition.py | JustinWingChungHui/okkindred_facial_recognition | e6744e604d0bf25f9024a2ef2ba7ca9d0760c8b1 | [
"MIT"
] | 5 | 2019-10-21T20:33:13.000Z | 2022-03-12T00:00:19.000Z | train_face_recognition.py | JustinWingChungHui/okkindred_facial_recognition | e6744e604d0bf25f9024a2ef2ba7ca9d0760c8b1 | [
"MIT"
] | null | null | null | # https://github.com/ageitgey/face_recognition/blob/master/examples/face_recognition_knn.py
import math
import os
import pickle
from PIL import Image as PilImage
from sklearn import neighbors
from models import Person, Image, Tag, FaceModel
from secrets import TRAIN_FACE_RECOGNITION_TEMP_DIR
from file_downloader impor... | 31.203822 | 116 | 0.633395 |
import math
import os
import pickle
from PIL import Image as PilImage
from sklearn import neighbors
from models import Person, Image, Tag, FaceModel
from secrets import TRAIN_FACE_RECOGNITION_TEMP_DIR
from file_downloader import download_file, clear_directory
import face_recognition
def get_file_for_tag(tag, image,... | true | true |
1c4649bc75a615ae3b5e27abb7216ac014db4166 | 36,743 | py | Python | sklearn_extensions/model_selection/_search.py | ruppinlab/tcga-microbiome-prediction | e7923b94738f9bd1b7862bb109002554430d9ace | [
"BSD-3-Clause"
] | 3 | 2022-01-11T08:40:37.000Z | 2022-01-28T08:00:39.000Z | sklearn_extensions/model_selection/_search.py | ruppinlab/tcga-microbiome-prediction | e7923b94738f9bd1b7862bb109002554430d9ace | [
"BSD-3-Clause"
] | null | null | null | sklearn_extensions/model_selection/_search.py | ruppinlab/tcga-microbiome-prediction | e7923b94738f9bd1b7862bb109002554430d9ace | [
"BSD-3-Clause"
] | 1 | 2022-01-11T08:44:08.000Z | 2022-01-11T08:44:08.000Z | """
The :mod:`sklearn_extesions.model_selection._search` includes utilities to
fine-tune the parameters of an estimator.
"""
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>,
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Andreas Mueller <amueller@ais.uni-bonn.de>
# Olivier Grisel... | 42.924065 | 82 | 0.590398 |
from abc import abstractmethod
from collections import defaultdict
from collections.abc import Sequence
from functools import partial
from itertools import product
import numbers
import time
import warnings
import numpy as np
from joblib import Parallel, delayed
from scipy.stats import rankdata
from sklearn.... | true | true |
1c464a27e4586e149240c4356a12128973601b60 | 6,714 | py | Python | fw_neopixel_pride.py | tammymakesthings/fw_neopixel_pride | 3d8df503f7161a23b11d9298c62d45b2e6c17d60 | [
"MIT"
] | 2 | 2019-06-09T19:19:34.000Z | 2021-06-02T20:40:21.000Z | fw_neopixel_pride.py | tammymakesthings/fw_neopixel_pride | 3d8df503f7161a23b11d9298c62d45b2e6c17d60 | [
"MIT"
] | null | null | null | fw_neopixel_pride.py | tammymakesthings/fw_neopixel_pride | 3d8df503f7161a23b11d9298c62d45b2e6c17d60 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Pride Flag NetPixel Badge
Displays a bunch of different Pride flags on a NeoPixel grid. Designed for use
with the Adafruit Feather M0 Express and NeoPixel FeatherWing.
Full details at <http://github.com/tammymakesthings/cpy_neopixel_pride>
@author: tammy.cravit
@license: MIT
"""
import s... | 34.608247 | 99 | 0.566279 |
import sys
from time import sleep
ANIMATION_SPEED = 0.3
SHOW_PATTERN_DELAY = 15
PATTERN_INTENSITY = 0.3
NUM_ROWS = 4
NUM_COLS = 8
neopixel_pin = None
pixels = None
if sys.implementation.name == "circuitpython":
import time
import board
import neopixel
# Control pin defaults to #6... | true | true |
1c464c7f4975739b483955b49e931f3e73459cb0 | 966 | py | Python | pietoolbelt/augmentations/segmentation.py | kitkat52/pietoolbelt | 0e0b5859662fcb43b008218746cc3e76cc66b6b8 | [
"MIT"
] | 1 | 2021-05-30T08:21:12.000Z | 2021-05-30T08:21:12.000Z | pietoolbelt/augmentations/segmentation.py | kitkat52/pietoolbelt | 0e0b5859662fcb43b008218746cc3e76cc66b6b8 | [
"MIT"
] | 7 | 2020-07-07T21:04:08.000Z | 2021-12-13T10:08:17.000Z | pietoolbelt/augmentations/segmentation.py | kitkat52/pietoolbelt | 0e0b5859662fcb43b008218746cc3e76cc66b6b8 | [
"MIT"
] | 1 | 2021-06-17T09:21:39.000Z | 2021-06-17T09:21:39.000Z | import numpy as np
import torch
from .common import BaseAugmentations
__all__ = ['SegmentationAugmentations']
class SegmentationAugmentations(BaseAugmentations):
def __init__(self, is_train: bool, to_pytorch: bool, preprocess: callable):
super().__init__(is_train, to_pytorch, preprocess)
def augmen... | 33.310345 | 111 | 0.68323 | import numpy as np
import torch
from .common import BaseAugmentations
__all__ = ['SegmentationAugmentations']
class SegmentationAugmentations(BaseAugmentations):
def __init__(self, is_train: bool, to_pytorch: bool, preprocess: callable):
super().__init__(is_train, to_pytorch, preprocess)
def augmen... | true | true |
1c464c918d295b7c3a348cdb1a566cf0a3e06af7 | 5,165 | py | Python | starfish/core/experiment/builder/test/factories/all_purpose.py | kne42/starfish | 78b348c9756f367221dcca725cfa5107e5520b33 | [
"MIT"
] | null | null | null | starfish/core/experiment/builder/test/factories/all_purpose.py | kne42/starfish | 78b348c9756f367221dcca725cfa5107e5520b33 | [
"MIT"
] | null | null | null | starfish/core/experiment/builder/test/factories/all_purpose.py | kne42/starfish | 78b348c9756f367221dcca725cfa5107e5520b33 | [
"MIT"
] | null | null | null | from abc import ABCMeta
from typing import Callable, cast, Collection, Mapping, Sequence, Type, Union
import numpy as np
import slicedimage
from starfish.core.experiment.builder import (
build_irregular_image,
FetchedTile,
tile_fetcher_factory,
TileFetcher,
TileIdentifier,
)
from starfish.core.typ... | 39.128788 | 100 | 0.684802 | from abc import ABCMeta
from typing import Callable, cast, Collection, Mapping, Sequence, Type, Union
import numpy as np
import slicedimage
from starfish.core.experiment.builder import (
build_irregular_image,
FetchedTile,
tile_fetcher_factory,
TileFetcher,
TileIdentifier,
)
from starfish.core.typ... | true | true |
1c464cd9a94ce016f5a29a3b4da763617bf225a8 | 75,458 | py | Python | simulator/config_pb2.py | googleinterns/cluster-resource-forecast | 48b67346160e4f9c010552b9b20b8bace1a321ad | [
"Apache-2.0"
] | 25 | 2020-05-06T21:29:04.000Z | 2022-02-17T05:25:25.000Z | simulator/config_pb2.py | touchuyht/cluster-resource-forecast | 48b67346160e4f9c010552b9b20b8bace1a321ad | [
"Apache-2.0"
] | 3 | 2020-06-09T04:14:08.000Z | 2021-04-25T07:30:38.000Z | simulator/config_pb2.py | touchuyht/cluster-resource-forecast | 48b67346160e4f9c010552b9b20b8bace1a321ad | [
"Apache-2.0"
] | 12 | 2020-06-05T00:52:01.000Z | 2021-12-17T06:55:30.000Z | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: simulator/config.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from googl... | 33.686607 | 4,812 | 0.620279 |
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor.FileDescriptor(
name="simul... | true | true |
1c464d12c804104184ab9202416708560155519f | 1,270 | py | Python | packages/pyre/weaver/MixedComments.py | PyreFramework/pyre | 345c7449a3416eea1c1affa74fb32faff30a6aaa | [
"BSD-3-Clause"
] | null | null | null | packages/pyre/weaver/MixedComments.py | PyreFramework/pyre | 345c7449a3416eea1c1affa74fb32faff30a6aaa | [
"BSD-3-Clause"
] | null | null | null | packages/pyre/weaver/MixedComments.py | PyreFramework/pyre | 345c7449a3416eea1c1affa74fb32faff30a6aaa | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# michael a.g. aïvázis
# orthologue
# (c) 1998-2022 all rights reserved
#
class MixedComments:
"""
The mixed commenting strategy: both a block marker pair and an individual line marker
"""
# implemented interface
def commentBlock(self, lines):
"""
Create... | 22.678571 | 89 | 0.568504 |
class MixedComments:
def commentBlock(self, lines):
leader = self.leader + self.commentMarker
yield self.leader + self.startBlock
for line in lines:
yield leader + ' ' + line
yield self.leader + ' ' + self.st... | true | true |
1c464e80baae8523873eba7c28b31180433a9491 | 244 | py | Python | accounts/templatetags/account_tags.py | GadirMirzayev/Django-E-commerce | 0ca289fdf584b29636a8fc9416319defad0be5a5 | [
"MIT"
] | 1 | 2021-08-20T07:44:39.000Z | 2021-08-20T07:44:39.000Z | accounts/templatetags/account_tags.py | GadirMirzayev/Django-E-commerce | 0ca289fdf584b29636a8fc9416319defad0be5a5 | [
"MIT"
] | null | null | null | accounts/templatetags/account_tags.py | GadirMirzayev/Django-E-commerce | 0ca289fdf584b29636a8fc9416319defad0be5a5 | [
"MIT"
] | null | null | null | from django.template import Library
from accounts.forms import LoginForm, RegistrationForm
register = Library()
@register.simple_tag
def get_login():
return LoginForm
@register.simple_tag
def get_register():
return RegistrationForm | 17.428571 | 54 | 0.795082 | from django.template import Library
from accounts.forms import LoginForm, RegistrationForm
register = Library()
@register.simple_tag
def get_login():
return LoginForm
@register.simple_tag
def get_register():
return RegistrationForm | true | true |
1c464ec8780d8f5ce3fb571d62ddf71de207f74c | 2,383 | py | Python | app/words.py | anbasile/mwe | 2a56b889c7c7f28aa479e477f8e52da7501c2691 | [
"Apache-2.0"
] | null | null | null | app/words.py | anbasile/mwe | 2a56b889c7c7f28aa479e477f8e52da7501c2691 | [
"Apache-2.0"
] | 2 | 2016-08-31T16:21:31.000Z | 2016-09-10T21:50:12.000Z | app/words.py | anbasile/mwe | 2a56b889c7c7f28aa479e477f8e52da7501c2691 | [
"Apache-2.0"
] | null | null | null | import requests
from bs4 import BeautifulSoup
from collections import defaultdict
import pandas as pd
import json
import networkx as nx
from networkx.readwrite import json_graph
import numpy as np
from lightning import Lightning
from colorsys import hsv_to_rgb
from sklearn import datasets
lgn = Lightning(host='http://p... | 35.567164 | 113 | 0.578682 | import requests
from bs4 import BeautifulSoup
from collections import defaultdict
import pandas as pd
import json
import networkx as nx
from networkx.readwrite import json_graph
import numpy as np
from lightning import Lightning
from colorsys import hsv_to_rgb
from sklearn import datasets
lgn = Lightning(host='http://p... | true | true |
1c464fea142c0d5443ee2c8f9823dac623cc81f2 | 10,404 | py | Python | gui/kivy/uix/dialogs/settings.py | lionzeye/reddelectrum | e39497aee08b08bed89efa10072d17fb1e37920c | [
"MIT"
] | null | null | null | gui/kivy/uix/dialogs/settings.py | lionzeye/reddelectrum | e39497aee08b08bed89efa10072d17fb1e37920c | [
"MIT"
] | null | null | null | gui/kivy/uix/dialogs/settings.py | lionzeye/reddelectrum | e39497aee08b08bed89efa10072d17fb1e37920c | [
"MIT"
] | null | null | null | from kivy.app import App
from kivy.factory import Factory
from kivy.properties import ObjectProperty
from kivy.lang import Builder
from reddelectrum.util import base_units
from reddelectrum.i18n import languages
from reddelectrum_gui.kivy.i18n import _
from reddelectrum.plugins import run_hook
from reddelectrum import... | 43.714286 | 157 | 0.569685 | from kivy.app import App
from kivy.factory import Factory
from kivy.properties import ObjectProperty
from kivy.lang import Builder
from reddelectrum.util import base_units
from reddelectrum.i18n import languages
from reddelectrum_gui.kivy.i18n import _
from reddelectrum.plugins import run_hook
from reddelectrum import... | true | true |
1c46504895e0e2d1fa84256a4ac14e48db7125f9 | 19,813 | py | Python | Lib/site-packages/pygments/lexers/html.py | edupyter/EDUPYTER38 | 396183cea72987506f1ef647c0272a2577c56218 | [
"bzip2-1.0.6"
] | 1 | 2021-12-14T21:23:25.000Z | 2021-12-14T21:23:25.000Z | Lib/site-packages/pygments/lexers/html.py | edupyter/EDUPYTER38 | 396183cea72987506f1ef647c0272a2577c56218 | [
"bzip2-1.0.6"
] | 1,242 | 2019-08-31T16:03:19.000Z | 2019-08-31T18:00:46.000Z | Lib/site-packages/pygments/lexers/html.py | edupyter/EDUPYTER38 | 396183cea72987506f1ef647c0272a2577c56218 | [
"bzip2-1.0.6"
] | 1 | 2019-10-04T01:56:03.000Z | 2019-10-04T01:56:03.000Z | """
pygments.lexers.html
~~~~~~~~~~~~~~~~~~~~
Lexers for HTML, XML and related markup.
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, ExtendedRegexLexer, include, bygroups, \
defa... | 32.74876 | 83 | 0.4225 |
import re
from pygments.lexer import RegexLexer, ExtendedRegexLexer, include, bygroups, \
default, using
from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
Punctuation
from pygments.util import looks_like_xml, html_doctype_matches
from pygments.lexers.javascript import JavascriptLex... | true | true |
1c46543448022df5270116046c61a0e794fe676d | 5,784 | py | Python | shakenfist/daemons/resources.py | fidoandfido/shakenfist | 18612b27649310fb2d6ea1b32dce89640e8c857d | [
"Apache-2.0"
] | null | null | null | shakenfist/daemons/resources.py | fidoandfido/shakenfist | 18612b27649310fb2d6ea1b32dce89640e8c857d | [
"Apache-2.0"
] | null | null | null | shakenfist/daemons/resources.py | fidoandfido/shakenfist | 18612b27649310fb2d6ea1b32dce89640e8c857d | [
"Apache-2.0"
] | null | null | null | import os
import psutil
import time
from prometheus_client import Gauge
from prometheus_client import start_http_server
from shakenfist.daemons import daemon
from shakenfist import config
from shakenfist import db
from shakenfist import logutil
from shakenfist import util
LOG, _ = logutil.setup(__name__)
def _get... | 31.434783 | 93 | 0.616355 | import os
import psutil
import time
from prometheus_client import Gauge
from prometheus_client import start_http_server
from shakenfist.daemons import daemon
from shakenfist import config
from shakenfist import db
from shakenfist import logutil
from shakenfist import util
LOG, _ = logutil.setup(__name__)
def _get... | true | true |
1c465512236dd5e487d4620bb11fe1ccf6b857ef | 631 | py | Python | pysoup/logger/__init__.py | illBeRoy/pysoup | 742fd6630e1be27c275cb8dc6ee94412472cb20b | [
"MIT"
] | 4 | 2016-02-21T12:40:44.000Z | 2019-06-13T13:23:19.000Z | pysoup/logger/__init__.py | illBeRoy/pysoup | 742fd6630e1be27c275cb8dc6ee94412472cb20b | [
"MIT"
] | null | null | null | pysoup/logger/__init__.py | illBeRoy/pysoup | 742fd6630e1be27c275cb8dc6ee94412472cb20b | [
"MIT"
] | 1 | 2020-07-16T12:22:12.000Z | 2020-07-16T12:22:12.000Z | import os.path
import pysoup.utils.assets
class Logger(object):
def __init__(self, cwd):
self._log = ''
self._cwd = cwd
def log(self, text):
self._log += '{0}\n'.format(text)
def log_dependency_results(self, failed_dependencies):
for dependency in failed_dependencies:
... | 27.434783 | 68 | 0.59588 | import os.path
import pysoup.utils.assets
class Logger(object):
def __init__(self, cwd):
self._log = ''
self._cwd = cwd
def log(self, text):
self._log += '{0}\n'.format(text)
def log_dependency_results(self, failed_dependencies):
for dependency in failed_dependencies:
... | true | true |
1c4655f9e7e6644dbd5ab06a55417c8f38cfdb63 | 18,981 | py | Python | mindmeld/models/text_models.py | ritvikshrivastava/mindmeld | 48eccac059439ea0f32fa3ac9079415bb006233b | [
"Apache-2.0"
] | 580 | 2019-03-24T20:59:09.000Z | 2022-03-23T17:06:43.000Z | mindmeld/models/text_models.py | ritvikshrivastava/mindmeld | 48eccac059439ea0f32fa3ac9079415bb006233b | [
"Apache-2.0"
] | 199 | 2019-04-30T18:15:46.000Z | 2022-03-22T17:11:33.000Z | mindmeld/models/text_models.py | ritvikshrivastava/mindmeld | 48eccac059439ea0f32fa3ac9079415bb006233b | [
"Apache-2.0"
] | 164 | 2019-04-25T08:27:28.000Z | 2022-03-23T12:44:33.000Z | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015 Cisco Systems, Inc. and others. 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... | 37 | 97 | 0.61393 |
import logging
import operator
import os
import random
import numpy as np
from sklearn.ensemble import RandomForestClassifier
from sklearn.externals import joblib
from sklearn.feature_extraction import DictVectorizer
from sklearn.feature_selection import SelectFromModel, SelectPercentile
from sklearn.line... | true | true |
1c465740ae5fe9f566269cf6b2d71d8bc9882dcb | 28,276 | py | Python | Core/Python/invoke_refresh_inventory.py | prasadrao-dell/OpenManage-Enterprise | f9bd0e821701902d6571a54663a7c9ef4f2308b3 | [
"Apache-2.0"
] | 1 | 2020-07-18T13:05:48.000Z | 2020-07-18T13:05:48.000Z | Core/Python/invoke_refresh_inventory.py | prasadrao-dell/OpenManage-Enterprise | f9bd0e821701902d6571a54663a7c9ef4f2308b3 | [
"Apache-2.0"
] | 11 | 2020-07-22T07:33:14.000Z | 2020-08-20T12:01:55.000Z | Core/Python/invoke_refresh_inventory.py | prasadrao-dell/OpenManage-Enterprise | f9bd0e821701902d6571a54663a7c9ef4f2308b3 | [
"Apache-2.0"
] | 4 | 2020-06-03T11:38:34.000Z | 2020-08-11T10:38:57.000Z | #
# _author_ = Grant Curell <grant_curell@dell.com>
#
# Copyright (c) 2020 Dell EMC Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE... | 44.599369 | 120 | 0.609245 |
import argparse
import json
import sys
import time
from argparse import RawTextHelpFormatter
from pprint import pprint
from urllib.parse import urlparse
from getpass import getpass
try:
import urllib3
import requests
except ModuleNotFoundError:
print("This program requires urllib3 and re... | true | true |
1c465889a1c778474e5db6bd5a5c7d2042d61766 | 2,091 | py | Python | source-py/pyBKT/test/hand_specified_model.py | bukeplato/pyBKT | 733a4ccf0de78bef7d47b5a6af7131c7778560db | [
"MIT"
] | 132 | 2018-03-22T06:04:14.000Z | 2022-03-24T21:54:27.000Z | source-py/pyBKT/test/hand_specified_model.py | bukeplato/pyBKT | 733a4ccf0de78bef7d47b5a6af7131c7778560db | [
"MIT"
] | 25 | 2018-01-10T14:00:48.000Z | 2022-03-22T04:00:47.000Z | source-py/pyBKT/test/hand_specified_model.py | bukeplato/pyBKT | 733a4ccf0de78bef7d47b5a6af7131c7778560db | [
"MIT"
] | 46 | 2017-09-12T04:30:58.000Z | 2022-03-10T08:54:52.000Z | import numpy as np
from pyBKT.generate import synthetic_data
from pyBKT.generate import random_model, random_model_uni
from pyBKT.fit import EM_fit
from copy import deepcopy
from pyBKT.util import print_dot
#parameters
num_subparts = 4
num_resources = 2
num_fit_initializations = 25
observation_sequence_lengths = np.fu... | 31.681818 | 111 | 0.724055 | import numpy as np
from pyBKT.generate import synthetic_data
from pyBKT.generate import random_model, random_model_uni
from pyBKT.fit import EM_fit
from copy import deepcopy
from pyBKT.util import print_dot
num_subparts = 4
num_resources = 2
num_fit_initializations = 25
observation_sequence_lengths = np.full(50, 100,... | true | true |
1c4658b4bb64b7f6ea6eb1dbc078b2ce403e3327 | 369 | py | Python | Problem124.py | Cleancode404/ProjectEuler | 2f93b256b107bfb6a395b8aa197cfeacc599b00b | [
"MIT"
] | null | null | null | Problem124.py | Cleancode404/ProjectEuler | 2f93b256b107bfb6a395b8aa197cfeacc599b00b | [
"MIT"
] | null | null | null | Problem124.py | Cleancode404/ProjectEuler | 2f93b256b107bfb6a395b8aa197cfeacc599b00b | [
"MIT"
] | null | null | null | """
Ordered radicals
"""
def compute(x):
limit = 100000
rads = [0] + [1]* limit
for i in range(2, len(rads)):
if rads[i] == 1:
for j in range(i, len(rads), i):
rads[j] *= i
data = sorted((rads, i) for (i, rad) in enumerate(rads))
return str(data[1000][1])
if... | 18.45 | 60 | 0.517615 |
def compute(x):
limit = 100000
rads = [0] + [1]* limit
for i in range(2, len(rads)):
if rads[i] == 1:
for j in range(i, len(rads), i):
rads[j] *= i
data = sorted((rads, i) for (i, rad) in enumerate(rads))
return str(data[1000][1])
if __name__ =="__main__":
... | true | true |
1c4659f51ad3a120a0b93c0284ea7b59b39d919d | 537 | py | Python | setup.py | sw5cc/tencent-finance | 08da6a75904055a6113a01c86377b613cbe07033 | [
"MIT"
] | null | null | null | setup.py | sw5cc/tencent-finance | 08da6a75904055a6113a01c86377b613cbe07033 | [
"MIT"
] | null | null | null | setup.py | sw5cc/tencent-finance | 08da6a75904055a6113a01c86377b613cbe07033 | [
"MIT"
] | null | null | null | from setuptools import setup
VERSION = '1.0.0'
REPO = 'https://github.com/sw5cc/tencent-finance'
setup(
name='tencent-finance',
py_modules=['tencent_finance'],
version=VERSION,
description='Python library that provides APIs to query finance from http://stock.qq.com',
author='sw5cc',
author_ema... | 28.263158 | 94 | 0.683426 | from setuptools import setup
VERSION = '1.0.0'
REPO = 'https://github.com/sw5cc/tencent-finance'
setup(
name='tencent-finance',
py_modules=['tencent_finance'],
version=VERSION,
description='Python library that provides APIs to query finance from http://stock.qq.com',
author='sw5cc',
author_ema... | true | true |
1c465c0941cce89c8fc109d641fe9e2f109a55e6 | 1,071 | py | Python | python/time_test.py | ysoftman/test_code | 4c71cc7c6a17d73cc84298e3a44051d3ab9d40f8 | [
"MIT"
] | 3 | 2017-12-07T04:29:36.000Z | 2022-01-11T10:58:14.000Z | python/time_test.py | ysoftman/test_code | 4c71cc7c6a17d73cc84298e3a44051d3ab9d40f8 | [
"MIT"
] | 14 | 2018-07-17T05:16:42.000Z | 2022-03-22T00:43:47.000Z | python/time_test.py | ysoftman/test_code | 4c71cc7c6a17d73cc84298e3a44051d3ab9d40f8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# author: ysoftman
# python version : 3.x
# desc : time test
import time
import datetime
if __name__ == '__main__':
# epoch time
print(time.time())
# suspend for 1 sec
time.sleep(1)
# 프로세스 시간(초)
start = time.clock()
# 현재 시간을 struct_time 형식으로 리턴
print(time.lo... | 21.42 | 51 | 0.582633 |
import time
import datetime
if __name__ == '__main__':
print(time.time())
time.sleep(1)
start = time.clock()
print(time.localtime())
print(time.localtime().tm_year)
print(time.localtime().tm_mon)
print(time.localtime().tm_mday)
print(time.localtime().tm_hour... | true | true |
1c465c6a86486509dd27a24054b97bb891f2c729 | 1,867 | py | Python | tests/components/folder/test_sensor.py | twrecked/core | d3ae8a938cdea9b6e0d443c91c37ac3dbbd459ab | [
"Apache-2.0"
] | 7 | 2019-02-07T14:14:12.000Z | 2019-07-28T06:56:10.000Z | tests/components/folder/test_sensor.py | twrecked/core | d3ae8a938cdea9b6e0d443c91c37ac3dbbd459ab | [
"Apache-2.0"
] | 6 | 2021-02-08T20:54:31.000Z | 2022-03-12T00:50:43.000Z | tests/components/folder/test_sensor.py | klauern/home-assistant-core | c18ba6aec0627e6afb6442c678edb5ff2bb17db6 | [
"Apache-2.0"
] | 2 | 2020-04-19T13:35:24.000Z | 2020-04-19T13:35:51.000Z | """The tests for the folder sensor."""
import os
import unittest
from homeassistant.components.folder.sensor import CONF_FOLDER_PATHS
from homeassistant.setup import setup_component
from tests.common import get_test_home_assistant
CWD = os.path.join(os.path.dirname(__file__))
TEST_FOLDER = "test_folder"
TEST_DIR = o... | 33.945455 | 86 | 0.666845 | import os
import unittest
from homeassistant.components.folder.sensor import CONF_FOLDER_PATHS
from homeassistant.setup import setup_component
from tests.common import get_test_home_assistant
CWD = os.path.join(os.path.dirname(__file__))
TEST_FOLDER = "test_folder"
TEST_DIR = os.path.join(CWD, TEST_FOLDER)
TEST_TXT ... | true | true |
1c465d2bf7cc3b2557d4537d22985e65be65189e | 6,600 | py | Python | utils/models/mobilenet_v2.py | voldemortX/DeeplabV3_PyTorch1.3_Codebase | d22d23e74800fafb58eeb61d6649008745c1a287 | [
"BSD-3-Clause"
] | 1 | 2020-09-17T06:21:39.000Z | 2020-09-17T06:21:39.000Z | utils/models/mobilenet_v2.py | voldemortX/pytorch-segmentation | 9c62c0a721d11c8ea6bf312ecf1c7b238a54dcda | [
"BSD-3-Clause"
] | null | null | null | utils/models/mobilenet_v2.py | voldemortX/pytorch-segmentation | 9c62c0a721d11c8ea6bf312ecf1c7b238a54dcda | [
"BSD-3-Clause"
] | null | null | null | # Modified from mmsegmentation code, referenced from torchvision
import torch.nn as nn
from .builder import MODELS
from ._utils import make_divisible
from .common_models import InvertedResidual
from .utils import load_state_dict_from_url
@MODELS.register()
class MobileNetV2Encoder(nn.Module):
"""MobileNetV2 back... | 42.038217 | 116 | 0.594697 |
import torch.nn as nn
from .builder import MODELS
from ._utils import make_divisible
from .common_models import InvertedResidual
from .utils import load_state_dict_from_url
@MODELS.register()
class MobileNetV2Encoder(nn.Module):
arch_settings = [[1, 16, 1], [6, 24, 2], [6, 32, 3], [6, 64, 4],
... | true | true |
1c465d43539d78553af3d947b0be4daa8319c479 | 20,345 | py | Python | tests/python/unittest/test_higher_order_grad.py | HaoLiuHust/incubator-mxnet | 0deb50b33f29a19bbe4bdc6ff14658afc5000d50 | [
"Apache-2.0"
] | 1 | 2019-02-22T13:53:48.000Z | 2019-02-22T13:53:48.000Z | tests/python/unittest/test_higher_order_grad.py | HaoLiuHust/incubator-mxnet | 0deb50b33f29a19bbe4bdc6ff14658afc5000d50 | [
"Apache-2.0"
] | 1 | 2020-08-27T06:39:07.000Z | 2020-08-31T03:29:27.000Z | tests/python/unittest/test_higher_order_grad.py | HaoLiuHust/incubator-mxnet | 0deb50b33f29a19bbe4bdc6ff14658afc5000d50 | [
"Apache-2.0"
] | 1 | 2020-08-14T22:56:19.000Z | 2020-08-14T22:56:19.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... | 28.454545 | 105 | 0.621627 |
import math
import random
from functools import reduce
from operator import mul
import random
from common import with_seed, xfail_when_nonstandard_decimal_separator
import mxnet
from mxnet import nd, autograd, gluon
from mxnet.test_utils import (
assert_almost_equal, random_arrays, random_uniform... | true | true |
1c465dd88414760419bb1ffb6b9b757ef5581d36 | 627 | py | Python | runs/seq-nobro-iter03000.cfg.py | janpawellek/broeval | 57e31aa6e354d0bba88103b44910483e8d982d00 | [
"MIT"
] | null | null | null | runs/seq-nobro-iter03000.cfg.py | janpawellek/broeval | 57e31aa6e354d0bba88103b44910483e8d982d00 | [
"MIT"
] | null | null | null | runs/seq-nobro-iter03000.cfg.py | janpawellek/broeval | 57e31aa6e354d0bba88103b44910483e8d982d00 | [
"MIT"
] | null | null | null |
# Write results to this file
OUTFILE = 'runs/seq-nobro-iter03000.result.csv'
# Source computers for the requests
SOURCE = ['10.0.0.1']
# Should Bro be enabled on the source machines?
SOURCE_BRO = [False]
# Target machines for the requests (aka server)
TARGET = ['10.0.0.2']
# Should Bro be enabled on the target mac... | 21.62069 | 68 | 0.722488 |
OUTFILE = 'runs/seq-nobro-iter03000.result.csv'
SOURCE = ['10.0.0.1']
SOURCE_BRO = [False]
TARGET = ['10.0.0.2']
TARGET_BRO = [False]
MODE = 'seq'
EPOCHS = 100
ITER = 3000
SIZE = 5
| true | true |
1c465eea594f4a857f85aba181b0c6af1aa42352 | 5,672 | py | Python | EvaluateAccuracy.py | sagieppel/Classification-of-the-material-given-region-of-an-image-using-a-convolutional-neural-net-with-attent | 2c78f069d4f4d9be7197b5bff6df39fc239270e4 | [
"MIT"
] | 5 | 2021-01-21T05:04:33.000Z | 2021-12-19T09:49:35.000Z | EvaluateAccuracy.py | sagieppel/Classification-of-the-material-given-region-of-an-image-using-a-convolutional-neural-net-with-attent | 2c78f069d4f4d9be7197b5bff6df39fc239270e4 | [
"MIT"
] | 2 | 2019-11-13T17:35:41.000Z | 2021-06-04T21:40:57.000Z | EvaluateAccuracy.py | sagieppel/Classification-of-the-material-given-region-of-an-image-using-a-convolutional-neural-net-with-attent | 2c78f069d4f4d9be7197b5bff6df39fc239270e4 | [
"MIT"
] | 1 | 2021-12-19T09:49:29.000Z | 2021-12-19T09:49:29.000Z | # Evaluate precision of image classification in a given image region
# Instructions:
# a) Set folder of images in Image_Dir
# c) Set folder for ground truth Annotation in AnnotationDir
# The Label Maps should be saved as png image with same name as the corresponding image and png ending. The value of each pixel corr... | 50.19469 | 199 | 0.542666 | true | true | |
1c465fea1d1ceec23b4315681cacca75310c7202 | 27,098 | py | Python | numpy/core/tests/test_casting_unittests.py | HanumanJat8698/numpy | cbec2c8054ea6150490b9e72eb051848b79344d1 | [
"BSD-3-Clause"
] | 1 | 2022-02-26T03:35:36.000Z | 2022-02-26T03:35:36.000Z | numpy/core/tests/test_casting_unittests.py | HanumanJat8698/numpy | cbec2c8054ea6150490b9e72eb051848b79344d1 | [
"BSD-3-Clause"
] | null | null | null | numpy/core/tests/test_casting_unittests.py | HanumanJat8698/numpy | cbec2c8054ea6150490b9e72eb051848b79344d1 | [
"BSD-3-Clause"
] | null | null | null | """
The tests exercise the casting machinery in a more low-level manner.
The reason is mostly to test a new implementation of the casting machinery.
Unlike most tests in NumPy, these are closer to unit-tests rather
than integration tests.
"""
import pytest
import textwrap
import enum
import itertools
import random
i... | 41.057576 | 84 | 0.565983 |
import pytest
import textwrap
import enum
import itertools
import random
import numpy as np
from numpy.lib.stride_tricks import as_strided
from numpy.testing import assert_array_equal
from numpy.core._multiarray_umath import _get_castingimpl as get_castingimpl
simple_dtypes = "?bhilqBHILQefdFD"
if np.dtype("l").i... | true | true |
1c46600ef51420118bf2adf803f33064109e861f | 2,286 | py | Python | venv/Lib/site-packages/tests/test_310_ClientInfo.py | shehzadulislam/Assignment4 | a9cced70be6ae5d2685027d68032d5849f638301 | [
"Apache-2.0"
] | null | null | null | venv/Lib/site-packages/tests/test_310_ClientInfo.py | shehzadulislam/Assignment4 | a9cced70be6ae5d2685027d68032d5849f638301 | [
"Apache-2.0"
] | null | null | null | venv/Lib/site-packages/tests/test_310_ClientInfo.py | shehzadulislam/Assignment4 | a9cced70be6ae5d2685027d68032d5849f638301 | [
"Apache-2.0"
] | null | null | null | #
# Licensed Materials - Property of IBM
#
# (c) Copyright IBM Corp. 2007-2008
#
import unittest, sys
import ibm_db
import config
from testfunctions import IbmDbTestFunctions
class IbmDbTestCase(unittest.TestCase):
def test_310_ClientInfo(self):
obj = IbmDbTestFunctions()
obj.assert_expectf(self.run_tes... | 30.891892 | 120 | 0.700787 |
import unittest, sys
import ibm_db
import config
from testfunctions import IbmDbTestFunctions
class IbmDbTestCase(unittest.TestCase):
def test_310_ClientInfo(self):
obj = IbmDbTestFunctions()
obj.assert_expectf(self.run_test_310)
def run_test_310(self):
conn = ibm_db.connect(config.database, co... | true | true |
1c4660eee4c36b65b45ca71a3dfd9c51e6edccdc | 1,545 | py | Python | postprocessing.py | BaerkeDestroyer/tiktok-rss-flat | ec96d901b5d40c0563658c469a6308546e78d0e2 | [
"Apache-2.0"
] | null | null | null | postprocessing.py | BaerkeDestroyer/tiktok-rss-flat | ec96d901b5d40c0563658c469a6308546e78d0e2 | [
"Apache-2.0"
] | null | null | null | postprocessing.py | BaerkeDestroyer/tiktok-rss-flat | ec96d901b5d40c0563658c469a6308546e78d0e2 | [
"Apache-2.0"
] | null | null | null | from TikTokApi import TikTokApi
import csv
from feedgen.feed import FeedGenerator
from datetime import datetime, timezone
# Normal GitHub Pages URL
# ghPagesURL = "https://conoro.github.io/tiktok-rss-flat/"
# Custom Domain
ghPagesURL = "https://baerkedestroyer.github.io/tiktok-rss-flat/"
api = TikTokApi.g... | 34.333333 | 85 | 0.579935 | from TikTokApi import TikTokApi
import csv
from feedgen.feed import FeedGenerator
from datetime import datetime, timezone
ghPagesURL = "https://baerkedestroyer.github.io/tiktok-rss-flat/"
api = TikTokApi.get_instance()
count = 10
with open('subscriptions.csv') as f:
cf = csv.DictReader(f, field... | true | true |
1c46616705638a9d0e9b20f08577b7cad14f9b79 | 459 | py | Python | config.example.py | entuland/fogibot | e3afe14d53fe9d47178161d9311301c47c960507 | [
"MIT"
] | null | null | null | config.example.py | entuland/fogibot | e3afe14d53fe9d47178161d9311301c47c960507 | [
"MIT"
] | null | null | null | config.example.py | entuland/fogibot | e3afe14d53fe9d47178161d9311301c47c960507 | [
"MIT"
] | null | null | null | host = "chat.example.com"
port = 6697
username = "username"
password = "password"
botname = "botname"
realname = "realname"
owner = "owner"
trigger = botname
channels = [
"##" + botname,
]
sharing_bins = [
"cpy.pt (generic pastes), gist.github.com (multiple files pastes)",
"jsfiddle.net, codepen.io (HTML+CS... | 25.5 | 71 | 0.657952 | host = "chat.example.com"
port = 6697
username = "username"
password = "password"
botname = "botname"
realname = "realname"
owner = "owner"
trigger = botname
channels = [
"##" + botname,
]
sharing_bins = [
"cpy.pt (generic pastes), gist.github.com (multiple files pastes)",
"jsfiddle.net, codepen.io (HTML+CS... | true | true |
1c466226c6dae77cdef9d5c22b9f63c343a0eb11 | 933 | py | Python | bindings/python/src/test/test_package_dependencies.py | cloudsmith-io/cloudsmith-api | bc747fa6ee1d86485e334b08f65687630b3fd87c | [
"Apache-2.0"
] | 9 | 2018-07-02T15:21:40.000Z | 2021-11-24T03:44:39.000Z | bindings/python/src/test/test_package_dependencies.py | cloudsmith-io/cloudsmith-api | bc747fa6ee1d86485e334b08f65687630b3fd87c | [
"Apache-2.0"
] | 8 | 2019-01-08T22:06:12.000Z | 2022-03-16T15:02:37.000Z | bindings/python/src/test/test_package_dependencies.py | cloudsmith-io/cloudsmith-api | bc747fa6ee1d86485e334b08f65687630b3fd87c | [
"Apache-2.0"
] | 1 | 2021-12-06T19:08:05.000Z | 2021-12-06T19:08:05.000Z | # coding: utf-8
"""
Cloudsmith API
The API to the Cloudsmith Service
OpenAPI spec version: v1
Contact: support@cloudsmith.io
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
import unittest
import cloudsmith_api
f... | 20.733333 | 81 | 0.713826 |
from __future__ import absolute_import
import os
import sys
import unittest
import cloudsmith_api
from cloudsmith_api.rest import ApiException
from cloudsmith_api.models.package_dependencies import PackageDependencies
class TestPackageDependencies(unittest.TestCase):
def setUp(self):
pass
def ... | true | true |
1c466290ee5308ecc91a711df4d496fe19a9680e | 674 | py | Python | manage.py | loyer-yuan/REMVocabulary | d86965600f1951c67558b8946bcfd6317d345153 | [
"MIT"
] | 1 | 2021-12-09T09:26:23.000Z | 2021-12-09T09:26:23.000Z | manage.py | loyer-yuan/REMVocabulary | d86965600f1951c67558b8946bcfd6317d345153 | [
"MIT"
] | 1 | 2021-12-07T13:01:23.000Z | 2021-12-12T13:53:47.000Z | manage.py | loyer-yuan/REMVocabulary | d86965600f1951c67558b8946bcfd6317d345153 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'REMVocabulary_DBMS.settings')
try:
from django.core.management import execute_from_command_line
... | 29.304348 | 82 | 0.683976 |
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'REMVocabulary_DBMS.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed ... | true | true |
1c46640f92964d3b0eb444b0e03fd6c6ff9d1033 | 9,349 | py | Python | platformio/commands/check.py | xeno010/platformio-core | 94f8afec38fc8d35db1055368f5fbe4e67c89e7e | [
"Apache-2.0"
] | null | null | null | platformio/commands/check.py | xeno010/platformio-core | 94f8afec38fc8d35db1055368f5fbe4e67c89e7e | [
"Apache-2.0"
] | null | null | null | platformio/commands/check.py | xeno010/platformio-core | 94f8afec38fc8d35db1055368f5fbe4e67c89e7e | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2019-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 31.90785 | 87 | 0.587656 |
import os
from collections import Counter
from os.path import basename, dirname, isfile, join
from time import time
import click
from tabulate import tabulate
from platformio import exception, fs, util
from platformio.check.defect import DefectItem
from platformio.check.tools import CheckToolFactory
... | true | true |
1c46642673cb78f0a633c5d3ee8ef83f7a8d8c9d | 3,761 | py | Python | python/spidriver.py | boxofrox/spidriver | 4e4cf254f1ad337fb299e3c08eb105ae13fa081f | [
"BSD-3-Clause"
] | 4 | 2021-04-21T21:37:57.000Z | 2022-02-10T06:56:01.000Z | python/spidriver.py | boxofrox/spidriver | 4e4cf254f1ad337fb299e3c08eb105ae13fa081f | [
"BSD-3-Clause"
] | null | null | null | python/spidriver.py | boxofrox/spidriver | 4e4cf254f1ad337fb299e3c08eb105ae13fa081f | [
"BSD-3-Clause"
] | 5 | 2019-09-25T15:19:48.000Z | 2021-09-08T10:33:31.000Z | # coding=utf-8
import sys
import serial
__version__ = '0.0.2'
PYTHON2 = (sys.version_info < (3, 0))
class SPIDriver:
"""
SPIDriver interface.
The following variables are available:
product product code e.g. 'spidriver1'
serial serial string of SPIDriver
uptime ti... | 26.864286 | 70 | 0.488168 |
import sys
import serial
__version__ = '0.0.2'
PYTHON2 = (sys.version_info < (3, 0))
class SPIDriver:
def __init__(self, port="/dev/ttyUSB0"):
self.ser = serial.Serial(port, 460800, timeout=1)
self.ser.write(b'@' * 64)
while self.ser.inWaiting():
self.ser.read(1)
... | true | true |
1c46646062a09d65a5e7407db23335596075f971 | 5,160 | py | Python | docs/source/conf.py | Zhiwei-Lu/pyvaspflow | b80eab3e8bfc52aed6a2459dd32655f1075d9058 | [
"MIT"
] | 13 | 2019-06-03T11:41:35.000Z | 2022-03-04T07:45:42.000Z | docs/source/conf.py | Zhiwei-Lu/pyvaspflow | b80eab3e8bfc52aed6a2459dd32655f1075d9058 | [
"MIT"
] | 2 | 2019-03-12T10:51:15.000Z | 2019-03-14T02:18:18.000Z | docs/source/conf.py | Zhiwei-Lu/pyvaspflow | b80eab3e8bfc52aed6a2459dd32655f1075d9058 | [
"MIT"
] | 8 | 2019-06-03T03:20:20.000Z | 2021-01-06T11:48:37.000Z | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... | 30.352941 | 79 | 0.645543 |
import os
import sys
sys.path.insert(0, os.path.abspath('../..'))
autodoc_mock_imports = ['spglib', 'ase']
project = 'pyvaspflowdoc'
copyright = '2019, ChangChun He'
author = 'ChangChun He'
version = '0.0.1'
release = '0.1.0'
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.todo'... | true | true |
1c46648434564e159bcf071df56bbe0cd6cbec1e | 3,708 | py | Python | scripts/trainLSTM_language.py | Asteur/visual-qa | 99be95d61bf9302495e741fa53cf63b7e9a91a35 | [
"MIT"
] | 528 | 2015-11-02T22:06:38.000Z | 2022-02-17T16:07:47.000Z | scripts/trainLSTM_language.py | Asteur/visual-qa | 99be95d61bf9302495e741fa53cf63b7e9a91a35 | [
"MIT"
] | 33 | 2015-11-02T16:10:36.000Z | 2021-01-09T06:05:16.000Z | scripts/trainLSTM_language.py | Asteur/visual-qa | 99be95d61bf9302495e741fa53cf63b7e9a91a35 | [
"MIT"
] | 221 | 2015-11-02T19:13:21.000Z | 2020-09-25T03:41:24.000Z | import sys
from random import shuffle
import argparse
import numpy as np
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation
from keras.layers.recurrent import LSTM
from keras.utils import np_utils, generic_utils
from sklearn import preprocessing
from sklearn.externals import... | 40.304348 | 180 | 0.76699 | import sys
from random import shuffle
import argparse
import numpy as np
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation
from keras.layers.recurrent import LSTM
from keras.utils import np_utils, generic_utils
from sklearn import preprocessing
from sklearn.externals import... | false | true |
1c4665040f1d2e9fa827001815877d94a40df77a | 4,964 | py | Python | pypureclient/flasharray/FA_2_7/models/policy_rule_snapshot_get_response.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 14 | 2018-12-07T18:30:27.000Z | 2022-02-22T09:12:33.000Z | pypureclient/flasharray/FA_2_7/models/policy_rule_snapshot_get_response.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 28 | 2019-09-17T21:03:52.000Z | 2022-03-29T22:07:35.000Z | pypureclient/flasharray/FA_2_7/models/policy_rule_snapshot_get_response.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 15 | 2020-06-11T15:50:08.000Z | 2022-03-21T09:27:25.000Z | # coding: utf-8
"""
FlashArray REST API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 2.7
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re
import six
import typing
from .... | 38.184615 | 524 | 0.615834 |
import pprint
import re
import six
import typing
from ....properties import Property
if typing.TYPE_CHECKING:
from pypureclient.flasharray.FA_2_7 import models
class PolicyRuleSnapshotGetResponse(object):
swagger_types = {
'more_items_remaining': 'bool',
'total_item_count': 'int',
... | true | true |
1c466520334bf6074bf6400dd3e06d73f8b1465a | 6,434 | py | Python | electroncash_plugins/fusion/connection.py | christroutner/Electron-Cash | d5217ed3e878bd56977181f022f9e5c43f449241 | [
"MIT"
] | 208 | 2017-07-25T19:52:15.000Z | 2018-09-21T13:44:58.000Z | electroncash_plugins/fusion/connection.py | christroutner/Electron-Cash | d5217ed3e878bd56977181f022f9e5c43f449241 | [
"MIT"
] | 1,478 | 2018-09-24T09:30:13.000Z | 2022-03-29T15:48:17.000Z | electroncash_plugins/fusion/connection.py | christroutner/Electron-Cash | d5217ed3e878bd56977181f022f9e5c43f449241 | [
"MIT"
] | 159 | 2018-09-24T12:56:47.000Z | 2022-03-28T23:52:17.000Z | #!/usr/bin/env python3
#
# Electron Cash - a lightweight Bitcoin Cash client
# CashFusion - an advanced coin anonymizer
#
# Copyright (C) 2020 Mark B. Lundeberg
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to d... | 35.744444 | 124 | 0.639882 |
import certifi
import socket
import socks
import ssl
import time
from contextlib import suppress
sslcontext = ssl.create_default_context(cafile=certifi.where())
class BadFrameError(Exception):
pass
def open_connection(host, port, conn_timeout = 5.0, default_timeout = 5.0, ssl = False, ... | true | true |
1c46653ea6548a2a103e0f864db3564637b4a532 | 6,220 | py | Python | tests/test_validators.py | wigeria/selenium-yaml-core | 9f953a24ad6f47d0a8423ec78f2e8d29babff89a | [
"Apache-2.0"
] | 2 | 2020-06-28T11:08:20.000Z | 2021-12-01T13:12:11.000Z | tests/test_validators.py | wigeria/selenium-yaml-core | 9f953a24ad6f47d0a8423ec78f2e8d29babff89a | [
"Apache-2.0"
] | 5 | 2020-10-12T13:02:20.000Z | 2021-05-20T14:04:14.000Z | tests/test_validators.py | wigeria/selenium-yaml-core | 9f953a24ad6f47d0a8423ec78f2e8d29babff89a | [
"Apache-2.0"
] | null | null | null | """
Contains tests for the base Validators included in selenium_yaml.validators
"""
from selenium_yaml import validators
import os
class ValidationTestMixin:
""" Contains basic methods for checking whether a validation was
a success or a failure
"""
def is_successful_validation(self, validator, ... | 39.119497 | 79 | 0.671383 |
from selenium_yaml import validators
import os
class ValidationTestMixin:
def is_successful_validation(self, validator, value):
assert validator.is_valid(value) is True
assert isinstance(validator.error, str)
assert len(validator.error) == 0
def is_unsuccessful_validation(self, vali... | true | true |
1c46658b4f19b64b4fc2645b72a26baec8f56676 | 1,490 | py | Python | examples/python-guide/sklearn_example.py | harunpehlivan/LightGBM | 8ba65be9c93b79c095ea06e74de2cc5bf35ab169 | [
"MIT"
] | 59 | 2017-03-09T15:33:52.000Z | 2021-09-16T05:47:10.000Z | examples/python-guide/sklearn_example.py | harunpehlivan/LightGBM | 8ba65be9c93b79c095ea06e74de2cc5bf35ab169 | [
"MIT"
] | 1 | 2017-03-09T07:43:02.000Z | 2017-04-09T19:34:06.000Z | examples/python-guide/sklearn_example.py | harunpehlivan/LightGBM | 8ba65be9c93b79c095ea06e74de2cc5bf35ab169 | [
"MIT"
] | 17 | 2017-03-27T06:37:47.000Z | 2020-05-28T09:17:38.000Z | # coding: utf-8
# pylint: disable = invalid-name, C0111
import lightgbm as lgb
import pandas as pd
from sklearn.metrics import mean_squared_error
from sklearn.model_selection import GridSearchCV
# load or create your dataset
print('Load data...')
df_train = pd.read_csv('../regression/regression.train', header=None, se... | 28.653846 | 79 | 0.699329 |
import lightgbm as lgb
import pandas as pd
from sklearn.metrics import mean_squared_error
from sklearn.model_selection import GridSearchCV
print('Load data...')
df_train = pd.read_csv('../regression/regression.train', header=None, sep='\t')
df_test = pd.read_csv('../regression/regression.test', header=None, sep='\t... | true | true |
1c4665f87ee43e6b0bf3543beac6d08684c8b95e | 1,638 | py | Python | examples/01-filter/decimate.py | sthagen/pyvista-pyvista | 450db9a8d8ad2feea78e10368c47d9aa0e575e65 | [
"MIT"
] | 25 | 2018-12-03T18:22:58.000Z | 2019-02-26T01:30:35.000Z | examples/01-filter/decimate.py | sthagen/pyvista | ffba268b285925eb6103c8ff5072fcf1c0212c53 | [
"MIT"
] | 108 | 2019-02-27T19:52:12.000Z | 2019-05-08T02:15:21.000Z | examples/01-filter/decimate.py | pyvista/vista | c49a6abae7cc62d242f12ec45a6b22b524db1ec8 | [
"MIT"
] | 8 | 2019-03-02T13:41:48.000Z | 2019-04-22T16:57:44.000Z | """
.. _decimate_example:
Decimation
~~~~~~~~~~
Decimate a mesh
"""
# sphinx_gallery_thumbnail_number = 4
import pyvista as pv
from pyvista import examples
mesh = examples.download_face()
# Define a camera position that shows this mesh properly
cpos = [(0.4, -0.07, -0.31), (0.05, -0.13, -0.06), (-0.1, 1, 0.08)]
da... | 26.419355 | 79 | 0.589133 |
import pyvista as pv
from pyvista import examples
mesh = examples.download_face()
cpos = [(0.4, -0.07, -0.31), (0.05, -0.13, -0.06), (-0.1, 1, 0.08)]
dargs = dict(show_edges=True, color=True)
mesh.plot(cpos=cpos, **dargs)
| true | true |
1c46662dc412d1a358e2418e8c957b2eb8513589 | 1,984 | py | Python | whitetube/migrations/0001_initial.py | AmanGiri007/youtube | b58009581378bf74cabfd791691dee65c9516685 | [
"MIT"
] | null | null | null | whitetube/migrations/0001_initial.py | AmanGiri007/youtube | b58009581378bf74cabfd791691dee65c9516685 | [
"MIT"
] | null | null | null | whitetube/migrations/0001_initial.py | AmanGiri007/youtube | b58009581378bf74cabfd791691dee65c9516685 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.7 on 2020-07-31 15:45
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 41.333333 | 118 | 0.602319 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
... | true | true |
1c4666b57524192be8803ca0b7c97e5673ce1bbb | 7,276 | py | Python | telethon/password.py | bb010g/Telethon | 278f0e9e983d938589b6d541e71135ad5b6857c5 | [
"MIT"
] | 2 | 2021-04-29T14:19:25.000Z | 2021-09-17T07:13:49.000Z | telethon/password.py | exceloo/Telethon | 30a0e390603072d3ec57a2f0eef0a297a9b0321b | [
"MIT"
] | 5 | 2021-04-30T21:14:18.000Z | 2022-03-12T00:21:58.000Z | telethon/password.py | exceloo/Telethon | 30a0e390603072d3ec57a2f0eef0a297a9b0321b | [
"MIT"
] | 1 | 2020-04-16T22:02:26.000Z | 2020-04-16T22:02:26.000Z | import hashlib
import os
from .crypto import factorization
from .tl import types
def check_prime_and_good_check(prime: int, g: int):
good_prime_bits_count = 2048
if prime < 0 or prime.bit_length() != good_prime_bits_count:
raise ValueError('bad prime count {}, expected {}'
.f... | 36.562814 | 141 | 0.617097 | import hashlib
import os
from .crypto import factorization
from .tl import types
def check_prime_and_good_check(prime: int, g: int):
good_prime_bits_count = 2048
if prime < 0 or prime.bit_length() != good_prime_bits_count:
raise ValueError('bad prime count {}, expected {}'
.f... | true | true |
1c46679f018a8751f25fbf73754145fb78d2528e | 982 | py | Python | controller/liff_controller.py | louis70109/LIFF-to-LIFF-Example | 1e3d90f7989b5b69090a7b2e3a41c74b3ae3c90b | [
"MIT"
] | null | null | null | controller/liff_controller.py | louis70109/LIFF-to-LIFF-Example | 1e3d90f7989b5b69090a7b2e3a41c74b3ae3c90b | [
"MIT"
] | null | null | null | controller/liff_controller.py | louis70109/LIFF-to-LIFF-Example | 1e3d90f7989b5b69090a7b2e3a41c74b3ae3c90b | [
"MIT"
] | null | null | null | import os
from flask import request, render_template, Response
from flask_restful import Resource
LIFF_A = os.getenv('LIFF_SHARE_A')
LIFF_B = os.getenv('LIFF_SHARE_B')
SHARE_A = f"https://liff.line.me/{LIFF_A}"
SHARE_B = f"https://liff.line.me/{LIFF_B}"
class LiffAController(Resource):
def __init__(self, *args, ... | 33.862069 | 99 | 0.689409 | import os
from flask import request, render_template, Response
from flask_restful import Resource
LIFF_A = os.getenv('LIFF_SHARE_A')
LIFF_B = os.getenv('LIFF_SHARE_B')
SHARE_A = f"https://liff.line.me/{LIFF_A}"
SHARE_B = f"https://liff.line.me/{LIFF_B}"
class LiffAController(Resource):
def __init__(self, *args, ... | true | true |
1c4667e358c0ed6a68e36d3ec4c4fde1c83f9ab6 | 2,831 | py | Python | members_only/views.py | TamasPalfi/FixedDB | be3e4e830b05099d33031759f4a7fc8a42f1e733 | [
"BSD-2-Clause"
] | null | null | null | members_only/views.py | TamasPalfi/FixedDB | be3e4e830b05099d33031759f4a7fc8a42f1e733 | [
"BSD-2-Clause"
] | null | null | null | members_only/views.py | TamasPalfi/FixedDB | be3e4e830b05099d33031759f4a7fc8a42f1e733 | [
"BSD-2-Clause"
] | null | null | null | from django.shortcuts import render
from rest_framework import viewsets
from rest_framework.response import Response
from rest_framework.decorators import action
from members_only.models import User, Post, Comment, Photo, ShortLink
from members_only.serializers import UserSerializer, UserSetupSerializer, PostSerializer... | 37.746667 | 145 | 0.741434 | from django.shortcuts import render
from rest_framework import viewsets
from rest_framework.response import Response
from rest_framework.decorators import action
from members_only.models import User, Post, Comment, Photo, ShortLink
from members_only.serializers import UserSerializer, UserSetupSerializer, PostSerializer... | true | true |
1c46683814368973d3a6672199085b7f7bf2c538 | 335 | py | Python | challenge/D09/Point.py | pengfei99/AdventOfCode2021 | 7aeaf417521fc3acf6b34259b78b9534e1c9f912 | [
"Apache-2.0"
] | 1 | 2022-03-27T09:48:34.000Z | 2022-03-27T09:48:34.000Z | challenge/D09/Point.py | pengfei99/AdventOfCode2021 | 7aeaf417521fc3acf6b34259b78b9534e1c9f912 | [
"Apache-2.0"
] | null | null | null | challenge/D09/Point.py | pengfei99/AdventOfCode2021 | 7aeaf417521fc3acf6b34259b78b9534e1c9f912 | [
"Apache-2.0"
] | null | null | null | class Point:
def __init__(self, value):
self.value = value
self.mark = False
def __str__(self):
return f"value: {self.value}, marked: {self.mark}"
def get_value(self):
return self.value
def get_mark(self):
return self.mark
def mark_point(self):
se... | 18.611111 | 58 | 0.58209 | class Point:
def __init__(self, value):
self.value = value
self.mark = False
def __str__(self):
return f"value: {self.value}, marked: {self.mark}"
def get_value(self):
return self.value
def get_mark(self):
return self.mark
def mark_point(self):
se... | true | true |
1c46686d9bf0cf7f5d046349ac7a9f5fc444fa5e | 2,984 | py | Python | openslides_backend/action/actions/committee/update.py | MJJojo97/openslides-backend | af0d1edb0070e352d46f285a1ba0bbe3702d49ae | [
"MIT"
] | null | null | null | openslides_backend/action/actions/committee/update.py | MJJojo97/openslides-backend | af0d1edb0070e352d46f285a1ba0bbe3702d49ae | [
"MIT"
] | null | null | null | openslides_backend/action/actions/committee/update.py | MJJojo97/openslides-backend | af0d1edb0070e352d46f285a1ba0bbe3702d49ae | [
"MIT"
] | null | null | null | from typing import Any, Dict
from ....models.models import Committee
from ....permissions.management_levels import (
CommitteeManagementLevel,
OrganizationManagementLevel,
)
from ....permissions.permission_helper import (
has_committee_management_level,
has_organization_management_level,
)
from ....sha... | 33.155556 | 88 | 0.632373 | from typing import Any, Dict
from ....models.models import Committee
from ....permissions.management_levels import (
CommitteeManagementLevel,
OrganizationManagementLevel,
)
from ....permissions.permission_helper import (
has_committee_management_level,
has_organization_management_level,
)
from ....sha... | true | true |
1c4668cd01cebff276c684dd00b647ddfd8b4381 | 40,948 | py | Python | venv/lib/python2.7/site-packages/cffi/vengine_cpy.py | deandunbar/html2bwml | 32c06a93c8daf6a26c89c0de58fd39859d1ddb1e | [
"MIT"
] | 4 | 2017-09-17T03:27:47.000Z | 2020-04-29T00:10:20.000Z | venv/lib/python2.7/site-packages/cffi/vengine_cpy.py | deandunbar/html2bwml | 32c06a93c8daf6a26c89c0de58fd39859d1ddb1e | [
"MIT"
] | null | null | null | venv/lib/python2.7/site-packages/cffi/vengine_cpy.py | deandunbar/html2bwml | 32c06a93c8daf6a26c89c0de58fd39859d1ddb1e | [
"MIT"
] | 5 | 2017-09-20T08:08:43.000Z | 2022-02-02T08:19:30.000Z | import sys, imp
from . import model, ffiplatform
class VCPythonEngine(object):
_class_key = 'x'
_gen_python_module = True
def __init__(self, verifier):
self.verifier = verifier
self.ffi = verifier.ffi
self._struct_pending_verification = {}
self._types_of_builtin_functions ... | 40.988989 | 79 | 0.546962 | import sys, imp
from . import model, ffiplatform
class VCPythonEngine(object):
_class_key = 'x'
_gen_python_module = True
def __init__(self, verifier):
self.verifier = verifier
self.ffi = verifier.ffi
self._struct_pending_verification = {}
self._types_of_builtin_functions ... | true | true |
1c46691999965d62eea11bab0f726d607f2615d6 | 5,738 | py | Python | iot/main.py | jonDufty/snsrpi-device | 0e2d8023093385e1ec457560e8880c43036c73dc | [
"MIT"
] | null | null | null | iot/main.py | jonDufty/snsrpi-device | 0e2d8023093385e1ec457560e8880c43036c73dc | [
"MIT"
] | null | null | null | iot/main.py | jonDufty/snsrpi-device | 0e2d8023093385e1ec457560e8880c43036c73dc | [
"MIT"
] | null | null | null | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0.
import argparse
from ShadowHandler import SensorShadowHandler, GlobalShadowHandler
from awscrt import io, mqtt, auth, http
from awsiot import mqtt_connection_builder, iotshadow
import sys
import os
import signal... | 34.154762 | 111 | 0.729697 |
import argparse
from ShadowHandler import SensorShadowHandler, GlobalShadowHandler
from awscrt import io, mqtt, auth, http
from awsiot import mqtt_connection_builder, iotshadow
import sys
import os
import signal
import threading
import json
import time
from datetime import datetime, timedelta
from uuid import uuid4
... | true | true |
1c466940b6dc99ba7aabaaea9b7a0414ef2ddf39 | 13,009 | py | Python | formfactory/tests/test_base.py | AltusBarry/django-formfactory | 8da378d0952bfd0eb9a08d49b17b5b95ee7e607d | [
"BSD-3-Clause"
] | null | null | null | formfactory/tests/test_base.py | AltusBarry/django-formfactory | 8da378d0952bfd0eb9a08d49b17b5b95ee7e607d | [
"BSD-3-Clause"
] | null | null | null | formfactory/tests/test_base.py | AltusBarry/django-formfactory | 8da378d0952bfd0eb9a08d49b17b5b95ee7e607d | [
"BSD-3-Clause"
] | null | null | null | import os
import shutil
import uuid
from django.conf import settings
from formfactory import models
from formfactory.tests.models import Enum, EnumItem
def cleanup_files():
test_file_dir = os.path.join(settings.MEDIA_ROOT, "uploads/test")
shutil.rmtree(test_file_dir, ignore_errors=True)
def load_fixtures(... | 30.609412 | 82 | 0.568376 | import os
import shutil
import uuid
from django.conf import settings
from formfactory import models
from formfactory.tests.models import Enum, EnumItem
def cleanup_files():
test_file_dir = os.path.join(settings.MEDIA_ROOT, "uploads/test")
shutil.rmtree(test_file_dir, ignore_errors=True)
def load_fixtures(... | true | true |
1c466974e1deea98828676448579173ed8d0bcef | 357 | py | Python | rusel/config.py | ruslan-ok/ruslan | fc402e53d2683581e13f4d6c69a6f21e5c2ca1f8 | [
"MIT"
] | null | null | null | rusel/config.py | ruslan-ok/ruslan | fc402e53d2683581e13f4d6c69a6f21e5c2ca1f8 | [
"MIT"
] | null | null | null | rusel/config.py | ruslan-ok/ruslan | fc402e53d2683581e13f4d6c69a6f21e5c2ca1f8 | [
"MIT"
] | null | null | null | from task.const import *
app_config = {
'name': APP_ALL,
'app_title': 'search results',
'icon': 'search',
'role': ROLE_SEARCH_RESULTS,
'sort': [
('name', 'name'),
('created', 'create date'),
],
'views': {
'search': {
'icon': 'search',
'title':... | 19.833333 | 38 | 0.456583 | from task.const import *
app_config = {
'name': APP_ALL,
'app_title': 'search results',
'icon': 'search',
'role': ROLE_SEARCH_RESULTS,
'sort': [
('name', 'name'),
('created', 'create date'),
],
'views': {
'search': {
'icon': 'search',
'title':... | true | true |
1c466c2eb51ca67b46ef055458e6f5edc433953f | 8,546 | py | Python | handler.py | abizerlokhandwala/Cowin-Notification-Service | 4fd7fd9c3cfab37502ad4135007a6127ca4cc15f | [
"MIT"
] | 14 | 2021-05-07T13:09:03.000Z | 2022-01-10T23:24:42.000Z | handler.py | abizerlokhandwala/Cowin-Notification-Service | 4fd7fd9c3cfab37502ad4135007a6127ca4cc15f | [
"MIT"
] | 16 | 2021-05-10T16:41:21.000Z | 2021-06-09T14:49:03.000Z | handler.py | abizerlokhandwala/Cowin-Notification-Service | 4fd7fd9c3cfab37502ad4135007a6127ca4cc15f | [
"MIT"
] | 5 | 2021-05-09T12:14:03.000Z | 2021-06-08T13:56:55.000Z | import asyncio
import json
import logging
import random
from datetime import date
import boto3
from helpers.constants import ISSUE_MSG, DB_NAME
from helpers.cowin_sdk import CowinAPI
from helpers.db_handler import DBHandler, get_pin_code_location
from helpers.notificationHandler import NotifHandler
from helpers.queri... | 38.845455 | 118 | 0.662064 | import asyncio
import json
import logging
import random
from datetime import date
import boto3
from helpers.constants import ISSUE_MSG, DB_NAME
from helpers.cowin_sdk import CowinAPI
from helpers.db_handler import DBHandler, get_pin_code_location
from helpers.notificationHandler import NotifHandler
from helpers.queri... | true | true |
1c466c5148c6b829d6eaaf73cbd026659824bb69 | 1,098 | py | Python | 2021/25/day25.py | AlbertVeli/AdventOfCode | 3d3473695318a0686fac720a1a21dd3629f09e33 | [
"Unlicense"
] | null | null | null | 2021/25/day25.py | AlbertVeli/AdventOfCode | 3d3473695318a0686fac720a1a21dd3629f09e33 | [
"Unlicense"
] | null | null | null | 2021/25/day25.py | AlbertVeli/AdventOfCode | 3d3473695318a0686fac720a1a21dd3629f09e33 | [
"Unlicense"
] | 1 | 2021-12-04T10:37:09.000Z | 2021-12-04T10:37:09.000Z | #!/usr/bin/env python3
import sys
import numpy as np
if len(sys.argv) != 2:
print('Usage:', sys.argv[0], '<input.txt>')
sys.exit(1)
a = []
for line in open(sys.argv[1]):
a.append(list(line.rstrip()))
a = np.array(a)
sy, sx = a.shape
# Could probably move without copying a
# but logic is simpler if keepi... | 21.115385 | 47 | 0.441712 |
import sys
import numpy as np
if len(sys.argv) != 2:
print('Usage:', sys.argv[0], '<input.txt>')
sys.exit(1)
a = []
for line in open(sys.argv[1]):
a.append(list(line.rstrip()))
a = np.array(a)
sy, sx = a.shape
def move(a):
moved = False
a_org = np.array(a)
for y in range(sy):
... | true | true |
1c466c8c0bd43fad411e356a53e99baf9f31c048 | 987 | py | Python | 2019/25_Josepus_Survivor/my_solution.py | erik-kristofer-anderson/codewars | fda780f40d1a2d8c5210cfd6ccf81148444bc9e8 | [
"MIT"
] | null | null | null | 2019/25_Josepus_Survivor/my_solution.py | erik-kristofer-anderson/codewars | fda780f40d1a2d8c5210cfd6ccf81148444bc9e8 | [
"MIT"
] | 1 | 2019-07-27T15:42:25.000Z | 2019-07-27T15:42:25.000Z | 2019/25_Josepus_Survivor/my_solution.py | erik-kristofer-anderson/Codewars | fda780f40d1a2d8c5210cfd6ccf81148444bc9e8 | [
"MIT"
] | null | null | null | def josephus_survivor(n,k):
my_array = list(range(1, n+1))
# print(my_array)
i = 0
while len(my_array) > 1:
length = len(my_array)
# print(my_array)
# print(length)
# print('i', i)
while not i < length:
i -= length
i += k - 1
while not ... | 22.953488 | 38 | 0.449848 | def josephus_survivor(n,k):
my_array = list(range(1, n+1))
i = 0
while len(my_array) > 1:
length = len(my_array)
while not i < length:
i -= length
i += k - 1
while not i < length:
i -= length
... | true | true |
1c466d37b86970653faf38b62fdf0da523eb0c8b | 284 | py | Python | src/Distiller/textbrewer/distillers.py | haroldNLP/Distiller | f3ab5f94a9092fca1e2bdb9f486e66fd0b24bcfd | [
"MIT"
] | 2 | 2022-03-21T08:02:02.000Z | 2022-03-21T08:29:07.000Z | src/Distiller/textbrewer/distillers.py | haroldNLP/Distiller | f3ab5f94a9092fca1e2bdb9f486e66fd0b24bcfd | [
"MIT"
] | null | null | null | src/Distiller/textbrewer/distillers.py | haroldNLP/Distiller | f3ab5f94a9092fca1e2bdb9f486e66fd0b24bcfd | [
"MIT"
] | null | null | null | from .distiller_train import BasicTrainer
from .distiller_basic import BasicDistiller
from .distiller_general import GeneralDistiller
from .distiller_multitask import MultiTaskDistiller
from .distiller_multiteacher import MultiTeacherDistiller
from .distiller_emd import EMDDistiller
| 40.571429 | 57 | 0.894366 | from .distiller_train import BasicTrainer
from .distiller_basic import BasicDistiller
from .distiller_general import GeneralDistiller
from .distiller_multitask import MultiTaskDistiller
from .distiller_multiteacher import MultiTeacherDistiller
from .distiller_emd import EMDDistiller
| true | true |
1c466db29b0f06ae975488369e9165135775e8e7 | 4,842 | py | Python | src/models/sp_classifier_model_test.py | bartek-wojcik/graph_agregations | 12305e4ffdf4db60da041689f04d96b48e9e72e5 | [
"MIT"
] | null | null | null | src/models/sp_classifier_model_test.py | bartek-wojcik/graph_agregations | 12305e4ffdf4db60da041689f04d96b48e9e72e5 | [
"MIT"
] | null | null | null | src/models/sp_classifier_model_test.py | bartek-wojcik/graph_agregations | 12305e4ffdf4db60da041689f04d96b48e9e72e5 | [
"MIT"
] | null | null | null | from typing import Any, List
import torch
from pytorch_lightning import LightningModule
from pytorch_lightning.metrics.classification import Accuracy
from src.models.modules import gat, jumping_knowledge, graph_sage, gcn, vector_sage_module, jumping_knowledge_test
class SuperpixelClassifierModelTest(LightningModule):... | 42.104348 | 114 | 0.644981 | from typing import Any, List
import torch
from pytorch_lightning import LightningModule
from pytorch_lightning.metrics.classification import Accuracy
from src.models.modules import gat, jumping_knowledge, graph_sage, gcn, vector_sage_module, jumping_knowledge_test
class SuperpixelClassifierModelTest(LightningModule):... | true | true |
1c466dc07772bb7c04ea801073ca12ed12884e52 | 7,794 | py | Python | torchvision/datasets/celeba.py | kirilkoroves/torchvision-0.3.0 | 39f46d141f6a7ac2b094545c33936ad4500d3c7d | [
"BSD-3-Clause"
] | 125 | 2020-06-17T19:58:56.000Z | 2022-03-28T12:54:43.000Z | datasets/celeba.py | ANLGBOY/ddim | 34d640e5180cc5ab378f84af6ed596cb0c810e6c | [
"MIT"
] | 6 | 2021-03-19T15:30:28.000Z | 2022-03-12T00:51:16.000Z | datasets/celeba.py | ANLGBOY/ddim | 34d640e5180cc5ab378f84af6ed596cb0c810e6c | [
"MIT"
] | 29 | 2020-06-18T19:24:04.000Z | 2022-03-11T11:20:47.000Z | import torch
import os
import PIL
from .vision import VisionDataset
from .utils import download_file_from_google_drive, check_integrity
class CelebA(VisionDataset):
"""`Large-scale CelebFaces Attributes (CelebA) Dataset <http://mmlab.ie.cuhk.edu.hk/projects/CelebA.html>`_ Dataset.
Args:
root (string)... | 47.52439 | 120 | 0.628689 | import torch
import os
import PIL
from .vision import VisionDataset
from .utils import download_file_from_google_drive, check_integrity
class CelebA(VisionDataset):
base_folder = "celeba"
file_list = [
("0B7EVK8r0v71pZjFTYXZWM3FlRnM", "00d2c5bc6d35e252742224ab0c1e8fcb", "img_a... | true | true |
1c466ddb0d67ce19e3f6d28c4f2f173c575e35e2 | 16,649 | py | Python | netapp/santricity/api/symbol/p_api.py | NetApp/santricity-webapi-pythonsdk | 1d3df4a00561192f4cdcdd1890f4d27547ed2de2 | [
"BSD-3-Clause-Clear"
] | 5 | 2016-08-23T17:52:22.000Z | 2019-05-16T08:45:30.000Z | netapp/santricity/api/symbol/p_api.py | NetApp/santricity-webapi-pythonsdk | 1d3df4a00561192f4cdcdd1890f4d27547ed2de2 | [
"BSD-3-Clause-Clear"
] | 2 | 2016-11-10T05:30:21.000Z | 2019-04-05T15:03:37.000Z | netapp/santricity/api/symbol/p_api.py | NetApp/santricity-webapi-pythonsdk | 1d3df4a00561192f4cdcdd1890f4d27547ed2de2 | [
"BSD-3-Clause-Clear"
] | 7 | 2016-08-25T16:11:44.000Z | 2021-02-22T05:31:25.000Z | #!/usr/bin/env python
# coding: utf-8
"""
PApi.py
The Clear BSD License
Copyright (c) – 2016, NetApp, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following condit... | 41.210396 | 845 | 0.568983 |
from __future__ import absolute_import
import sys
import os
from six import iteritems
from ....santricity.configuration import Configuration
from ....santricity.api_client import ApiClient
class PApi(object):
def __init__(self, api_client=None):
config = Configuration()
if api_client:
... | true | true |
1c466e24cb956d06875072696560d66b6ce8e400 | 4,071 | py | Python | alipay/aop/api/request/KoubeiMarketingCampaignItemBatchqueryRequest.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/request/KoubeiMarketingCampaignItemBatchqueryRequest.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/request/KoubeiMarketingCampaignItemBatchqueryRequest.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.KoubeiMarketingCampaignItemBatchqueryModel import KoubeiMarketingCampaignItemBatchqueryModel
class KoubeiMarketingCamp... | 28.075862 | 166 | 0.651437 |
import simplejson as json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.KoubeiMarketingCampaignItemBatchqueryModel import KoubeiMarketingCampaignItemBatchqueryModel
class KoubeiMarketingCampaignItemBatchqueryRequest(object):
def ... | true | true |
1c466e5cad5ca16ff031b3575687a75e615161ff | 1,926 | py | Python | tests/terraform/checks/resource/aws/test_S3MFADelete.py | cclauss/checkov | 60a385fcaff1499cf00c2d0018575fe5ab71f556 | [
"Apache-2.0"
] | 5 | 2021-07-29T18:08:40.000Z | 2022-03-21T04:39:32.000Z | tests/terraform/checks/resource/aws/test_S3MFADelete.py | cclauss/checkov | 60a385fcaff1499cf00c2d0018575fe5ab71f556 | [
"Apache-2.0"
] | 16 | 2021-03-09T07:38:38.000Z | 2021-06-09T03:53:55.000Z | tests/terraform/checks/resource/aws/test_S3MFADelete.py | cclauss/checkov | 60a385fcaff1499cf00c2d0018575fe5ab71f556 | [
"Apache-2.0"
] | 2 | 2021-08-23T13:25:36.000Z | 2021-11-05T21:44:52.000Z | import unittest
from checkov.terraform.checks.resource.aws.S3MFADelete import scanner
from checkov.common.models.enums import CheckResult
class TestS3MFADelete(unittest.TestCase):
def test_failure(self):
resource_conf = {"region": ["us-west-2"],
"bucket": ["my_bucket"],
... | 40.125 | 72 | 0.475597 | import unittest
from checkov.terraform.checks.resource.aws.S3MFADelete import scanner
from checkov.common.models.enums import CheckResult
class TestS3MFADelete(unittest.TestCase):
def test_failure(self):
resource_conf = {"region": ["us-west-2"],
"bucket": ["my_bucket"],
... | true | true |
1c46706d423b7f39a9afbea8fb6279b3a302d7b9 | 3,384 | py | Python | test/functional/test_framework/coverage.py | AlvaStudio/vtl2 | 0d0eeeaeb45d841086a9fabaeb77d3cad14c5f87 | [
"MIT"
] | null | null | null | test/functional/test_framework/coverage.py | AlvaStudio/vtl2 | 0d0eeeaeb45d841086a9fabaeb77d3cad14c5f87 | [
"MIT"
] | null | null | null | test/functional/test_framework/coverage.py | AlvaStudio/vtl2 | 0d0eeeaeb45d841086a9fabaeb77d3cad14c5f87 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Utilities for doing coverage analysis on the RPC interface.
Provides a way to track which RPC commands... | 30.763636 | 87 | 0.661052 |
import os
REFERENCE_FILENAME = 'rpc_interface.txt'
class AuthServiceProxyWrapper():
def __init__(self, auth_service_proxy_instance, coverage_logfile=None):
self.auth_service_proxy_instance = auth_service_proxy_instance
self.coverage_logfile = coverage_logfile
def __getattr__(self, name... | true | true |
1c467098f9187f933e5f2190a330b0d788c96cba | 524 | py | Python | lib/gensim/summarization/commons.py | duyetdev/api.duyetdev.com | 4c33cc2cfb43ad6c4089873230e7b657659bff15 | [
"MIT"
] | 4 | 2018-11-27T01:35:30.000Z | 2022-01-27T01:17:11.000Z | lib/gensim/summarization/commons.py | duyetdev/api.duyetdev.com | 4c33cc2cfb43ad6c4089873230e7b657659bff15 | [
"MIT"
] | 12 | 2020-07-11T01:42:51.000Z | 2020-08-12T17:17:35.000Z | lib/gensim/summarization/commons.py | duyetdev/api.duyetdev.com | 4c33cc2cfb43ad6c4089873230e7b657659bff15 | [
"MIT"
] | 1 | 2018-11-27T01:35:33.000Z | 2018-11-27T01:35:33.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
from gensim.summarization.graph import Graph
def build_graph(sequence):
graph = Graph()
for item in sequence:
if not graph.has_node(item):
graph.add_node(item)
re... | 24.952381 | 89 | 0.658397 |
from gensim.summarization.graph import Graph
def build_graph(sequence):
graph = Graph()
for item in sequence:
if not graph.has_node(item):
graph.add_node(item)
return graph
def remove_unreachable_nodes(graph):
for node in graph.nodes():
if sum(graph.edge_weight((node... | true | true |
1c4670dad12c93b48d43314ce50b40cb389322c4 | 1,554 | py | Python | python/script/run_vmaf_cross_validation.py | christosbampis/vmaf | 33e8dc675ace44dd1412b318c31eb3378612744c | [
"Apache-2.0"
] | null | null | null | python/script/run_vmaf_cross_validation.py | christosbampis/vmaf | 33e8dc675ace44dd1412b318c31eb3378612744c | [
"Apache-2.0"
] | 1 | 2018-09-05T16:33:08.000Z | 2018-09-05T16:33:08.000Z | python/script/run_vmaf_cross_validation.py | christosbampis/vmaf | 33e8dc675ace44dd1412b318c31eb3378612744c | [
"Apache-2.0"
] | 2 | 2018-09-05T03:59:46.000Z | 2018-09-18T03:57:52.000Z | __copyright__ = "Copyright 2016-2017, Netflix, Inc."
__license__ = "Apache, Version 2.0"
import matplotlib.pyplot as plt
import numpy as np
from vmaf.config import VmafConfig
from vmaf.routine import run_vmaf_cv, run_vmaf_kfold_cv
if __name__ == '__main__':
# ==== Run simple cross validation: one training and o... | 33.782609 | 93 | 0.695624 | __copyright__ = "Copyright 2016-2017, Netflix, Inc."
__license__ = "Apache, Version 2.0"
import matplotlib.pyplot as plt
import numpy as np
from vmaf.config import VmafConfig
from vmaf.routine import run_vmaf_cv, run_vmaf_kfold_cv
if __name__ == '__main__':
run_vmaf_cv(
train_dataset_filepath=Vmaf... | false | true |
1c467153e4dd6d941d4fa3ba61730d6360584541 | 271 | py | Python | lab_6.py | goni21-meet/meet2019y1lab6 | c75fab3b544a13d1ad8bef13e5675ff5ea165a0d | [
"MIT"
] | null | null | null | lab_6.py | goni21-meet/meet2019y1lab6 | c75fab3b544a13d1ad8bef13e5675ff5ea165a0d | [
"MIT"
] | null | null | null | lab_6.py | goni21-meet/meet2019y1lab6 | c75fab3b544a13d1ad8bef13e5675ff5ea165a0d | [
"MIT"
] | null | null | null | #import turtle
#x = 0
#while x<300:
# y = x**2/300
# turtle.goto(x,y)
# print( turtle.pos())
#x = x+100
#turtle.mainloop()
import turtle
num_pts = 5
for i in range(num_pts):
turtle.left(360/num_pts)
turtle.forward(100)
turtle.mainloop()
| 11.291667 | 28 | 0.597786 |
import turtle
num_pts = 5
for i in range(num_pts):
turtle.left(360/num_pts)
turtle.forward(100)
turtle.mainloop()
| true | true |
1c46723f0a2b6f567ce353e54cc92039a142acf3 | 119 | py | Python | h/groups/__init__.py | ssin122/test-h | c10062ae23b690afaac0ab4af7b9a5a5e4b686a9 | [
"MIT"
] | 2 | 2021-11-07T23:14:54.000Z | 2021-11-17T10:11:55.000Z | h/groups/__init__.py | ssin122/test-h | c10062ae23b690afaac0ab4af7b9a5a5e4b686a9 | [
"MIT"
] | null | null | null | h/groups/__init__.py | ssin122/test-h | c10062ae23b690afaac0ab4af7b9a5a5e4b686a9 | [
"MIT"
] | 1 | 2017-03-12T00:18:33.000Z | 2017-03-12T00:18:33.000Z | # -*- coding: utf-8 -*-
def includeme(config):
config.memex_add_search_filter('h.groups.search.GroupAuthFilter')
| 19.833333 | 69 | 0.714286 |
def includeme(config):
config.memex_add_search_filter('h.groups.search.GroupAuthFilter')
| true | true |
1c467277bdb5e4e30d2dce15c741769d571a9408 | 3,454 | py | Python | lines/Segment.py | AlexTaguchi/lines | d091d52350d0bedc3c8af0aa5438b6a1da95151d | [
"MIT"
] | null | null | null | lines/Segment.py | AlexTaguchi/lines | d091d52350d0bedc3c8af0aa5438b6a1da95151d | [
"MIT"
] | null | null | null | lines/Segment.py | AlexTaguchi/lines | d091d52350d0bedc3c8af0aa5438b6a1da95151d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
class EvalPointError(ValueError):
pass
class Segment:
def __init__(self):
self.a = 0.0 # y = a.x + b
self.b = 0.0
self._points = []
self._rss = 0.0 # Residual sum of squares
self._wixiyi = 0.0
self._wixi = 0.0
self._wiyi = 0.0
... | 29.271186 | 77 | 0.486972 |
class EvalPointError(ValueError):
pass
class Segment:
def __init__(self):
self.a = 0.0
self.b = 0.0
self._points = []
self._rss = 0.0
self._wixiyi = 0.0
self._wixi = 0.0
self._wiyi = 0.0
self._wixi2 = 0.0
self._wi = 0.0
def ge... | true | true |
1c46739728bc3decdb8284725d1278b660ceff72 | 826 | py | Python | pirates/creature/Monstrous.py | itsyaboyrocket/pirates | 6ca1e7d571c670b0d976f65e608235707b5737e3 | [
"BSD-3-Clause"
] | 3 | 2021-02-25T06:38:13.000Z | 2022-03-22T07:00:15.000Z | pirates/creature/Monstrous.py | itsyaboyrocket/pirates | 6ca1e7d571c670b0d976f65e608235707b5737e3 | [
"BSD-3-Clause"
] | null | null | null | pirates/creature/Monstrous.py | itsyaboyrocket/pirates | 6ca1e7d571c670b0d976f65e608235707b5737e3 | [
"BSD-3-Clause"
] | 1 | 2021-02-25T06:38:17.000Z | 2021-02-25T06:38:17.000Z | # uncompyle6 version 3.2.0
# Python bytecode 2.4 (62061)
# Decompiled from: Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32 bit (Intel)]
# Embedded file name: pirates.creature.Monstrous
class Monstrous:
__module__ = __name__
def initializeMonstrousTags(self, rootNodePath):
fr... | 37.545455 | 104 | 0.728814 |
class Monstrous:
__module__ = __name__
def initializeMonstrousTags(self, rootNodePath):
from pirates.piratesbase import PiratesGlobals
rootNodePath.setPythonTag('MonstrousObject', self)
self.setPythonTag('MonstrousObject', self)
rootNodePath.setTag('objType', str(PiratesGl... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.