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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f715ed9bba993419b3f1d384d817b622367f47e1 | 2,536 | py | Python | pxlc/qt/DropDownSelectMenu.py | pxlc/pxlc_td | 44d08dd9e9a9595449005f3446536e7a02113c95 | [
"MIT"
] | 2 | 2020-10-06T22:56:10.000Z | 2022-03-07T04:13:47.000Z | pxlc/qt/DropDownSelectMenu.py | pxlc/pxlc_td | 44d08dd9e9a9595449005f3446536e7a02113c95 | [
"MIT"
] | null | null | null | pxlc/qt/DropDownSelectMenu.py | pxlc/pxlc_td | 44d08dd9e9a9595449005f3446536e7a02113c95 | [
"MIT"
] | null | null | null | # -------------------------------------------------------------------------------
# MIT License
#
# Copyright (c) 2018 pxlc@github
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without re... | 32.101266 | 107 | 0.651025 |
from PySide import QtCore, QtGui
from .cb import connect_callback
__INFO__ = '''
item list:
[
{
'label': 'Menu label',
'select_data': 'any type, returned if item is selected',
'style': 'style sheet string (optional)',
}
]
'''
class DropDownSelectMe... | true | true |
f715edafdd23569ac05010564563d3ff065388fb | 8,828 | py | Python | docs/source/conf.py | andrewseidl/ibis | 1468b8c4f96d9d58f6fa147a2579b0d9e5796186 | [
"Apache-2.0"
] | null | null | null | docs/source/conf.py | andrewseidl/ibis | 1468b8c4f96d9d58f6fa147a2579b0d9e5796186 | [
"Apache-2.0"
] | 6 | 2017-05-18T19:49:09.000Z | 2019-03-27T15:37:14.000Z | docs/source/conf.py | andrewseidl/ibis | 1468b8c4f96d9d58f6fa147a2579b0d9e5796186 | [
"Apache-2.0"
] | 1 | 2017-06-26T15:43:35.000Z | 2017-06-26T15:43:35.000Z | # -*- coding: utf-8 -*-
#
# Ibis documentation build configuration file, created by
# sphinx-quickstart on Wed Jun 10 11:06:29 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All ... | 31.194346 | 79 | 0.715224 |
import glob
import datetime
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.extlinks',
'sphinx.ext.mathjax',
'numpydoc',
'nbsphinx',
'IPython.sphinxext.ipython_directive',
'IPython.sphinxext.ipython_console_highlighting',
]
autosummary_generate = glob.gl... | true | true |
f715ee5b393ad823887100ea16fc12a89479e531 | 1,091 | py | Python | masakari-7.0.0/masakari/tests/uuidsentinel.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 70 | 2016-07-22T21:58:00.000Z | 2022-01-04T06:05:32.000Z | masakari-7.0.0/masakari/tests/uuidsentinel.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | masakari-7.0.0/masakari/tests/uuidsentinel.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 33 | 2016-07-05T02:05:25.000Z | 2021-12-20T07:40:43.000Z | # Copyright 2016 NTT DATA
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 32.088235 | 75 | 0.711274 |
import sys
class UUIDSentinels(object):
def __init__(self):
from oslo_utils import uuidutils
self._uuid_module = uuidutils
self._sentinels = {}
def __getattr__(self, name):
if name.startswith('_'):
raise ValueError('Sentinels must not start with _')
if nam... | true | true |
f715ee8ea645eac7275a181386fd2444e7fa7fa0 | 5,420 | py | Python | sdk/python/pulumi_azure_native/machinelearningservices/v20200515preview/get_aks_service.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/machinelearningservices/v20200515preview/get_aks_service.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/machinelearningservices/v20200515preview/get_aks_service.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 33.04878 | 158 | 0.62583 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . import outputs
__all__ = [
'GetAKSServiceResult',
'AwaitableGetAKSServiceResult',
'get_aks_service',
]
@pulumi.output_type
class GetAKSServiceResult:
... | true | true |
f715f0635c3ef7697ec0cfe38a3e89fa3c316e5f | 735 | py | Python | awx/main/migrations/0016_v330_non_blank_workflow.py | james-crowley/awx | 5cd44cde991a9526810809544e7a8f12e6174711 | [
"Apache-2.0"
] | 1 | 2021-12-27T14:33:10.000Z | 2021-12-27T14:33:10.000Z | awx/main/migrations/0016_v330_non_blank_workflow.py | james-crowley/awx | 5cd44cde991a9526810809544e7a8f12e6174711 | [
"Apache-2.0"
] | 35 | 2021-03-01T06:34:26.000Z | 2022-03-01T01:18:42.000Z | awx/main/migrations/0016_v330_non_blank_workflow.py | james-crowley/awx | 5cd44cde991a9526810809544e7a8f12e6174711 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-12-11 16:40
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('main', '0015_v330_blank_st... | 28.269231 | 148 | 0.665306 | from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('main', '0015_v330_blank_start_args'),
]
operations = [
migrations.AlterField(
... | true | true |
f715f097181f6d815bcda6fe2acd64e76df19463 | 8,577 | py | Python | models_all_solvable2/fac2.py | grossmann-group/pyomo-MINLP-benchmarking | 714f0a0dffd61675649a805683c0627af6b4929e | [
"MIT"
] | 7 | 2019-05-08T19:14:34.000Z | 2021-12-24T00:00:40.000Z | models_all_solvable2/fac2.py | grossmann-group/pyomo-MINLP-benchmarking | 714f0a0dffd61675649a805683c0627af6b4929e | [
"MIT"
] | null | null | null | models_all_solvable2/fac2.py | grossmann-group/pyomo-MINLP-benchmarking | 714f0a0dffd61675649a805683c0627af6b4929e | [
"MIT"
] | 2 | 2020-05-21T22:15:51.000Z | 2020-06-02T23:02:08.000Z | # MINLP written by GAMS Convert at 05/15/20 00:50:46
#
# Equation counts
# Total E G L N X C B
# 34 22 3 9 0 0 0 0
#
# Variable counts
# x b i s1s s2s sc ... | 49.578035 | 120 | 0.5903 |
from pyomo.environ import *
model = m = ConcreteModel()
m.x1 = Var(within=Reals,bounds=(0,1000),initialize=0)
m.x2 = Var(within=Reals,bounds=(0,1000),initialize=0)
m.x3 = Var(within=Reals,bounds=(0,1000),initialize=0)
m.x4 = Var(within=Reals,bounds=(0,1000),initialize=0)
m.x5 = Var(within=Reals,bounds=(0,1000),ini... | true | true |
f715f09dd9a1ab89449f85a7df5a818d88fa8086 | 37,361 | py | Python | banana/study/mri/dwi.py | apoz00003/banana | 50bf516cc4f7d4d93985e42d0c4dcbc62fb8058a | [
"Apache-2.0"
] | null | null | null | banana/study/mri/dwi.py | apoz00003/banana | 50bf516cc4f7d4d93985e42d0c4dcbc62fb8058a | [
"Apache-2.0"
] | null | null | null | banana/study/mri/dwi.py | apoz00003/banana | 50bf516cc4f7d4d93985e42d0c4dcbc62fb8058a | [
"Apache-2.0"
] | null | null | null | from logging import getLogger
from nipype.interfaces.utility import Merge
from nipype.interfaces.fsl import (
TOPUP, ApplyTOPUP, BET, FUGUE, Merge as FslMerge)
from nipype.interfaces import fsl
from nipype.interfaces.utility import Merge as merge_lists
from nipype.interfaces.fsl.epi import PrepareFieldmap
from nipy... | 37.064484 | 79 | 0.532855 | from logging import getLogger
from nipype.interfaces.utility import Merge
from nipype.interfaces.fsl import (
TOPUP, ApplyTOPUP, BET, FUGUE, Merge as FslMerge)
from nipype.interfaces import fsl
from nipype.interfaces.utility import Merge as merge_lists
from nipype.interfaces.fsl.epi import PrepareFieldmap
from nipy... | true | true |
f715f0ca82d3720e709126ea59e933b3baab9523 | 2,969 | py | Python | test/features/steps/crud_table.py | lyrl/mycli | d62eefdc819a11ecdb97d93dd7ad1922d28a3795 | [
"BSD-3-Clause"
] | 10,997 | 2015-07-27T06:59:04.000Z | 2022-03-31T07:49:26.000Z | test/features/steps/crud_table.py | lyrl/mycli | d62eefdc819a11ecdb97d93dd7ad1922d28a3795 | [
"BSD-3-Clause"
] | 937 | 2015-07-29T09:25:30.000Z | 2022-03-30T23:54:03.000Z | test/features/steps/crud_table.py | lyrl/mycli | d62eefdc819a11ecdb97d93dd7ad1922d28a3795 | [
"BSD-3-Clause"
] | 799 | 2015-07-27T13:13:49.000Z | 2022-03-29T21:24:39.000Z | """Steps for behavioral style tests are defined in this module.
Each step is defined by the string decorating it. This string is used
to call the step in "*.feature" file.
"""
import wrappers
from behave import when, then
from textwrap import dedent
@when('we create table')
def step_create_table(context):
"""S... | 26.274336 | 74 | 0.629505 |
import wrappers
from behave import when, then
from textwrap import dedent
@when('we create table')
def step_create_table(context):
context.cli.sendline('create table a(x text);')
@when('we insert into table')
def step_insert_into_table(context):
context.cli.sendline('''insert into a(x) values('xxx');''')
... | true | true |
f715f0d86c7d1a3a041efd85461b676d0a329b65 | 395 | py | Python | django_dapp/migrations/0005_application_default.py | phonkee/django-desktopapp | bd89434470c9d80074e8911d24059f962934c52a | [
"MIT"
] | null | null | null | django_dapp/migrations/0005_application_default.py | phonkee/django-desktopapp | bd89434470c9d80074e8911d24059f962934c52a | [
"MIT"
] | null | null | null | django_dapp/migrations/0005_application_default.py | phonkee/django-desktopapp | bd89434470c9d80074e8911d24059f962934c52a | [
"MIT"
] | null | null | null | # Generated by Django 2.2 on 2019-04-12 22:21
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('django_dapp', '0004_auto_20190412_2138'),
]
operations = [
migrations.AddField(
model_name='application',
name='defaul... | 20.789474 | 53 | 0.610127 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('django_dapp', '0004_auto_20190412_2138'),
]
operations = [
migrations.AddField(
model_name='application',
name='default',
field=models.BooleanField(defa... | true | true |
f715f13073c90b7260a27beedc68a5672549e84b | 1,221 | py | Python | desktop/libs/notebook/setup.py | kokosing/hue | 2307f5379a35aae9be871e836432e6f45138b3d9 | [
"Apache-2.0"
] | 5,079 | 2015-01-01T03:39:46.000Z | 2022-03-31T07:38:22.000Z | desktop/libs/notebook/setup.py | zks888/hue | 93a8c370713e70b216c428caa2f75185ef809deb | [
"Apache-2.0"
] | 1,623 | 2015-01-01T08:06:24.000Z | 2022-03-30T19:48:52.000Z | desktop/libs/notebook/setup.py | zks888/hue | 93a8c370713e70b216c428caa2f75185ef809deb | [
"Apache-2.0"
] | 2,033 | 2015-01-04T07:18:02.000Z | 2022-03-28T19:55:47.000Z | # Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file ex... | 42.103448 | 74 | 0.72154 | from setuptools import setup, find_packages
from hueversion import VERSION
setup(
name = "notebook",
version = VERSION,
author = "Hue",
url = 'http://github.com/cloudera/hue',
description = "Type various snippets of code",
packages = find_packages('src'),
package_dir = {'': 's... | true | true |
f715f2ea5f3929680f1eec4293377f802b326b46 | 103 | py | Python | game/urls.py | BehindLoader/strategy-try | f7f0007515804b2078bb18ae831a326e6e338bbd | [
"MIT"
] | null | null | null | game/urls.py | BehindLoader/strategy-try | f7f0007515804b2078bb18ae831a326e6e338bbd | [
"MIT"
] | null | null | null | game/urls.py | BehindLoader/strategy-try | f7f0007515804b2078bb18ae831a326e6e338bbd | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path('get_all', views.get_all)
] | 14.714286 | 34 | 0.708738 | from django.urls import path
from . import views
urlpatterns = [
path('get_all', views.get_all)
] | true | true |
f715f3a67df36230e6e7a6cbb43f59bd83e295a2 | 4,603 | py | Python | pipeline/service/pipeline_engine_adapter/adapter_api.py | sdgdsffdsfff/bk-sops-tencent | e8aff91f822e79031e12b0f66943830f44ced506 | [
"Apache-2.0"
] | 1 | 2020-09-24T07:39:16.000Z | 2020-09-24T07:39:16.000Z | pipeline/service/pipeline_engine_adapter/adapter_api.py | sdgdsffdsfff/bk-sops-tencent | e8aff91f822e79031e12b0f66943830f44ced506 | [
"Apache-2.0"
] | 5 | 2021-02-08T20:46:54.000Z | 2021-06-10T22:54:45.000Z | pipeline/service/pipeline_engine_adapter/adapter_api.py | sdgdsffdsfff/bk-sops-tencent | e8aff91f822e79031e12b0f66943830f44ced506 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2020 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 27.39881 | 115 | 0.718662 |
from pipeline.engine import api
from pipeline.log.models import LogEntry
STATE_MAP = {
'CREATED': 'RUNNING',
'READY': 'RUNNING',
'RUNNING': 'RUNNING',
'BLOCKED': 'BLOCKED',
'SUSPENDED': 'SUSPENDED',
'FINISHED': 'FINISHED',
'FAILED': 'FAILED',
'REVOKED': 'REVOKED'
}
def run_pipeline(p... | true | true |
f715f47669d217a83d920335ed050f78d844a22c | 5,720 | py | Python | examples/jsonrpc/JSONRPCExample.py | allbuttonspressed/pyjs | c726fdead530eb63ee4763ae15daaa58d84cd58f | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | examples/jsonrpc/JSONRPCExample.py | allbuttonspressed/pyjs | c726fdead530eb63ee4763ae15daaa58d84cd58f | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | examples/jsonrpc/JSONRPCExample.py | allbuttonspressed/pyjs | c726fdead530eb63ee4763ae15daaa58d84cd58f | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2019-11-18T14:17:59.000Z | 2019-11-18T14:17:59.000Z | import pyjd # dummy in pyjs
from pyjamas.ui.RootPanel import RootPanel
from pyjamas.ui.TextArea import TextArea
from pyjamas.ui.Label import Label
from pyjamas.ui.Button import Button
from pyjamas.ui.HTML import HTML
from pyjamas.ui.VerticalPanel import VerticalPanel
from pyjamas.ui.HorizontalPanel import HorizontalPa... | 38.389262 | 122 | 0.618706 | import pyjd
from pyjamas.ui.RootPanel import RootPanel
from pyjamas.ui.TextArea import TextArea
from pyjamas.ui.Label import Label
from pyjamas.ui.Button import Button
from pyjamas.ui.HTML import HTML
from pyjamas.ui.VerticalPanel import VerticalPanel
from pyjamas.ui.HorizontalPanel import HorizontalPanel
from pyjamas... | true | true |
f715f48de694a6699da344700b6ccc25623f65f8 | 59,016 | py | Python | haystack/nodes/reader/farm.py | ZanSara/haystack | b2e6dcc99899d9ad728d21f925c5300632683d4d | [
"Apache-2.0"
] | 1 | 2022-02-20T02:04:49.000Z | 2022-02-20T02:04:49.000Z | haystack/nodes/reader/farm.py | shenyezh/haystack | 2a674eaff7d711f38db1bd57ece9bb632fb928bd | [
"Apache-2.0"
] | null | null | null | haystack/nodes/reader/farm.py | shenyezh/haystack | 2a674eaff7d711f38db1bd57ece9bb632fb928bd | [
"Apache-2.0"
] | null | null | null | from typing import List, Optional, Dict, Any, Union, Callable
import logging
import multiprocessing
from pathlib import Path
from collections import defaultdict
from time import perf_counter
import torch
from haystack.modeling.data_handler.data_silo import DataSilo, DistillationDataSilo
from haystack.modeling.data_ha... | 51.407666 | 344 | 0.62561 | from typing import List, Optional, Dict, Any, Union, Callable
import logging
import multiprocessing
from pathlib import Path
from collections import defaultdict
from time import perf_counter
import torch
from haystack.modeling.data_handler.data_silo import DataSilo, DistillationDataSilo
from haystack.modeling.data_ha... | true | true |
f715f9eec1999c4f7c88c87f57493937d98df307 | 8,387 | py | Python | thor/orbit.py | B612-Asteroid-Institute/thor | d3d1dcbe86f67a62c90b4cde3fc577e414825cf2 | [
"BSD-3-Clause"
] | null | null | null | thor/orbit.py | B612-Asteroid-Institute/thor | d3d1dcbe86f67a62c90b4cde3fc577e414825cf2 | [
"BSD-3-Clause"
] | null | null | null | thor/orbit.py | B612-Asteroid-Institute/thor | d3d1dcbe86f67a62c90b4cde3fc577e414825cf2 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
from .utils import _checkTime
from .vectors import calcNae
from .vectors import calcDelta
from .vectors import calcXae
from .vectors import calcXa
from .vectors import calcNhat
from .vectors import calcR1
from .vectors import calcR2
from .projections import cartesianToGnomonic
from .coordinates impo... | 37.779279 | 124 | 0.582211 | import numpy as np
from .utils import _checkTime
from .vectors import calcNae
from .vectors import calcDelta
from .vectors import calcXae
from .vectors import calcXa
from .vectors import calcNhat
from .vectors import calcR1
from .vectors import calcR2
from .projections import cartesianToGnomonic
from .coordinates impo... | true | true |
f715fa3d62c55bf4f7f70f4b2e9a10454d261c5c | 2,848 | py | Python | python/test/testutil.py | AppScale/appengine-pipelines | 277394648dac3e8214677af898935d07399ac8e1 | [
"Apache-2.0"
] | 82 | 2015-01-13T03:24:32.000Z | 2021-10-09T04:08:27.000Z | python/test/testutil.py | AppScale/appengine-pipelines | 277394648dac3e8214677af898935d07399ac8e1 | [
"Apache-2.0"
] | 57 | 2015-01-27T00:12:36.000Z | 2020-10-30T16:47:05.000Z | python/test/testutil.py | AppScale/appengine-pipelines | 277394648dac3e8214677af898935d07399ac8e1 | [
"Apache-2.0"
] | 58 | 2015-01-22T21:32:26.000Z | 2021-10-09T04:08:19.000Z | #!/usr/bin/env python
#
# Copyright 2009 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 34.313253 | 84 | 0.720857 |
import logging
import os
import sys
import tempfile
class TestSetupMixin(object):
TEST_APP_ID = 'my-app-id'
TEST_VERSION_ID = 'my-version.1234'
def setUp(self):
super(TestSetupMixin, self).setUp()
from google.appengine.api import apiproxy_stub_map
from google.appengine.api import memcache
f... | true | true |
f715fb59542e094790abdec20a4091318946f4e3 | 1,283 | py | Python | ParserTest/ParserTest.py | isaacrez/ShowdownParser | 965d5b35968978ad5101f3df3deede3219284154 | [
"MIT"
] | null | null | null | ParserTest/ParserTest.py | isaacrez/ShowdownParser | 965d5b35968978ad5101f3df3deede3219284154 | [
"MIT"
] | null | null | null | ParserTest/ParserTest.py | isaacrez/ShowdownParser | 965d5b35968978ad5101f3df3deede3219284154 | [
"MIT"
] | null | null | null |
import unittest
from ParserTest.TestUtil import *
class TestParserMethods(unittest.TestCase):
DIRECT_KOs_ID = 2
PASSIVE_KOs_ID = 3
DEATHS_ID = 4
def test_direct_KO(self):
pokemon_data = {
"Raichu-Alola": ["p1", "Stokin' Dude!"],
"Magikarp": ["p2", "A Karp"]
}
... | 27.891304 | 70 | 0.600156 |
import unittest
from ParserTest.TestUtil import *
class TestParserMethods(unittest.TestCase):
DIRECT_KOs_ID = 2
PASSIVE_KOs_ID = 3
DEATHS_ID = 4
def test_direct_KO(self):
pokemon_data = {
"Raichu-Alola": ["p1", "Stokin' Dude!"],
"Magikarp": ["p2", "A Karp"]
}
... | true | true |
f715fcdc9f378810a87d7cb126f42c12bd2af0f1 | 1,256 | py | Python | gan_test.py | Aitical/ADspeech2face | 2e811ff8cc7333729f4b77d1b1067296253e8e38 | [
"MIT"
] | 1 | 2022-01-27T14:19:04.000Z | 2022-01-27T14:19:04.000Z | gan_test.py | Aitical/ADspeech2face | 2e811ff8cc7333729f4b77d1b1067296253e8e38 | [
"MIT"
] | null | null | null | gan_test.py | Aitical/ADspeech2face | 2e811ff8cc7333729f4b77d1b1067296253e8e38 | [
"MIT"
] | null | null | null | import os
import glob
import torch
import torchvision.utils as vutils
import webrtcvad
from mfcc import MFCC
from utils import voice2face
from tqdm import tqdm
import sys
from parse_config import get_model
import importlib
# initialization
vad_obj = webrtcvad.Vad(2)
mfc_obj = MFCC(nfilt=64, lowerf=20., upperf=7200., s... | 33.052632 | 89 | 0.755573 | import os
import glob
import torch
import torchvision.utils as vutils
import webrtcvad
from mfcc import MFCC
from utils import voice2face
from tqdm import tqdm
import sys
from parse_config import get_model
import importlib
vad_obj = webrtcvad.Vad(2)
mfc_obj = MFCC(nfilt=64, lowerf=20., upperf=7200., samprate=16000, nf... | true | true |
f715fd4edad72a3f3aef57ff6fe4ac57d3a4a5ee | 4,645 | py | Python | Jokey/main.py | MilesWJ/Jokey | 9d9ead1e4e643d4947327635d97a1320b898138a | [
"Unlicense"
] | null | null | null | Jokey/main.py | MilesWJ/Jokey | 9d9ead1e4e643d4947327635d97a1320b898138a | [
"Unlicense"
] | null | null | null | Jokey/main.py | MilesWJ/Jokey | 9d9ead1e4e643d4947327635d97a1320b898138a | [
"Unlicense"
] | null | null | null | from datetime import datetime
import discord
from discord.ext import commands, tasks
from discord_slash import SlashCommand, SlashContext
from discord_slash.utils.manage_commands import create_option, create_choice
from json import loads
from itertools import cycle
from random import choice
from urllib import request
... | 25.382514 | 146 | 0.60366 | from datetime import datetime
import discord
from discord.ext import commands, tasks
from discord_slash import SlashCommand, SlashContext
from discord_slash.utils.manage_commands import create_option, create_choice
from json import loads
from itertools import cycle
from random import choice
from urllib import request
... | false | true |
f715fde92dd9503f60b1a71b39a46e6d2f9e42ad | 8,020 | py | Python | yatsm/cache.py | bullocke/yatsm_nrt | b0ded56032bf9f9dcdf6b7b749f6554ade56de1e | [
"MIT"
] | 2 | 2018-04-25T02:10:30.000Z | 2021-07-30T03:57:49.000Z | yatsm/cache.py | bullocke/yatsm_nrt | b0ded56032bf9f9dcdf6b7b749f6554ade56de1e | [
"MIT"
] | null | null | null | yatsm/cache.py | bullocke/yatsm_nrt | b0ded56032bf9f9dcdf6b7b749f6554ade56de1e | [
"MIT"
] | 1 | 2017-04-01T16:11:52.000Z | 2017-04-01T16:11:52.000Z | """ Functions related to writing to and retrieving from cache files
"""
import os
import numpy as np
from log_yatsm import logger
_image_ID_str = 'image_IDs'
def get_line_cache_name(dataset_config, n_images, row, nbands):
""" Returns cache filename for specified config and line number
Args:
datase... | 33.983051 | 79 | 0.646758 | import os
import numpy as np
from log_yatsm import logger
_image_ID_str = 'image_IDs'
def get_line_cache_name(dataset_config, n_images, row, nbands):
path = dataset_config.get('cache_line_dir')
if not path:
return
filename = 'yatsm_r%i_n%i_b%i.npy.npz' % (row, n_images, nbands)
return os.... | true | true |
f715fe7e69213de66aedfbfecdb0bdd840ada5fd | 985 | py | Python | examples/plot_hue.py | mewbak/hypertools | bc2947737be8bd5a6e2a3bdca84132f6fee8989c | [
"MIT"
] | 1,681 | 2017-01-28T00:28:02.000Z | 2022-03-11T00:57:13.000Z | examples/plot_hue.py | mewbak/hypertools | bc2947737be8bd5a6e2a3bdca84132f6fee8989c | [
"MIT"
] | 170 | 2017-01-27T22:59:09.000Z | 2022-02-12T03:47:46.000Z | examples/plot_hue.py | mewbak/hypertools | bc2947737be8bd5a6e2a3bdca84132f6fee8989c | [
"MIT"
] | 180 | 2017-02-01T04:34:42.000Z | 2022-02-22T15:46:23.000Z | # -*- coding: utf-8 -*-
"""
=============================
Grouping data by category
=============================
When plotting, its useful to have a way to color points by some category or
variable. Hypertools does this using the `hue` kwarg, which takes a list
of string category labels or numerical values. If text... | 26.621622 | 78 | 0.683249 |
import hypertools as hyp
import numpy as np
geo = hyp.load('weights_sample')
data = geo.get_data()
hue=[]
for idx,i in enumerate(data):
tmp=[]
for iidx,ii in enumerate(i):
tmp.append(int(np.random.randint(1000, size=1)))
hue.append(tmp)
geo.plot(fmt='.', hue=hue)
| true | true |
f715ff5939535a01e6aa0c240e3f32c7ba477d37 | 1,866 | py | Python | labyrinth_generator.py | ImTheTom/labyrinth-explorer | 56fa7590aa93e11d0f2bc53f58de2194227a4034 | [
"MIT"
] | null | null | null | labyrinth_generator.py | ImTheTom/labyrinth-explorer | 56fa7590aa93e11d0f2bc53f58de2194227a4034 | [
"MIT"
] | null | null | null | labyrinth_generator.py | ImTheTom/labyrinth-explorer | 56fa7590aa93e11d0f2bc53f58de2194227a4034 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
#
# Python Script
#
# Copyleft © Manoel Vilela
#
#
WIDTH,HEIGHT = 2,3
from random import shuffle, randrange
def make_maze(w=WIDTH, h=HEIGHT):
vis = [[0] * w + [1] for _ in range(h)] + [[1] * (w + 1)]
nowalls = []
def walk(x, y):
vis[x][y] = 1
d =... | 21.448276 | 66 | 0.505895 |
WIDTH,HEIGHT = 2,3
from random import shuffle, randrange
def make_maze(w=WIDTH, h=HEIGHT):
vis = [[0] * w + [1] for _ in range(h)] + [[1] * (w + 1)]
nowalls = []
def walk(x, y):
vis[x][y] = 1
d = [(x - 1, y), (x, y + 1), (x + 1, y), (x, y - 1)]
shuffle(d)
for (x_n, y_n... | true | true |
f715ffab1cd92657d37ddc8d113efdafe9821bad | 8,233 | py | Python | preprocess.py | gewoonrik/pullreqs-dnn | dbafd1866c1cd44424d238618e5ca54841c358c0 | [
"MIT"
] | 1 | 2017-02-17T06:51:36.000Z | 2017-02-17T06:51:36.000Z | preprocess.py | gewoonrik/pullreqs-dnn | dbafd1866c1cd44424d238618e5ca54841c358c0 | [
"MIT"
] | null | null | null | preprocess.py | gewoonrik/pullreqs-dnn | dbafd1866c1cd44424d238618e5ca54841c358c0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# (c) 2016 -- onwards Georgios Gousios <gousiosg@gmail.com>, Rik Nijessen <riknijessen@gmail.com>
#
from __future__ import print_function
import pickle
import random
import urllib
import numpy as np
import argparse
from config import *
from code_tokenizer import CodeTokenizer
from my_tokeniz... | 34.161826 | 213 | 0.703146 |
from __future__ import print_function
import pickle
import random
import urllib
import numpy as np
import argparse
from config import *
from code_tokenizer import CodeTokenizer
from my_tokenizer import MyTokenizer
from keras.preprocessing.sequence import pad_sequences
@timeit
def load_pr_csv(file):
print("Loa... | true | true |
f71601eb739410c4a90886b6aae0725f85a7eaed | 5,879 | py | Python | test/functional/p2p_fingerprint.py | PitTxid/bitgreen | 5168cb2db2a3f9d4f32b14c4224e1f41f0e69566 | [
"MIT"
] | 14 | 2019-08-02T21:00:14.000Z | 2020-06-22T17:23:05.000Z | test/functional/p2p_fingerprint.py | PitTxid/bitgreen | 5168cb2db2a3f9d4f32b14c4224e1f41f0e69566 | [
"MIT"
] | 7 | 2019-08-05T23:43:17.000Z | 2020-07-17T17:26:54.000Z | test/functional/p2p_fingerprint.py | PitTxid/bitgreen | 5168cb2db2a3f9d4f32b14c4224e1f41f0e69566 | [
"MIT"
] | 25 | 2019-05-21T01:59:54.000Z | 2020-10-18T14:09:38.000Z | #!/usr/bin/env python3
# Copyright (c) 2017-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test various fingerprinting protections.
If a stale block more than a month old or its header are requ... | 39.456376 | 110 | 0.691274 |
import time
from test_framework.blocktools import (create_block, create_coinbase)
from test_framework.messages import CInv
from test_framework.mininode import (
P2PInterface,
msg_headers,
msg_block,
msg_getdata,
msg_getheaders,
)
from test_framework.test_framework import BitGreenTestFramework
from... | true | true |
f71603f6109caf0554c9841dcf750730f5a4c731 | 760 | py | Python | backend/gardenator_backend/urls.py | maany/gardenator | 0dd02a323a71d996aeb970c730a48306c280d29e | [
"Apache-2.0"
] | null | null | null | backend/gardenator_backend/urls.py | maany/gardenator | 0dd02a323a71d996aeb970c730a48306c280d29e | [
"Apache-2.0"
] | null | null | null | backend/gardenator_backend/urls.py | maany/gardenator | 0dd02a323a71d996aeb970c730a48306c280d29e | [
"Apache-2.0"
] | null | null | null | """gardenator_backend URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
... | 34.545455 | 77 | 0.713158 | from django.contrib import admin
from django.urls import path
urlpatterns = [
path('admin/', admin.site.urls),
]
| true | true |
f716050ed51f07345c48ef2000b6e1a8b2a7e2de | 17,065 | py | Python | Ui_polkitex.py | Trapizomba/Polkit-Explorer | 59c9662f07a65b0aa7197418d0036501fd533793 | [
"0BSD"
] | null | null | null | Ui_polkitex.py | Trapizomba/Polkit-Explorer | 59c9662f07a65b0aa7197418d0036501fd533793 | [
"0BSD"
] | null | null | null | Ui_polkitex.py | Trapizomba/Polkit-Explorer | 59c9662f07a65b0aa7197418d0036501fd533793 | [
"0BSD"
] | null | null | null | # -*- coding: utf-8 -*-
################################################################################
## Form generated from reading UI file 'polkitex.ui'
##
## Created by: Qt User Interface Compiler version 6.2.3
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
##################... | 58.242321 | 344 | 0.73097 |
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
QMetaObject, QObject, QPoint, QRect,
QSize, QTime, QUrl, Qt)
from PySide6.QtGui import (QAction, QBrush, QColor, QConicalGradient,
QCursor, QFont, QFontDatabase, QGradient,
QIcon, QImage, QKeySequence, QLinearGradient,
QPaint... | true | true |
f71605a096a836f32d317bfc1b1b9c580b670ceb | 2,301 | py | Python | pymatflow/scripts/nebmake.py | DeqiTang/pymatflow | bd8776feb40ecef0e6704ee898d9f42ded3b0186 | [
"MIT"
] | 6 | 2020-03-06T16:13:08.000Z | 2022-03-09T07:53:34.000Z | pymatflow/scripts/nebmake.py | DeqiTang/pymatflow | bd8776feb40ecef0e6704ee898d9f42ded3b0186 | [
"MIT"
] | 1 | 2021-10-02T02:23:08.000Z | 2021-11-08T13:29:37.000Z | pymatflow/scripts/nebmake.py | DeqiTang/pymatflow | bd8776feb40ecef0e6704ee898d9f42ded3b0186 | [
"MIT"
] | 1 | 2021-07-10T16:28:14.000Z | 2021-07-10T16:28:14.000Z | #!/usr/bin/env python
import os
import argparse
from pymatflow.structure.neb import interpolate
from pymatflow.cmd.structflow import read_structure
from pymatflow.cmd.structflow import write_structure
def main():
parser = argparse.ArgumentParser()
parser.add_argument("-i", "--images", type=s... | 39.672414 | 129 | 0.567579 |
import os
import argparse
from pymatflow.structure.neb import interpolate
from pymatflow.cmd.structflow import read_structure
from pymatflow.cmd.structflow import write_structure
def main():
parser = argparse.ArgumentParser()
parser.add_argument("-i", "--images", type=str, nargs=2,
... | true | true |
f716060870df940910dece369b5b6bf64ae01993 | 13,519 | py | Python | flexget/components/ftp/sftp.py | gjhenrique/Flexget | 2dae4c7e3d002600adcce3b67c399fda115d5ce2 | [
"MIT"
] | null | null | null | flexget/components/ftp/sftp.py | gjhenrique/Flexget | 2dae4c7e3d002600adcce3b67c399fda115d5ce2 | [
"MIT"
] | null | null | null | flexget/components/ftp/sftp.py | gjhenrique/Flexget | 2dae4c7e3d002600adcce3b67c399fda115d5ce2 | [
"MIT"
] | null | null | null | from collections import namedtuple
from itertools import groupby
from pathlib import Path
from typing import List, Optional
from urllib.parse import unquote, urlparse
from loguru import logger
from flexget import plugin
from flexget.components.ftp.sftp_client import SftpClient, SftpError
from flexget.config_schema im... | 36.050667 | 112 | 0.609734 | from collections import namedtuple
from itertools import groupby
from pathlib import Path
from typing import List, Optional
from urllib.parse import unquote, urlparse
from loguru import logger
from flexget import plugin
from flexget.components.ftp.sftp_client import SftpClient, SftpError
from flexget.config_schema im... | true | true |
f71609666f0531ac8c06b96d69a4042a2ac3a5bc | 853 | py | Python | paperboy/resources/config.py | datalayer-externals/papermill-paperboy | b27bfdbb4ed27dea597ff1d6346eb831542ae81f | [
"Apache-2.0"
] | 233 | 2018-11-01T09:17:08.000Z | 2022-03-22T08:27:24.000Z | paperboy/resources/config.py | datalayer-externals/papermill-paperboy | b27bfdbb4ed27dea597ff1d6346eb831542ae81f | [
"Apache-2.0"
] | 99 | 2018-10-17T21:48:42.000Z | 2021-05-07T08:33:36.000Z | paperboy/resources/config.py | datalayer-externals/papermill-paperboy | b27bfdbb4ed27dea597ff1d6346eb831542ae81f | [
"Apache-2.0"
] | 29 | 2018-11-01T11:33:08.000Z | 2022-01-12T22:12:19.000Z | import falcon
import json
from .base import BaseResource
class ConfigResource(BaseResource):
'''Falcon resource to get form entries'''
def __init__(self, *args, **kwargs):
super(ConfigResource, self).__init__(*args, **kwargs)
def on_get(self, req, resp):
'''Get configuration page to crea... | 32.807692 | 72 | 0.607268 | import falcon
import json
from .base import BaseResource
class ConfigResource(BaseResource):
def __init__(self, *args, **kwargs):
super(ConfigResource, self).__init__(*args, **kwargs)
def on_get(self, req, resp):
resp.content_type = 'application/json'
type = req.params.get('type', No... | true | true |
f71609b6af41be400030f87cd3c4bfcdfc294a4a | 10,236 | py | Python | READMIT/alpha/fp_VBHC_READMIT_BEA_FIPS_alpha.py | andrewcistola/value-based-healthcare | 12583c33bff8dee83a7daf5aaaf1e7c39883a279 | [
"MIT"
] | 1 | 2021-03-12T07:11:14.000Z | 2021-03-12T07:11:14.000Z | READMIT/alpha/fp_VBHC_READMIT_BEA_FIPS_alpha.py | andrewcistola/value-based-healthcare | 12583c33bff8dee83a7daf5aaaf1e7c39883a279 | [
"MIT"
] | null | null | null | READMIT/alpha/fp_VBHC_READMIT_BEA_FIPS_alpha.py | andrewcistola/value-based-healthcare | 12583c33bff8dee83a7daf5aaaf1e7c39883a279 | [
"MIT"
] | null | null | null | # FractureProof
## Value Based Healthcare Project
### Outcome
#### CMS Hospital Wiide Readmission Rate 2018
### Predictors
#### BEA 2018 County wide Economic Measures
### Table Key
#### State County FIPS
### Set working directory to project folder
os.chdir("C:/Users/drewc/GitHub/allocativ") # Set wd to project repos... | 45.901345 | 178 | 0.762016 |
os.chdir("C:/Users/drewc/GitHub/allocativ")
title = "fp_VBHC_READMIT_BEA_FIPS_alpha"
path = "fp/VBHC/READMIT/"
import os import sqlite3
import pandas as pd import numpy as np
from sklearn.preprocessing import StandardScaler from sklearn.impute import SimpleImputer
df_bea = pd.read_csv("hnb/BEA/2018/BEA_2018_FIP... | true | true |
f71609b7fa048b07e8e6b96a59e540a8a2785e0a | 2,731 | py | Python | 06_2-paino_buzzer/paino_buzzer.py | sujunmin/gpio-game-console | 23cdde4ae16527993adb89f29f21616b3e12e837 | [
"BSD-3-Clause"
] | null | null | null | 06_2-paino_buzzer/paino_buzzer.py | sujunmin/gpio-game-console | 23cdde4ae16527993adb89f29f21616b3e12e837 | [
"BSD-3-Clause"
] | null | null | null | 06_2-paino_buzzer/paino_buzzer.py | sujunmin/gpio-game-console | 23cdde4ae16527993adb89f29f21616b3e12e837 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
#+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
#|R|a|s|p|b|e|r|r|y|P|i|.|c|o|m|.|t|w|
#+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
# Copyright (c) 2016, raspberrypi.com.tw
# All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# paino_buzzer.py... | 28.447917 | 93 | 0.697181 |
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BOARD)
BUZZER_PIN = 7
BTN_PIN_0 = 11
BTN_PIN_1 = 12
BTN_PIN_2 = 13
BTN_PIN_3 = 15
BTN_PIN_4 = 16
BTN_PIN_5 = 18
BTN_PIN_6 = 22
MELODY_DO = 523
MELODY_RE = 587
MELODY_ME = 659
MELODY_FA = 698
MELODY_SO = 784
MELODY_LA = 880
MELODY_SI = 988
WAIT_TIME = 200
DURATI... | false | true |
f7160b02cd2fe254d7a127f34fecad15c020c378 | 4,926 | py | Python | optimus/engines/base/dataframe/columns.py | niallscc/Optimus | 35218401556e5acc4beb2859084128ebcd1ab4e5 | [
"Apache-2.0"
] | null | null | null | optimus/engines/base/dataframe/columns.py | niallscc/Optimus | 35218401556e5acc4beb2859084128ebcd1ab4e5 | [
"Apache-2.0"
] | null | null | null | optimus/engines/base/dataframe/columns.py | niallscc/Optimus | 35218401556e5acc4beb2859084128ebcd1ab4e5 | [
"Apache-2.0"
] | null | null | null | from functools import reduce
from sklearn.preprocessing import MinMaxScaler, MaxAbsScaler, StandardScaler
from optimus.engines.base.columns import BaseColumns
from optimus.helpers.columns import parse_columns, name_col
from optimus.helpers.constants import Actions
from optimus.helpers.raiseit import RaiseIt
class D... | 35.695652 | 131 | 0.661186 | from functools import reduce
from sklearn.preprocessing import MinMaxScaler, MaxAbsScaler, StandardScaler
from optimus.engines.base.columns import BaseColumns
from optimus.helpers.columns import parse_columns, name_col
from optimus.helpers.constants import Actions
from optimus.helpers.raiseit import RaiseIt
class D... | true | true |
f7160b89bbc0f0135dfed20cc0e5c8f6d06c5128 | 2,407 | py | Python | arviz/wrappers/wrap_pystan.py | brandonwillard/arviz | 1358a04cbb7759a6a15459a3d4e4f7259626484c | [
"Apache-2.0"
] | null | null | null | arviz/wrappers/wrap_pystan.py | brandonwillard/arviz | 1358a04cbb7759a6a15459a3d4e4f7259626484c | [
"Apache-2.0"
] | null | null | null | arviz/wrappers/wrap_pystan.py | brandonwillard/arviz | 1358a04cbb7759a6a15459a3d4e4f7259626484c | [
"Apache-2.0"
] | null | null | null | # pylint: disable=arguments-differ
"""Base class for PyStan wrappers."""
from ..data import from_pystan
from .base import SamplingWrapper
class PyStanSamplingWrapper(SamplingWrapper):
"""PyStan sampling wrapper base class.
See the documentation on :class:`~arviz.SamplingWrapper` for a more detailed
desc... | 41.5 | 90 | 0.687993 | from ..data import from_pystan
from .base import SamplingWrapper
class PyStanSamplingWrapper(SamplingWrapper):
def sel_observations(self, idx):
raise NotImplementedError("sel_observations must be implemented on a model basis")
def sample(self, modified_observed_data):
fit = self.model.sampli... | true | true |
f7160d0ab638df715f56f4ffaaf4cc3e1943ef2c | 1,835 | py | Python | project/server/auth/wrapper.py | RaihanSabique/Flask-Restful-JWT-Auth | a6be0cc72d4f697ac3cdfa41551de9633f6feb35 | [
"MIT"
] | null | null | null | project/server/auth/wrapper.py | RaihanSabique/Flask-Restful-JWT-Auth | a6be0cc72d4f697ac3cdfa41551de9633f6feb35 | [
"MIT"
] | null | null | null | project/server/auth/wrapper.py | RaihanSabique/Flask-Restful-JWT-Auth | a6be0cc72d4f697ac3cdfa41551de9633f6feb35 | [
"MIT"
] | null | null | null | import functools
from flask import Flask, request, make_response, jsonify
from flask_restful import Resource, Api, abort
from project.server.models import User
def login_required(method):
@functools.wraps(method)
def wrapper(self):
auth_header = request.headers.get('Authorization')
if auth_head... | 35.288462 | 61 | 0.559128 | import functools
from flask import Flask, request, make_response, jsonify
from flask_restful import Resource, Api, abort
from project.server.models import User
def login_required(method):
@functools.wraps(method)
def wrapper(self):
auth_header = request.headers.get('Authorization')
if auth_head... | true | true |
f7160d32694f94438915434613085cbed64d24f9 | 4,686 | py | Python | setup.py | itsalexis962/pycroscopy | 8a6557408ffdc332cef102616be16e26a396532f | [
"MIT"
] | 191 | 2016-06-19T18:34:40.000Z | 2022-03-28T08:30:30.000Z | setup.py | itsalexis962/pycroscopy | 8a6557408ffdc332cef102616be16e26a396532f | [
"MIT"
] | 115 | 2016-09-20T22:07:52.000Z | 2022-03-04T20:41:57.000Z | setup.py | itsalexis962/pycroscopy | 8a6557408ffdc332cef102616be16e26a396532f | [
"MIT"
] | 72 | 2016-09-20T10:19:22.000Z | 2022-03-05T12:18:48.000Z | from codecs import open
import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'README.rst')) as f:
long_description = f.read()
with open(os.path.join(here, 'pycroscopy/__version__.py')) as f:
__version__ = f.read().split("'")[1]
... | 43.388889 | 124 | 0.588988 | from codecs import open
import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'README.rst')) as f:
long_description = f.read()
with open(os.path.join(here, 'pycroscopy/__version__.py')) as f:
__version__ = f.read().split("'")[1]
... | true | true |
f7160db0d5fb20f368cc9ea3007c25dccdf69f7c | 4,197 | py | Python | tests/clvm/coin_store.py | Plotter-Network/plotter-blockchain | 13d10557496f37b9a001786ff837bdf34d8f1bcb | [
"Apache-2.0"
] | 1 | 2021-07-10T12:50:30.000Z | 2021-07-10T12:50:30.000Z | tests/clvm/coin_store.py | Plotter-Network/plotter-blockchain | 13d10557496f37b9a001786ff837bdf34d8f1bcb | [
"Apache-2.0"
] | null | null | null | tests/clvm/coin_store.py | Plotter-Network/plotter-blockchain | 13d10557496f37b9a001786ff837bdf34d8f1bcb | [
"Apache-2.0"
] | null | null | null | from collections import defaultdict
from dataclasses import dataclass, replace
from typing import Dict, Iterator, Set
from plotter.full_node.mempool_check_conditions import mempool_check_conditions_dict
from plotter.types.blockchain_format.coin import Coin
from plotter.types.blockchain_format.sized_bytes import bytes3... | 38.861111 | 117 | 0.681677 | from collections import defaultdict
from dataclasses import dataclass, replace
from typing import Dict, Iterator, Set
from plotter.full_node.mempool_check_conditions import mempool_check_conditions_dict
from plotter.types.blockchain_format.coin import Coin
from plotter.types.blockchain_format.sized_bytes import bytes3... | true | true |
f7160e0c8e9137a12f16d8b789254f485f26bc0b | 598 | py | Python | src/lib/datasets/dataset_factory.py | nerminsamet/HPRNet | a23e691102ed50bd24391e6295c74f452592cdae | [
"MIT"
] | 34 | 2021-06-09T16:47:59.000Z | 2022-03-29T08:03:46.000Z | src/lib/datasets/dataset_factory.py | nerminsamet/HPRNet | a23e691102ed50bd24391e6295c74f452592cdae | [
"MIT"
] | 3 | 2021-12-14T11:47:06.000Z | 2022-03-17T04:08:39.000Z | src/lib/datasets/dataset_factory.py | nerminsamet/HPRNet | a23e691102ed50bd24391e6295c74f452592cdae | [
"MIT"
] | 4 | 2021-06-10T07:44:15.000Z | 2021-08-30T07:12:40.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from .sample.multi_pose import MultiPoseDataset
from .sample.landmark import LandmarkDataset
from src.lib.datasets.dataset.coco_hp import COCOHP
from src.lib.datasets.dataset.coco_body import COCOBODY
datase... | 21.357143 | 65 | 0.792642 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from .sample.multi_pose import MultiPoseDataset
from .sample.landmark import LandmarkDataset
from src.lib.datasets.dataset.coco_hp import COCOHP
from src.lib.datasets.dataset.coco_body import COCOBODY
datase... | true | true |
f7160e1009ab83e8020f0a7d0f081242b48b6c74 | 1,089 | py | Python | users/migrations/0001_initial.py | pollitosabroson/retoglobal | 456af32516935fb834c9f78359754614635e9910 | [
"Apache-2.0"
] | null | null | null | users/migrations/0001_initial.py | pollitosabroson/retoglobal | 456af32516935fb834c9f78359754614635e9910 | [
"Apache-2.0"
] | null | null | null | users/migrations/0001_initial.py | pollitosabroson/retoglobal | 456af32516935fb834c9f78359754614635e9910 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-05-10 13:50
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('genres', '0001_initial'),
('hob... | 31.114286 | 114 | 0.56933 | from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('genres', '0001_initial'),
('hobbies', '0001_initial'),
]
operations = [
migrations.Crea... | true | true |
f7160e675c92028bb3c1d073fe9fa38bb5bb5e4a | 1,365 | py | Python | graduation/test/test.py | zhangsh950618/graduation | 9951c3a382e97ec802b6d34aabd4b70011ea83e6 | [
"Apache-2.0"
] | null | null | null | graduation/test/test.py | zhangsh950618/graduation | 9951c3a382e97ec802b6d34aabd4b70011ea83e6 | [
"Apache-2.0"
] | null | null | null | graduation/test/test.py | zhangsh950618/graduation | 9951c3a382e97ec802b6d34aabd4b70011ea83e6 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import re
import datetime
import math
import numpy as np
a = "赞[123]"
a_re = re.compile("赞.*")
print a_re.findall(a)
a = "今天"
if a == "今天":
print "yes"
print ((datetime.datetime.now() - datetime.timedelta(minutes=2)).strftime("%Y-%m-%d %H:%M"))
a = u"评论[10]"
a_re = re.compile(u'^评论\[\d+\]$... | 17.278481 | 92 | 0.552381 | import re
import datetime
import math
import numpy as np
a = "赞[123]"
a_re = re.compile("赞.*")
print a_re.findall(a)
a = "今天"
if a == "今天":
print "yes"
print ((datetime.datetime.now() - datetime.timedelta(minutes=2)).strftime("%Y-%m-%d %H:%M"))
a = u"评论[10]"
a_re = re.compile(u'^评论\[\d+\]$')
if a_re.match(a):
... | false | true |
f7160f1c838fc7c07e3729784983c83446032a75 | 8,147 | py | Python | mctsPlayer.py | dspub99/betazero | b1adf9885166e6fb4974952292653efeea1b19dc | [
"MIT"
] | 11 | 2018-11-23T10:48:00.000Z | 2020-11-24T07:51:32.000Z | mctsPlayer.py | dspub99/betazero | b1adf9885166e6fb4974952292653efeea1b19dc | [
"MIT"
] | null | null | null | mctsPlayer.py | dspub99/betazero | b1adf9885166e6fb4974952292653efeea1b19dc | [
"MIT"
] | 1 | 2018-11-25T15:43:41.000Z | 2018-11-25T15:43:41.000Z | #!/usr/bin/env python
import numpy as np
from randomPlayer import RandomPlayer
import game
import play
# Run MCTS with MC to estimate the rest of the game.
# http://mcts.ai/about/index.html
# http://ccg.doc.gold.ac.uk/wp-content/uploads/2016/10/browne_tciaig12_1.pdf
class UCT:
def __init__(self, c):
sel... | 31.577519 | 139 | 0.551737 |
import numpy as np
from randomPlayer import RandomPlayer
import game
import play
class UCT:
def __init__(self, c):
self._c = c
def parts(self, pNode, node):
return (node.sum/node.n, 2*self._c*np.sqrt(2*np.log(pNode.n) / node.n))
def __call__(self, pNode, node):
if node.n == 0:
... | true | true |
f7161020c4bf4dad2c0c0ebf7e4bb050b02a52e1 | 15,471 | py | Python | tests/controllers/test_api_controller.py | Moesif/moesifapi-python | c1e8b0feab51fdd830154bf981a102c5162943ac | [
"Apache-2.0"
] | 5 | 2017-01-28T17:09:28.000Z | 2020-03-10T19:59:31.000Z | tests/controllers/test_api_controller.py | Moesif/moesifapi-python | c1e8b0feab51fdd830154bf981a102c5162943ac | [
"Apache-2.0"
] | null | null | null | tests/controllers/test_api_controller.py | Moesif/moesifapi-python | c1e8b0feab51fdd830154bf981a102c5162943ac | [
"Apache-2.0"
] | 1 | 2019-05-12T18:37:28.000Z | 2019-05-12T18:37:28.000Z | # -*- coding: utf-8 -*-
"""
tests.controllers.test_api_controller
"""
import jsonpickle
from .controller_test_base import *
from moesifapi.models import *
from datetime import *
class ApiControllerTests(ControllerTestBase):
@classmethod
def setUpClass(cls):
super(ApiControllerTests, cls).setUp... | 82.73262 | 8,873 | 0.548316 |
import jsonpickle
from .controller_test_base import *
from moesifapi.models import *
from datetime import *
class ApiControllerTests(ControllerTestBase):
@classmethod
def setUpClass(cls):
super(ApiControllerTests, cls).setUpClass()
cls.controller = cls.api_client.api
def test_add_ev... | true | true |
f716105610f9aba80608e6aac525ea5bef34d12c | 2,465 | py | Python | lib/ruleset_apply.py | brennonyork/budget-buddy | f64dc5ab5248794f101cc704e3754b2882f1d3c3 | [
"MIT"
] | null | null | null | lib/ruleset_apply.py | brennonyork/budget-buddy | f64dc5ab5248794f101cc704e3754b2882f1d3c3 | [
"MIT"
] | null | null | null | lib/ruleset_apply.py | brennonyork/budget-buddy | f64dc5ab5248794f101cc704e3754b2882f1d3c3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Arg1 - ruleset file that contains all rulesets
# Arg2 - cleaned, sorted single file with all transactions
#
# Transforms a given file - Arg2 - into the column set form below
# with the rulesets written and applied for the given financial
# source - Arg1
import re
import sys
if len(sys.argv) ... | 37.923077 | 105 | 0.574037 |
import re
import sys
if len(sys.argv) < 3:
print("ERROR: need to supply a ruleset file and transaction file")
exit()
ruleset_file = sys.argv[1]
merge_file = sys.argv[2]
incl_history = None
if len(sys.argv) == 4:
incl_history = sys.argv[3]
rule_map = []
with open(ruleset_file, 'r') as rules:
for... | true | true |
f71610eccde5fef5a72814ac19d392b5c15c9201 | 7,703 | py | Python | src/sage/groups/matrix_gps/unitary.py | bopopescu/sage-5 | 9d85b34956ca2edd55af307f99c5d3859acd30bf | [
"BSL-1.0"
] | 5 | 2015-01-04T07:15:06.000Z | 2022-03-04T15:15:18.000Z | src/sage/groups/matrix_gps/unitary.py | bopopescu/sage-5 | 9d85b34956ca2edd55af307f99c5d3859acd30bf | [
"BSL-1.0"
] | null | null | null | src/sage/groups/matrix_gps/unitary.py | bopopescu/sage-5 | 9d85b34956ca2edd55af307f99c5d3859acd30bf | [
"BSL-1.0"
] | 10 | 2016-09-28T13:12:40.000Z | 2022-02-12T09:28:34.000Z | r"""
Unitary Groups `GU(n,q)` and `SU(n,q)`
These are `n \times n` unitary matrices with entries in
`GF(q^2)`.
EXAMPLES::
sage: G = SU(3,5)
sage: G.order()
378000
sage: G
Special Unitary Group of degree 3 over Finite Field in a of size 5^2
sage: G.gens()
(
[ a 0 0] [... | 29.288973 | 82 | 0.537583 |
from sage.rings.all import ZZ, is_FiniteField, GF
from sage.misc.latex import latex
from sage.groups.matrix_gps.named_group import (
normalize_args_vectorspace, NamedMatrixGroup_generic, NamedMatrixGroup_gap )
def finite_field_sqrt(ring):
if not is_FiniteField(ring):
raise ValueError('not a finite f... | true | true |
f71611444874d1fdc566b5e40bd2782abdfab6c2 | 3,694 | py | Python | more_one_memo/slack/model/response.py | nonylene/more-one-memo | 2c1007bb0bbafe47cba1ac63f237cd4aa66c3374 | [
"MIT"
] | 1 | 2018-06-07T01:20:42.000Z | 2018-06-07T01:20:42.000Z | more_one_memo/slack/model/response.py | nonylene/more-one-memo | 2c1007bb0bbafe47cba1ac63f237cd4aa66c3374 | [
"MIT"
] | 5 | 2021-06-02T00:13:17.000Z | 2022-02-26T23:38:56.000Z | more_one_memo/slack/model/response.py | nonylene/more-one-memo | 2c1007bb0bbafe47cba1ac63f237cd4aa66c3374 | [
"MIT"
] | null | null | null | from typing import List, Optional
from dataclasses import dataclass
UserID = str
BotID = str
ChannelID = str
@dataclass
class Channel:
"""
https://api.slack.com/types/channel
"""
id: ChannelID
name: str
is_archived: bool
is_member: bool
@staticmethod
def from_json(json: dict):
... | 22.387879 | 88 | 0.600433 | from typing import List, Optional
from dataclasses import dataclass
UserID = str
BotID = str
ChannelID = str
@dataclass
class Channel:
id: ChannelID
name: str
is_archived: bool
is_member: bool
@staticmethod
def from_json(json: dict):
return Channel(json['id'], json['name'], json['is_... | true | true |
f716116e261e01c85b7274d3654d5b780989190b | 2,740 | py | Python | platform/radio/efr32_multiphy_configurator/pyradioconfig/parts/sol/phys/Phys_Studio_LongRange.py | PascalGuenther/gecko_sdk | 2e82050dc8823c9fe0e8908c1b2666fb83056230 | [
"Zlib"
] | 82 | 2016-06-29T17:24:43.000Z | 2021-04-16T06:49:17.000Z | platform/radio/efr32_multiphy_configurator/pyradioconfig/parts/sol/phys/Phys_Studio_LongRange.py | PascalGuenther/gecko_sdk | 2e82050dc8823c9fe0e8908c1b2666fb83056230 | [
"Zlib"
] | 6 | 2022-01-12T18:22:08.000Z | 2022-03-25T10:19:27.000Z | platform/radio/efr32_multiphy_configurator/pyradioconfig/parts/sol/phys/Phys_Studio_LongRange.py | PascalGuenther/gecko_sdk | 2e82050dc8823c9fe0e8908c1b2666fb83056230 | [
"Zlib"
] | 56 | 2016-08-02T10:50:50.000Z | 2021-07-19T08:57:34.000Z | from pyradioconfig.parts.ocelot.phys.Phys_Studio_LongRange import PHYS_OQPSK_LoRa_Ocelot
from pyradioconfig.calculator_model_framework.decorators.phy_decorators import do_not_inherit_phys
@do_not_inherit_phys
class PHYS_Studio_LongRange_Sol(PHYS_OQPSK_LoRa_Ocelot):
# Owner: Casey Weltzin
# Jira Link: https://... | 46.440678 | 98 | 0.75219 | from pyradioconfig.parts.ocelot.phys.Phys_Studio_LongRange import PHYS_OQPSK_LoRa_Ocelot
from pyradioconfig.calculator_model_framework.decorators.phy_decorators import do_not_inherit_phys
@do_not_inherit_phys
class PHYS_Studio_LongRange_Sol(PHYS_OQPSK_LoRa_Ocelot):
def PHY_Longrange_915M_OQPSK_DSSS8_80p0k... | true | true |
f716119887849d0bffc5971384860939823a8114 | 4,839 | py | Python | tensorflow_datasets/core/dataset_utils.py | Global19-atlassian-net/datasets | db298928fe0e45907fcd61443d2319665a933afc | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/core/dataset_utils.py | Global19-atlassian-net/datasets | db298928fe0e45907fcd61443d2319665a933afc | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/core/dataset_utils.py | Global19-atlassian-net/datasets | db298928fe0e45907fcd61443d2319665a933afc | [
"Apache-2.0"
] | 1 | 2020-08-03T20:19:12.000Z | 2020-08-03T20:19:12.000Z | # coding=utf-8
# Copyright 2020 The TensorFlow Datasets 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 appl... | 34.077465 | 82 | 0.701178 |
import tensorflow.compat.v2 as tf
from tensorflow_datasets.core import tf_compat
from tensorflow_datasets.core import utils
def _eager_dataset_iterator(dataset):
for item in dataset:
flat = tf.nest.flatten(item)
flat = [t if isinstance(t, tf.RaggedTensor) else t.numpy() for t in flat]
yield tf.nest.pa... | true | true |
f71611a25dd8760de2e03dd6de23a77dc59b5b29 | 7,560 | py | Python | datary/datasets/test/test_datasets.py | Datary/python-sdk | 2790a50e1ad262cbe3210665dc34f497625e923d | [
"MIT"
] | null | null | null | datary/datasets/test/test_datasets.py | Datary/python-sdk | 2790a50e1ad262cbe3210665dc34f497625e923d | [
"MIT"
] | null | null | null | datary/datasets/test/test_datasets.py | Datary/python-sdk | 2790a50e1ad262cbe3210665dc34f497625e923d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Datary python sdk Datasets test file
"""
import mock
from datary.test.test_datary import DataryTestCase
from datary.test.mock_requests import MockRequestResponse
class DataryDatasetsTestCase(DataryTestCase):
"""
DataryDatasets Test case
"""
@mock.patch('datary.requests.re... | 37.98995 | 79 | 0.668915 | import mock
from datary.test.test_datary import DataryTestCase
from datary.test.mock_requests import MockRequestResponse
class DataryDatasetsTestCase(DataryTestCase):
@mock.patch('datary.requests.requests.requests.get')
def test_get_kern(self, mock_request):
mock_request.return_value = MockRequestR... | true | true |
f71612467e9b5dc259949c2813d2f39841a075f0 | 78 | py | Python | src/main.py | jadmz/pygame-box2d-template | cd5ef75940b1c919aade5acb11924cbfba8e7c60 | [
"MIT"
] | null | null | null | src/main.py | jadmz/pygame-box2d-template | cd5ef75940b1c919aade5acb11924cbfba8e7c60 | [
"MIT"
] | null | null | null | src/main.py | jadmz/pygame-box2d-template | cd5ef75940b1c919aade5acb11924cbfba8e7c60 | [
"MIT"
] | 1 | 2020-03-22T18:20:54.000Z | 2020-03-22T18:20:54.000Z | from game import Game
game = Game("Pygame with Box2d Template")
game.run()
| 11.142857 | 41 | 0.717949 | from game import Game
game = Game("Pygame with Box2d Template")
game.run()
| true | true |
f716125d67e85c57e3e02321d8def2b0570ba241 | 1,953 | py | Python | TwitchApiPy/TwitchApiPy.py | xegepa/Twitch-Api-Py | 84613dd32654315422481d24bb9afc1ab3967d3d | [
"MIT"
] | 2 | 2020-08-16T12:54:23.000Z | 2021-02-11T20:43:42.000Z | TwitchApiPy/TwitchApiPy.py | xegepa/Twitch-Api-Py | 84613dd32654315422481d24bb9afc1ab3967d3d | [
"MIT"
] | null | null | null | TwitchApiPy/TwitchApiPy.py | xegepa/Twitch-Api-Py | 84613dd32654315422481d24bb9afc1ab3967d3d | [
"MIT"
] | null | null | null | import requests
class TwitchApiPy():
def __init__(self):
self.ClientID = ""
self.OAuth = ""
"""
You don't really use this its for other requests
"""
def GetUserID(self,name):
r = requests.get(url = "https://api.twitch.tv/helix/users?login={}".format(name), headers = {'Clien... | 34.875 | 165 | 0.573989 | import requests
class TwitchApiPy():
def __init__(self):
self.ClientID = ""
self.OAuth = ""
def GetUserID(self,name):
r = requests.get(url = "https://api.twitch.tv/helix/users?login={}".format(name), headers = {'Client-ID': self.ClientID,'Authorization': self.OAuth})
r = r.json... | true | true |
f71612ddef304fe8e27a1500d0a1c4bde6565bb6 | 35,689 | py | Python | fhirclient/models/medicationrequest.py | mdx-dev/client-py | f6c16c9bd386c5b05d69753b89c6519d568814ac | [
"Apache-2.0"
] | null | null | null | fhirclient/models/medicationrequest.py | mdx-dev/client-py | f6c16c9bd386c5b05d69753b89c6519d568814ac | [
"Apache-2.0"
] | null | null | null | fhirclient/models/medicationrequest.py | mdx-dev/client-py | f6c16c9bd386c5b05d69753b89c6519d568814ac | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/MedicationRequest) on 2019-01-22.
# 2019, SMART Health IT.
from . import domainresource
class MedicationRequest(domainresource.DomainResource):
"""
O
r
d
e
r
... | 12.053023 | 131 | 0.304548 |
from . import domainresource
class MedicationRequest(domainresource.DomainResource):
resource_type = "MedicationRequest"
def __init__(self, jsondict=None, strict=True):
self.authoredOn = None
self.basedOn = None
self.category = None
... | true | true |
f716130a5e4aa592b5742e419a3914560c7330fc | 1,320 | py | Python | homeassistant/components/synology_dsm/const.py | liangleslie/core | cc807b4d597daaaadc92df4a93c6e30da4f570c6 | [
"Apache-2.0"
] | 1,635 | 2015-01-01T14:59:18.000Z | 2016-04-13T02:36:16.000Z | homeassistant/components/synology_dsm/const.py | liangleslie/core | cc807b4d597daaaadc92df4a93c6e30da4f570c6 | [
"Apache-2.0"
] | 1,463 | 2015-01-06T06:18:07.000Z | 2016-04-12T22:30:37.000Z | homeassistant/components/synology_dsm/const.py | liangleslie/core | cc807b4d597daaaadc92df4a93c6e30da4f570c6 | [
"Apache-2.0"
] | 659 | 2015-01-05T14:02:23.000Z | 2016-04-12T23:39:31.000Z | """Constants for Synology DSM."""
from __future__ import annotations
from synology_dsm.api.surveillance_station.const import SNAPSHOT_PROFILE_BALANCED
from homeassistant.const import Platform
DOMAIN = "synology_dsm"
ATTRIBUTION = "Data provided by Synology"
PLATFORMS = [
Platform.BINARY_SENSOR,
Platform.BUTT... | 23.571429 | 81 | 0.79697 | from __future__ import annotations
from synology_dsm.api.surveillance_station.const import SNAPSHOT_PROFILE_BALANCED
from homeassistant.const import Platform
DOMAIN = "synology_dsm"
ATTRIBUTION = "Data provided by Synology"
PLATFORMS = [
Platform.BINARY_SENSOR,
Platform.BUTTON,
Platform.CAMERA,
Platf... | true | true |
f716137a258773159a3f46fb247a0224787d63af | 85 | py | Python | 2020/09/30/Django Pagination Tutorial/library/library/books/apps.py | kenjitagawa/youtube_video_code | ef3c48b9e136b3745d10395d94be64cb0a1f1c97 | [
"Unlicense"
] | 492 | 2019-06-25T12:54:31.000Z | 2022-03-30T12:38:28.000Z | 2020/09/30/Django Pagination Tutorial/library/library/books/apps.py | kenjitagawa/youtube_video_code | ef3c48b9e136b3745d10395d94be64cb0a1f1c97 | [
"Unlicense"
] | 122 | 2018-10-06T21:31:24.000Z | 2020-11-09T15:04:56.000Z | 2020/09/30/Django Pagination Tutorial/library/library/books/apps.py | kenjitagawa/youtube_video_code | ef3c48b9e136b3745d10395d94be64cb0a1f1c97 | [
"Unlicense"
] | 1,734 | 2019-06-03T06:25:13.000Z | 2022-03-31T23:57:53.000Z | from django.apps import AppConfig
class BooksConfig(AppConfig):
name = 'books'
| 14.166667 | 33 | 0.741176 | from django.apps import AppConfig
class BooksConfig(AppConfig):
name = 'books'
| true | true |
f71613f7207decd88d8c0d1641da8ad9b079d689 | 2,085 | py | Python | code/generateTimeline.py | sahilmgandhi/sahilmgandhi.github.io | e2d6aba9d90f53a4ebfbbd36b6b1d301dce039d3 | [
"CC-BY-3.0"
] | null | null | null | code/generateTimeline.py | sahilmgandhi/sahilmgandhi.github.io | e2d6aba9d90f53a4ebfbbd36b6b1d301dce039d3 | [
"CC-BY-3.0"
] | null | null | null | code/generateTimeline.py | sahilmgandhi/sahilmgandhi.github.io | e2d6aba9d90f53a4ebfbbd36b6b1d301dce039d3 | [
"CC-BY-3.0"
] | null | null | null | #!/usr/bin/python
import random, sys, string, csv, argparse, subprocess
parser=argparse.ArgumentParser(
description='''This script generates the HTML code for the timeline boxes''',
epilog="""Have fun!""")
parser.add_argument('-i', default='movies.csv', dest='inputFile', help='Name of the csv file. Default is... | 40.882353 | 123 | 0.617746 |
import random, sys, string, csv, argparse, subprocess
parser=argparse.ArgumentParser(
description='''This script generates the HTML code for the timeline boxes''',
epilog="""Have fun!""")
parser.add_argument('-i', default='movies.csv', dest='inputFile', help='Name of the csv file. Default is movies.csv')
pars... | true | true |
f71614d3da0d9da31c0fa08bb2b57c555c07181a | 4,274 | py | Python | deprecated/pycqed/instrument_drivers/physical_instruments/_controlbox/xiangs_timing_tape_code.py | nuttamas/PycQED_py3 | 1ee35c7428d36ed42ba4afb5d4bda98140b2283e | [
"MIT"
] | 60 | 2016-08-03T10:00:18.000Z | 2021-11-10T11:46:16.000Z | deprecated/pycqed/instrument_drivers/physical_instruments/_controlbox/xiangs_timing_tape_code.py | nuttamas/PycQED_py3 | 1ee35c7428d36ed42ba4afb5d4bda98140b2283e | [
"MIT"
] | 512 | 2016-08-03T17:10:02.000Z | 2022-03-31T14:03:43.000Z | deprecated/pycqed/instrument_drivers/physical_instruments/_controlbox/xiangs_timing_tape_code.py | nuttamas/PycQED_py3 | 1ee35c7428d36ed42ba4afb5d4bda98140b2283e | [
"MIT"
] | 34 | 2016-10-19T12:00:52.000Z | 2022-03-19T04:43:26.000Z | def set_conditional_tape(self, awg_nr, tape_nr, tape):
'''
set the conditional tape content for an awg
@param awg : the awg of the dac, (0,1,2).
@param tape_nr : the number of the tape, integer ranging (0~6)
@param tape : the array of entries, with a maximum number of entries 512.
Every ent... | 39.943925 | 96 | 0.662611 | def set_conditional_tape(self, awg_nr, tape_nr, tape):
length = len(tape)
tape_addr_width = 9
entry_length = 9 + 3 + 1
if awg_nr < 0 or awg_nr > 2:
raise ValueError
if tape_nr < 0 or tape_nr > 6:
raise ValueError
if length < 1 or length > 512:
raise ValueError
... | true | true |
f716155583711d06a3bf11dab07383b6f8697428 | 1,801 | py | Python | securityheaders/checkers/cors/exposeheaders/test_exposesensitiveheaders.py | th3cyb3rc0p/securityheaders | 941264be581dc01afe28f6416f2d7bed79aecfb3 | [
"Apache-2.0"
] | 151 | 2018-07-29T22:34:43.000Z | 2022-03-22T05:08:27.000Z | securityheaders/checkers/cors/exposeheaders/test_exposesensitiveheaders.py | th3cyb3rc0p/securityheaders | 941264be581dc01afe28f6416f2d7bed79aecfb3 | [
"Apache-2.0"
] | 5 | 2019-04-24T07:31:36.000Z | 2021-04-15T14:31:23.000Z | securityheaders/checkers/cors/exposeheaders/test_exposesensitiveheaders.py | th3cyb3rc0p/securityheaders | 941264be581dc01afe28f6416f2d7bed79aecfb3 | [
"Apache-2.0"
] | 42 | 2018-07-31T08:18:59.000Z | 2022-03-28T08:18:32.000Z | import unittest
from securityheaders.checkers.cors import AccessControlExposeHeadersSensitiveChecker
class AccessControlExposeHeadersSensitiveCheckerTest(unittest.TestCase):
def setUp(self):
self.x = AccessControlExposeHeadersSensitiveChecker()
def test_checkNoHeader(self):
nox = dict()
... | 31.051724 | 84 | 0.655747 | import unittest
from securityheaders.checkers.cors import AccessControlExposeHeadersSensitiveChecker
class AccessControlExposeHeadersSensitiveCheckerTest(unittest.TestCase):
def setUp(self):
self.x = AccessControlExposeHeadersSensitiveChecker()
def test_checkNoHeader(self):
nox = dict()
... | true | true |
f71617895efc3dfd23246121c700461891099a24 | 6,196 | py | Python | docs/conf.py | EVEprosper/ProsperDatareader | 31f0d77074c21222161774f4d653326925611167 | [
"MIT"
] | null | null | null | docs/conf.py | EVEprosper/ProsperDatareader | 31f0d77074c21222161774f4d653326925611167 | [
"MIT"
] | 14 | 2017-08-14T02:25:42.000Z | 2018-11-16T19:15:52.000Z | docs/conf.py | EVEprosper/ProsperDatareader | 31f0d77074c21222161774f4d653326925611167 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# ProsperDatareader documentation build configuration file, created by
# sphinx-quickstart on Mon Jul 31 09:30:33 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in... | 29.788462 | 80 | 0.675274 |
import os
import sys
sys.path.insert(0, os.path.abspath('../prosper/datareader'))
sys.path.insert(0, os.path.abspath('../prosper'))
from _version import __version__
import alabaster
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.... | true | true |
f716179af5712ede1126fe27e7a30594aafd8164 | 5,204 | py | Python | sdk/python/pulumi_azure_nextgen/logic/latest/get_integration_account_batch_configuration.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_nextgen/logic/latest/get_integration_account_batch_configuration.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_nextgen/logic/latest/get_integration_account_batch_configuration.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 37.438849 | 236 | 0.662183 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outputs
__all__ = [
'GetIntegrationAccountBatchConfigurationResult',
'AwaitableGetIntegrationAccountBatchConfigurationResult',
'get_integration_a... | true | true |
f7161889a0f2637bcacb6385931f3df8ce3d1eb6 | 2,639 | py | Python | PYTHON/skyscrapper.py | iamsuryakant/100-days-of-code | eaf4863d98dc273f03a989fe87d010d201d91516 | [
"MIT"
] | 1 | 2020-07-04T12:45:50.000Z | 2020-07-04T12:45:50.000Z | PYTHON/skyscrapper.py | iamsuryakant/100-days-of-code | eaf4863d98dc273f03a989fe87d010d201d91516 | [
"MIT"
] | 1 | 2020-08-08T02:23:46.000Z | 2020-08-08T02:47:56.000Z | PYTHON/skyscrapper.py | iamsuryakant/100-days-of-code | eaf4863d98dc273f03a989fe87d010d201d91516 | [
"MIT"
] | null | null | null | class Solution:
def getSkyline(self, buildings: 'List[List[int]]') -> 'List[List[int]]':
"""
Divide-and-conquer algorithm to solve skyline problem,
which is similar with the merge sort algorithm.
"""
n = len(buildings)
# The base cases
if n == 0:
r... | 32.580247 | 76 | 0.497537 | class Solution:
def getSkyline(self, buildings: 'List[List[int]]') -> 'List[List[int]]':
n = len(buildings)
if n == 0:
return []
if n == 1:
x_start, x_end, y = buildings[0]
return [[x_start, y], [x_end, 0]]
left_skyline = s... | true | true |
f71618cfbb589aebbaf72299adad2c12c7a31751 | 2,060 | py | Python | lib/surface/dataproc/workflow_templates/instantiate.py | bopopescu/Google-Cloud-SDK-1 | c4683bacb2f6192d8a816932e438a0493085469b | [
"Apache-2.0"
] | null | null | null | lib/surface/dataproc/workflow_templates/instantiate.py | bopopescu/Google-Cloud-SDK-1 | c4683bacb2f6192d8a816932e438a0493085469b | [
"Apache-2.0"
] | null | null | null | lib/surface/dataproc/workflow_templates/instantiate.py | bopopescu/Google-Cloud-SDK-1 | c4683bacb2f6192d8a816932e438a0493085469b | [
"Apache-2.0"
] | 1 | 2020-07-24T20:13:29.000Z | 2020-07-24T20:13:29.000Z | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 36.785714 | 80 | 0.762621 | """Instantiate a workflow template."""
import uuid
from googlecloudsdk.api_lib.dataproc import dataproc as dp
from googlecloudsdk.api_lib.dataproc import util
from googlecloudsdk.calliope import base
from googlecloudsdk.command_lib.dataproc import flags
from googlecloudsdk.core import log
@base.ReleaseTracks(base.Re... | false | true |
f71618eae8454fc424b1ab0fecf5817c6c652137 | 31,411 | py | Python | tests/models/bloom/test_modeling_bloom.py | JingyaHuang/transformers | 6589e510fa4e6c442059de2fab84752535de9b23 | [
"Apache-2.0"
] | null | null | null | tests/models/bloom/test_modeling_bloom.py | JingyaHuang/transformers | 6589e510fa4e6c442059de2fab84752535de9b23 | [
"Apache-2.0"
] | null | null | null | tests/models/bloom/test_modeling_bloom.py | JingyaHuang/transformers | 6589e510fa4e6c442059de2fab84752535de9b23 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2022 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | 41.439314 | 155 | 0.661934 |
import math
import unittest
from transformers import BloomConfig, is_torch_available
from transformers.testing_utils import require_torch, require_torch_gpu, slow, torch_device
from ...generation.test_generation_utils import GenerationTesterMixin
from ...test_configuration_common import ConfigTester
from ...test_mod... | true | true |
f71619031253fb486e6ba783dca022105538c931 | 3,935 | py | Python | server/website/website/parser/parser.py | mjain2/ottertune | 011e896bf89df831fb1189b1ab4c9a7d7dca420a | [
"Apache-2.0"
] | 1 | 2019-08-16T19:35:35.000Z | 2019-08-16T19:35:35.000Z | server/website/website/parser/parser.py | mjain2/ottertune | 011e896bf89df831fb1189b1ab4c9a7d7dca420a | [
"Apache-2.0"
] | null | null | null | server/website/website/parser/parser.py | mjain2/ottertune | 011e896bf89df831fb1189b1ab4c9a7d7dca420a | [
"Apache-2.0"
] | null | null | null | #
# OtterTune - parser.py
#
# Copyright (c) 2017-18, Carnegie Mellon University Database Group
#
'''
Created on Dec 12, 2017
@author: dvanaken
'''
from website.models import DBMSCatalog
from website.types import DBMSType
from .myrocks import MyRocks56Parser
from .mysql import MySql57Parser
from .postgres import Pos... | 35.45045 | 96 | 0.662516 |
from website.models import DBMSCatalog
from website.types import DBMSType
from .myrocks import MyRocks56Parser
from .mysql import MySql57Parser
from .postgres import Postgres96Parser, PostgresOldParser
from .oracle import Oracle19Parser
class Parser(object):
__DBMS_UTILS_IMPLS = None
@staticmethod
de... | true | true |
f716194f5cc205b886a9dd79a6796056afa57b63 | 15,927 | py | Python | old/fastai/structured.py | fjaragones/fastai | be48d209a4526191f71dc7adaef090828897b9ec | [
"Apache-2.0"
] | 2 | 2019-02-19T18:34:29.000Z | 2019-12-09T17:51:41.000Z | old/fastai/structured.py | fjaragones/fastai | be48d209a4526191f71dc7adaef090828897b9ec | [
"Apache-2.0"
] | 4 | 2020-02-25T20:46:35.000Z | 2022-02-26T04:45:55.000Z | old/fastai/structured.py | fjaragones/fastai | be48d209a4526191f71dc7adaef090828897b9ec | [
"Apache-2.0"
] | 1 | 2019-01-16T08:10:48.000Z | 2019-01-16T08:10:48.000Z | from .imports import *
from sklearn_pandas import DataFrameMapper
from sklearn.preprocessing import LabelEncoder, Imputer, StandardScaler
from pandas.api.types import is_string_dtype, is_numeric_dtype
from sklearn.ensemble import forest
from sklearn.tree import export_graphviz
def set_plot_sizes(sml, med, big):
... | 32.975155 | 155 | 0.585547 | from .imports import *
from sklearn_pandas import DataFrameMapper
from sklearn.preprocessing import LabelEncoder, Imputer, StandardScaler
from pandas.api.types import is_string_dtype, is_numeric_dtype
from sklearn.ensemble import forest
from sklearn.tree import export_graphviz
def set_plot_sizes(sml, med, big):
... | true | true |
f7161a30a649ebcfed2157ecee02dcc94672948b | 4,221 | py | Python | mighty/trainer/autoencoder.py | dizcza/pytorch-mighty | 942c53b529377c9100bffc2f7f20ec740763e6ae | [
"BSD-3-Clause"
] | 1 | 2020-11-14T20:15:07.000Z | 2020-11-14T20:15:07.000Z | mighty/trainer/autoencoder.py | dizcza/pytorch-mighty | 942c53b529377c9100bffc2f7f20ec740763e6ae | [
"BSD-3-Clause"
] | null | null | null | mighty/trainer/autoencoder.py | dizcza/pytorch-mighty | 942c53b529377c9100bffc2f7f20ec740763e6ae | [
"BSD-3-Clause"
] | 2 | 2021-01-15T05:52:53.000Z | 2021-03-26T17:41:17.000Z | from typing import Union
import torch
import torch.nn as nn
import torch.utils.data
from torch.optim.lr_scheduler import _LRScheduler, ReduceLROnPlateau
from torch.optim.optimizer import Optimizer
from mighty.loss import LossPenalty
from mighty.models import AutoencoderLinear
from mighty.monitor.monitor import Monito... | 34.317073 | 77 | 0.662876 | from typing import Union
import torch
import torch.nn as nn
import torch.utils.data
from torch.optim.lr_scheduler import _LRScheduler, ReduceLROnPlateau
from torch.optim.optimizer import Optimizer
from mighty.loss import LossPenalty
from mighty.models import AutoencoderLinear
from mighty.monitor.monitor import Monito... | true | true |
f7161b6e4e31964b3a9005f00d17ab5c36f84872 | 119 | py | Python | managePHP/apps.py | uzairAK/serverom-panel | 3dcde05ad618e6bef280db7d3180f926fe2ab1db | [
"MIT"
] | null | null | null | managePHP/apps.py | uzairAK/serverom-panel | 3dcde05ad618e6bef280db7d3180f926fe2ab1db | [
"MIT"
] | null | null | null | managePHP/apps.py | uzairAK/serverom-panel | 3dcde05ad618e6bef280db7d3180f926fe2ab1db | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from django.apps import AppConfig
class ManagephpConfig(AppConfig):
name = 'managePHP'
| 13.222222 | 33 | 0.680672 |
from django.apps import AppConfig
class ManagephpConfig(AppConfig):
name = 'managePHP'
| true | true |
f7161b7902bab32f86e6014239d17115293e71f9 | 472 | py | Python | home/migrations/0009_userprofile_image.py | VSevagen/ProctOS | a34124b0a5d152e30c064c8ed801e7af894eb04a | [
"MIT"
] | null | null | null | home/migrations/0009_userprofile_image.py | VSevagen/ProctOS | a34124b0a5d152e30c064c8ed801e7af894eb04a | [
"MIT"
] | null | null | null | home/migrations/0009_userprofile_image.py | VSevagen/ProctOS | a34124b0a5d152e30c064c8ed801e7af894eb04a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.8 on 2019-04-29 17:15
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('home', '0008_userprofile_job'),
]
operations = [
migrations.AddField(
... | 22.47619 | 75 | 0.622881 | from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('home', '0008_userprofile_job'),
]
operations = [
migrations.AddField(
model_name='userprofile',
name='image',
fi... | true | true |
f7161c240b0c336a9c97d362b4c36a3bed371c38 | 741 | py | Python | leetcode/26.remove-duplicates-from-sorted-array.py | geemaple/algorithm | 68bc5032e1ee52c22ef2f2e608053484c487af54 | [
"MIT"
] | 177 | 2017-08-21T08:57:43.000Z | 2020-06-22T03:44:22.000Z | leetcode/26.remove-duplicates-from-sorted-array.py | geemaple/algorithm | 68bc5032e1ee52c22ef2f2e608053484c487af54 | [
"MIT"
] | 2 | 2018-09-06T13:39:12.000Z | 2019-06-03T02:54:45.000Z | leetcode/26.remove-duplicates-from-sorted-array.py | geemaple/algorithm | 68bc5032e1ee52c22ef2f2e608053484c487af54 | [
"MIT"
] | 23 | 2017-08-23T06:01:28.000Z | 2020-04-20T03:17:36.000Z | class Solution(object):
def removeDuplicates(self, nums: List[int]) -> int:
i = 0
for j in range(len(nums)):
if (i == 0 or nums[i - 1] < nums[j]):
nums[i] = nums[j]
i += 1
return i
class Solution2:
def removeDuplicates(self, nums: Li... | 26.464286 | 72 | 0.404858 | class Solution(object):
def removeDuplicates(self, nums: List[int]) -> int:
i = 0
for j in range(len(nums)):
if (i == 0 or nums[i - 1] < nums[j]):
nums[i] = nums[j]
i += 1
return i
class Solution2:
def removeDuplicates(self, nums: Li... | true | true |
f7161caf9548a67532b6022bdbc9d88b81af26b2 | 479 | py | Python | code/proto/copyfiles.py | KasumiL5x/atom | 90262f59e56a829017f95f297c1a6701fc4e200e | [
"MIT"
] | null | null | null | code/proto/copyfiles.py | KasumiL5x/atom | 90262f59e56a829017f95f297c1a6701fc4e200e | [
"MIT"
] | null | null | null | code/proto/copyfiles.py | KasumiL5x/atom | 90262f59e56a829017f95f297c1a6701fc4e200e | [
"MIT"
] | null | null | null | from distutils.dir_util import copy_tree
import shutil
import os
def prepare_directory(path):
shutil.rmtree(path, ignore_errors=True) # remove existing folder
if not os.path.isdir(path): # create folder
os.mkdir(path)
# copy resulting files into correct folders
print 'Copying files...',
in_out_dirs = [['./cpp', '... | 28.176471 | 88 | 0.730689 | from distutils.dir_util import copy_tree
import shutil
import os
def prepare_directory(path):
shutil.rmtree(path, ignore_errors=True) if not os.path.isdir(path): os.mkdir(path)
print 'Copying files...',
in_out_dirs = [['./cpp', '../atom/src/proto'], ['./cs', '../client/AtomClientDX/proto']]
for curr in in_out_dir... | false | true |
f7161cda1bfd467e4b31401b02eeb1c3116488de | 490 | py | Python | UnitsOfWork/ConfusionMatrixUnitOfWork.py | tzouvanas/bio-informatics | f21d1786759fcdd03481f8ee8044130cf354ad7c | [
"MIT"
] | null | null | null | UnitsOfWork/ConfusionMatrixUnitOfWork.py | tzouvanas/bio-informatics | f21d1786759fcdd03481f8ee8044130cf354ad7c | [
"MIT"
] | 1 | 2020-06-18T08:56:54.000Z | 2020-06-24T22:50:25.000Z | UnitsOfWork/ConfusionMatrixUnitOfWork.py | tzouvanas/bio-informatics | f21d1786759fcdd03481f8ee8044130cf354ad7c | [
"MIT"
] | 1 | 2022-02-25T05:36:55.000Z | 2022-02-25T05:36:55.000Z | import numpy as np
from matrices.ConfusionMatrix import ConfusionMatrix
class ConfusionMatrixUnitOfWork:
def go(self):
cm = ConfusionMatrix(4)
cm.loadRow([70, 10, 15, 5])
cm.loadRow([8, 67, 20, 5])
cm.loadRow([0, 11, 88, 1])
cm.loadRow([4, 10, 14, 72])
cm.p... | 25.789474 | 53 | 0.587755 | import numpy as np
from matrices.ConfusionMatrix import ConfusionMatrix
class ConfusionMatrixUnitOfWork:
def go(self):
cm = ConfusionMatrix(4)
cm.loadRow([70, 10, 15, 5])
cm.loadRow([8, 67, 20, 5])
cm.loadRow([0, 11, 88, 1])
cm.loadRow([4, 10, 14, 72])
cm.p... | true | true |
f7161f0450fc301397ce147c5b5b2aada8108f6e | 1,450 | py | Python | apps/sushi/tests/conftest.py | techlib/czechelib-stats | ca132e326af0924740a525710474870b1fb5fd37 | [
"MIT"
] | 1 | 2019-12-12T15:38:42.000Z | 2019-12-12T15:38:42.000Z | apps/sushi/tests/conftest.py | techlib/czechelib-stats | ca132e326af0924740a525710474870b1fb5fd37 | [
"MIT"
] | null | null | null | apps/sushi/tests/conftest.py | techlib/czechelib-stats | ca132e326af0924740a525710474870b1fb5fd37 | [
"MIT"
] | null | null | null | import pytest
from core.models import UL_ORG_ADMIN
from sushi.models import CounterReportType, SushiCredentials
from organizations.tests.conftest import organizations # noqa
from publications.tests.conftest import platforms # noqa
from logs.tests.conftest import report_type_nd # noqa
@pytest.fixture()
def counter... | 29.591837 | 90 | 0.722069 | import pytest
from core.models import UL_ORG_ADMIN
from sushi.models import CounterReportType, SushiCredentials
from organizations.tests.conftest import organizations from publications.tests.conftest import platforms from logs.tests.conftest import report_type_nd
@pytest.fixture()
def counter_report_type_named(re... | true | true |
f7161f4dccd9eaa9ca79cf77012d48452c1d866f | 11,252 | py | Python | chalice/deploy/swagger.py | devangmehta123/chalice | 9cba1bff604871c03c179e0b4be94d59a93ba198 | [
"Apache-2.0"
] | null | null | null | chalice/deploy/swagger.py | devangmehta123/chalice | 9cba1bff604871c03c179e0b4be94d59a93ba198 | [
"Apache-2.0"
] | null | null | null | chalice/deploy/swagger.py | devangmehta123/chalice | 9cba1bff604871c03c179e0b4be94d59a93ba198 | [
"Apache-2.0"
] | null | null | null | import copy
import inspect
from typing import Any, List, Dict, Optional, Union # noqa
from chalice.app import Chalice, RouteEntry, Authorizer, CORSConfig # noqa
from chalice.app import ChaliceAuthorizer
from chalice.deploy.planner import StringFormat
from chalice.deploy.models import RestAPI # noqa
from chalice.ut... | 36.891803 | 79 | 0.546481 | import copy
import inspect
from typing import Any, List, Dict, Optional, Union
from chalice.app import Chalice, RouteEntry, Authorizer, CORSConfig from chalice.app import ChaliceAuthorizer
from chalice.deploy.planner import StringFormat
from chalice.deploy.models import RestAPI from chalice.utils import to_cfn_res... | true | true |
f7161f67b3ae378daf9562eda41ea0921d60fa10 | 1,605 | py | Python | opentutorials_python2/opentutorials_python2/19_Override/2_Override_deepen.py | dongrami0425/Python_OpenCV-Study | c7faee4f63720659280c3222ba5abfe27740d1f4 | [
"MIT"
] | null | null | null | opentutorials_python2/opentutorials_python2/19_Override/2_Override_deepen.py | dongrami0425/Python_OpenCV-Study | c7faee4f63720659280c3222ba5abfe27740d1f4 | [
"MIT"
] | null | null | null | opentutorials_python2/opentutorials_python2/19_Override/2_Override_deepen.py | dongrami0425/Python_OpenCV-Study | c7faee4f63720659280c3222ba5abfe27740d1f4 | [
"MIT"
] | null | null | null | # 계산기 예제. 오버라이드의 활용.
class Cal(object):
_history = []
def __init__(self, v1, v2):
if isinstance(v1, int):
self.v1 = v1
if isinstance(v2, int):
self.v2 = v2
def add(self):
result = self.v1+self.v2
Cal._history.append("add : %d+%d=%d" % (self.v1, sel... | 24.318182 | 84 | 0.560125 |
class Cal(object):
_history = []
def __init__(self, v1, v2):
if isinstance(v1, int):
self.v1 = v1
if isinstance(v2, int):
self.v2 = v2
def add(self):
result = self.v1+self.v2
Cal._history.append("add : %d+%d=%d" % (self.v1, self.v2, result))
... | true | true |
f7161fc6e8dcba67239d796b5f8323d0d179af8d | 850 | py | Python | scripts/filter_top.py | isabella232/azure-signalr-bench | 99a5af8ac350282b78a3a06b7aadd786e7150244 | [
"MIT"
] | null | null | null | scripts/filter_top.py | isabella232/azure-signalr-bench | 99a5af8ac350282b78a3a06b7aadd786e7150244 | [
"MIT"
] | 1 | 2021-02-23T23:13:09.000Z | 2021-02-23T23:13:09.000Z | scripts/filter_top.py | isabella232/azure-signalr-bench | 99a5af8ac350282b78a3a06b7aadd786e7150244 | [
"MIT"
] | null | null | null | import argparse
import datetime
import glob, os, re
from filter_utils import *
if __name__=="__main__":
parser = argparse.ArgumentParser()
parser.add_argument("-s", "--startDate",
default=aWeekAgo(),
help="specify the starting date to check, default is a week ago")
parser.add_argument("-e... | 34 | 91 | 0.621176 | import argparse
import datetime
import glob, os, re
from filter_utils import *
if __name__=="__main__":
parser = argparse.ArgumentParser()
parser.add_argument("-s", "--startDate",
default=aWeekAgo(),
help="specify the starting date to check, default is a week ago")
parser.add_argument("-e... | true | true |
f71620dd4dbcb8427eb3d4e5ea5b213670bdf5dd | 1,482 | py | Python | contrib/devtools/fix-copyright-headers.py | flirtcoin/flirtcoin | 1bbaa7cef10b9db404095127fe6def859541b266 | [
"MIT"
] | null | null | null | contrib/devtools/fix-copyright-headers.py | flirtcoin/flirtcoin | 1bbaa7cef10b9db404095127fe6def859541b266 | [
"MIT"
] | null | null | null | contrib/devtools/fix-copyright-headers.py | flirtcoin/flirtcoin | 1bbaa7cef10b9db404095127fe6def859541b266 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
'''
Run this script inside of src/ and it will look for all the files
that were changed this year that still have the last year in the
copyright headers, and it will fix the headers on that file using
a perl regex one liner.
For example: if it finds something like this and we're in 2014
// Copyr... | 27.444444 | 81 | 0.695007 | '''
Run this script inside of src/ and it will look for all the files
that were changed this year that still have the last year in the
copyright headers, and it will fix the headers on that file using
a perl regex one liner.
For example: if it finds something like this and we're in 2014
// Copyright (c) 2009-2013 The... | false | true |
f71620ef373fd3749805cb5e901e1f1cc8895aef | 159 | py | Python | frimcla/StatisticalAnalysis/__init__.py | ManuGar/ObjectClassificationByTransferLearning | fc009fc5a71668355a94ea1a8f506fdde8e7bde0 | [
"MIT"
] | 3 | 2021-04-22T09:15:34.000Z | 2022-01-05T09:50:18.000Z | frimcla/StatisticalAnalysis/__init__.py | ManuGar/ObjectClassificationByTransferLearning | fc009fc5a71668355a94ea1a8f506fdde8e7bde0 | [
"MIT"
] | 4 | 2020-09-25T22:46:39.000Z | 2021-08-25T15:01:14.000Z | frimcla/StatisticalAnalysis/__init__.py | ManuGar/ObjectClassificationByTransferLearning | fc009fc5a71668355a94ea1a8f506fdde8e7bde0 | [
"MIT"
] | 3 | 2020-07-31T14:11:26.000Z | 2021-11-24T01:53:01.000Z | """A pypi demonstration vehicle.
.. moduleauthor:: Andrew Carter <andrew@invalid.com>
"""
from .statisticalAnalysis import *
__all__ = ['compare_methods']
| 15.9 | 52 | 0.72956 |
from .statisticalAnalysis import *
__all__ = ['compare_methods']
| true | true |
f71622aea7d6b89a7c4742971cb49b5011e7e9cd | 6,024 | py | Python | src/oci/log_analytics/models/parser_test_result.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 249 | 2017-09-11T22:06:05.000Z | 2022-03-04T17:09:29.000Z | src/oci/log_analytics/models/parser_test_result.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 228 | 2017-09-11T23:07:26.000Z | 2022-03-23T10:58:50.000Z | src/oci/log_analytics/models/parser_test_result.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 224 | 2017-09-27T07:32:43.000Z | 2022-03-25T16:55:42.000Z | # coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 30.892308 | 245 | 0.65488 |
from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel from oci.decorators import init_model_state_from_kwargs
@init_model_state_from_kwargs
class ParserTestResult(object):
def __init__(self, **kwargs):
self.swagger_types = {
'additional_info': 'dict(s... | true | true |
f71622f18cba8cd47f00c885daecfb96114e8221 | 806 | py | Python | tests/utils.py | thiagopena/python-mcollective | 77cac3e23e6a61542662be3b8f94ee54bbfea942 | [
"BSD-3-Clause"
] | 1 | 2015-07-29T00:35:51.000Z | 2015-07-29T00:35:51.000Z | tests/utils.py | jantman/python-mcollective | ceb8f362bc8a1981b42696889250bed1cce07fea | [
"BSD-3-Clause"
] | null | null | null | tests/utils.py | jantman/python-mcollective | ceb8f362bc8a1981b42696889250bed1cce07fea | [
"BSD-3-Clause"
] | 1 | 2019-01-02T18:40:24.000Z | 2019-01-02T18:40:24.000Z | # coding: utf-8
import os
import jinja2
ROOT = os.path.abspath(os.path.join(__file__, '..'))
DEFAULT_CTXT = {
'topic': 'topic',
'collectives': ['mcollective', 'sub1'],
'maincollective': 'mcollective',
'root': ROOT,
'loglevel': 'debug',
'daemonize': 0,
'identity': 'mco1',
'securityprovi... | 24.424242 | 79 | 0.550868 | import os
import jinja2
ROOT = os.path.abspath(os.path.join(__file__, '..'))
DEFAULT_CTXT = {
'topic': 'topic',
'collectives': ['mcollective', 'sub1'],
'maincollective': 'mcollective',
'root': ROOT,
'loglevel': 'debug',
'daemonize': 0,
'identity': 'mco1',
'securityprovider': 'none',
... | true | true |
f71623279ac09811be88393ace0f3f65306bffca | 3,425 | py | Python | scripts/ancora.py | crscardellino/dnnvsd | 2de14f05b71199be1b0ee601287243ea25f92cba | [
"BSD-3-Clause"
] | 3 | 2016-03-10T21:03:28.000Z | 2018-04-09T03:53:58.000Z | scripts/ancora.py | crscardellino/dnnvsd | 2de14f05b71199be1b0ee601287243ea25f92cba | [
"BSD-3-Clause"
] | null | null | null | scripts/ancora.py | crscardellino/dnnvsd | 2de14f05b71199be1b0ee601287243ea25f92cba | [
"BSD-3-Clause"
] | null | null | null | from nltk.corpus.reader.api import SyntaxCorpusReader
from nltk.corpus.reader import xmldocs
from nltk import tree
from nltk.util import LazyMap, LazyConcatenation
from nltk.corpus.reader.util import concat
def parsed(element):
"""Converts a 'sentence' XML element (xml.etree.ElementTree.Element) to
an NLTK tr... | 33.578431 | 80 | 0.640584 | from nltk.corpus.reader.api import SyntaxCorpusReader
from nltk.corpus.reader import xmldocs
from nltk import tree
from nltk.util import LazyMap, LazyConcatenation
from nltk.corpus.reader.util import concat
def parsed(element):
if element:
subtrees = map(parsed, element)
subtrees = [t for ... | true | true |
f71624b25629b5f413869a0e9a164584fb6bbe16 | 54,615 | py | Python | rllab/misc/instrument.py | RussellM2020/RoboticTasks | c7157c986cdbbf08cc0ea296205ef2dbcf6fc487 | [
"MIT"
] | null | null | null | rllab/misc/instrument.py | RussellM2020/RoboticTasks | c7157c986cdbbf08cc0ea296205ef2dbcf6fc487 | [
"MIT"
] | null | null | null | rllab/misc/instrument.py | RussellM2020/RoboticTasks | c7157c986cdbbf08cc0ea296205ef2dbcf6fc487 | [
"MIT"
] | null | null | null | import os
import re
import subprocess
import base64
import os.path as osp
import pickle as pickle
import inspect
import hashlib
import sys
from contextlib import contextmanager
import errno
from rllab.core.serializable import Serializable
from rllab import config
from rllab.misc.console import mkdir_p
from rllab.misc... | 39.576087 | 174 | 0.567555 | import os
import re
import subprocess
import base64
import os.path as osp
import pickle as pickle
import inspect
import hashlib
import sys
from contextlib import contextmanager
import errno
from rllab.core.serializable import Serializable
from rllab import config
from rllab.misc.console import mkdir_p
from rllab.misc... | true | true |
f716261ac483bcf478965800be894dea21a24632 | 4,700 | py | Python | openstates/openstates-master/openstates/ky/legislators.py | Jgorsick/Advocacy_Angular | 8906af3ba729b2303880f319d52bce0d6595764c | [
"CC-BY-4.0"
] | null | null | null | openstates/openstates-master/openstates/ky/legislators.py | Jgorsick/Advocacy_Angular | 8906af3ba729b2303880f319d52bce0d6595764c | [
"CC-BY-4.0"
] | null | null | null | openstates/openstates-master/openstates/ky/legislators.py | Jgorsick/Advocacy_Angular | 8906af3ba729b2303880f319d52bce0d6595764c | [
"CC-BY-4.0"
] | null | null | null | from collections import defaultdict
from billy.scrape.legislators import Legislator, LegislatorScraper
import lxml.html
class KYLegislatorScraper(LegislatorScraper):
jurisdiction = 'ky'
latest_only = True
def scrape(self, chamber, year):
if chamber == 'upper':
leg_list_url = 'http:... | 33.098592 | 104 | 0.491702 | from collections import defaultdict
from billy.scrape.legislators import Legislator, LegislatorScraper
import lxml.html
class KYLegislatorScraper(LegislatorScraper):
jurisdiction = 'ky'
latest_only = True
def scrape(self, chamber, year):
if chamber == 'upper':
leg_list_url = 'http:... | true | true |
f7162748180db3d0c6d31d12bd970036ad3500b1 | 1,747 | py | Python | python/training/ami2text.py | bmilde/ambientsearch | 74bf83a313e19da54a4e44158063041f981424c9 | [
"Apache-2.0"
] | 20 | 2016-04-30T11:24:45.000Z | 2021-11-09T10:39:25.000Z | python/training/ami2text.py | bmilde/ambientsearch | 74bf83a313e19da54a4e44158063041f981424c9 | [
"Apache-2.0"
] | 1 | 2020-09-23T13:36:58.000Z | 2020-09-23T13:36:58.000Z | python/training/ami2text.py | bmilde/ambientsearch | 74bf83a313e19da54a4e44158063041f981424c9 | [
"Apache-2.0"
] | 8 | 2015-10-07T13:40:36.000Z | 2019-08-07T06:45:24.000Z | import xml.etree.ElementTree as ET
import os
import codecs
import logging
import sys
import argparse
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)
program = os.path.basename(sys.argv[0])
logger = logging.getLogger(program)
def convert_ami(ami_root_dir, txt_output_dir):
... | 41.595238 | 176 | 0.651975 | import xml.etree.ElementTree as ET
import os
import codecs
import logging
import sys
import argparse
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)
program = os.path.basename(sys.argv[0])
logger = logging.getLogger(program)
def convert_ami(ami_root_dir, txt_output_dir):
... | true | true |
f71628d61972f5279f3ebaa39213c9541c466954 | 2,296 | py | Python | nc/binders/epub.py | masroore/novel_crawler | 7c3c7affc4a177e7a5a308af5b48685ebb55ec9d | [
"Apache-2.0"
] | null | null | null | nc/binders/epub.py | masroore/novel_crawler | 7c3c7affc4a177e7a5a308af5b48685ebb55ec9d | [
"Apache-2.0"
] | null | null | null | nc/binders/epub.py | masroore/novel_crawler | 7c3c7affc4a177e7a5a308af5b48685ebb55ec9d | [
"Apache-2.0"
] | null | null | null | import logging
import os
from ebooklib import epub
logger = logging.getLogger('EPUB_BINDER')
def make_intro_page(crawler):
html = '<div style="padding-top: 25%; text-align: center;">'
html += '<h1>%s</h1>' % (crawler.novel_title or 'N/A')
html += '<h3>%s</h3>' % (crawler.novel_author or 'N/A').replace('... | 28 | 78 | 0.616725 | import logging
import os
from ebooklib import epub
logger = logging.getLogger('EPUB_BINDER')
def make_intro_page(crawler):
html = '<div style="padding-top: 25%; text-align: center;">'
html += '<h1>%s</h1>' % (crawler.novel_title or 'N/A')
html += '<h3>%s</h3>' % (crawler.novel_author or 'N/A').replace('... | true | true |
f71628d715ee90235618f6ae675b83c05225b297 | 1,284 | py | Python | Q2.py | jlo118/DLlab2 | 01978907f48cfeb5cc406564a64454dc6b4f8485 | [
"MIT"
] | null | null | null | Q2.py | jlo118/DLlab2 | 01978907f48cfeb5cc406564a64454dc6b4f8485 | [
"MIT"
] | null | null | null | Q2.py | jlo118/DLlab2 | 01978907f48cfeb5cc406564a64454dc6b4f8485 | [
"MIT"
] | null | null | null | import pandas
from keras.models import Sequential
from keras.layers.core import Dense, Activation
from keras.callbacks import TensorBoard
# load dataset
from sklearn.model_selection import train_test_split
import pandas as pd
dataset = pd.read_csv("framingham.csv", header=None).values
import numpy as np
X_... | 37.764706 | 85 | 0.690031 | import pandas
from keras.models import Sequential
from keras.layers.core import Dense, Activation
from keras.callbacks import TensorBoard
from sklearn.model_selection import train_test_split
import pandas as pd
dataset = pd.read_csv("framingham.csv", header=None).values
import numpy as np
X_train, X_test, Y... | true | true |
f71628db5d9203bb58bae7d94aa015efbb6d6e01 | 13,115 | py | Python | saleor/graphql/account/mutations/staff.py | lov3stor3/lov3stor3 | 1a0d94da1ce61d35ba5efbadbe737b039fedfe87 | [
"CC-BY-4.0"
] | 1 | 2020-09-30T19:33:43.000Z | 2020-09-30T19:33:43.000Z | saleor/graphql/account/mutations/staff.py | lov3stor3/lov3stor3 | 1a0d94da1ce61d35ba5efbadbe737b039fedfe87 | [
"CC-BY-4.0"
] | 2 | 2021-03-09T17:15:05.000Z | 2022-02-10T19:15:11.000Z | saleor/graphql/account/mutations/staff.py | lov3stor3/lov3stor3 | 1a0d94da1ce61d35ba5efbadbe737b039fedfe87 | [
"CC-BY-4.0"
] | 1 | 2019-12-04T22:24:13.000Z | 2019-12-04T22:24:13.000Z | from copy import copy
import graphene
from django.core.exceptions import ValidationError
from graphql_jwt.decorators import staff_member_required
from graphql_jwt.exceptions import PermissionDenied
from ....account import events as account_events, models, utils
from ....account.thumbnails import create_user_avatar_th... | 33.118687 | 85 | 0.658025 | from copy import copy
import graphene
from django.core.exceptions import ValidationError
from graphql_jwt.decorators import staff_member_required
from graphql_jwt.exceptions import PermissionDenied
from ....account import events as account_events, models, utils
from ....account.thumbnails import create_user_avatar_th... | true | true |
f7162a0290f40dedd34ce67aa72eb82899a6ccca | 1,107 | py | Python | Modules/tobii/eye_tracking_io/utils/events.py | ATUAV/ATUAV_Experiment | d0c1c3e1ff790bffa37d404ec1f4d70b537cd7fb | [
"BSD-2-Clause"
] | 7 | 2019-04-20T05:38:05.000Z | 2022-01-17T14:48:43.000Z | Modules/tobii/eye_tracking_io/utils/events.py | ATUAV/ATUAV_Experiment | d0c1c3e1ff790bffa37d404ec1f4d70b537cd7fb | [
"BSD-2-Clause"
] | 1 | 2021-04-04T01:50:09.000Z | 2021-04-04T01:50:09.000Z | Modules/tobii/eye_tracking_io/utils/events.py | ATUAV/ATUAV_Experiment | d0c1c3e1ff790bffa37d404ec1f4d70b537cd7fb | [
"BSD-2-Clause"
] | 2 | 2020-06-22T03:04:26.000Z | 2021-07-10T20:14:55.000Z |
class Events:
def __getattr__(self, name):
if hasattr(self.__class__, '__events__'):
assert name in self.__class__.__events__, \
"Event '%s' is not declared" % name
self.__dict__[name] = ev = _EventSlot(name)
return ev
def __repr__(self):
retu... | 24.065217 | 56 | 0.551942 |
class Events:
def __getattr__(self, name):
if hasattr(self.__class__, '__events__'):
assert name in self.__class__.__events__, \
"Event '%s' is not declared" % name
self.__dict__[name] = ev = _EventSlot(name)
return ev
def __repr__(self):
retu... | true | true |
f7162a3a84cc9137e9125489d2dc95fb668b61c3 | 6,972 | py | Python | lib/spack/spack/mixins.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2020-05-24T15:23:12.000Z | 2020-05-24T15:23:12.000Z | lib/spack/spack/mixins.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 6 | 2022-02-26T11:44:34.000Z | 2022-03-12T12:14:50.000Z | lib/spack/spack/mixins.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 2 | 2020-09-15T02:37:59.000Z | 2020-09-21T04:34:38.000Z | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
"""This module contains additional behavior that can be attached to any given
package.
"""
import collections
import os
i... | 35.753846 | 78 | 0.647017 |
import collections
import os
import llnl.util.filesystem
__all__ = [
'filter_compiler_wrappers'
]
class PackageMixinsMeta(type):
_methods_to_be_added = {}
_add_method_before = collections.defaultdict(list)
_add_method_after = collections.defaultdict(list)
@staticmethod
def register_method... | true | true |
f7162a97b20d3185af1c91ee93a27ee014a8082c | 9,122 | py | Python | tests/utils/test_requirements_utils.py | ericgosno91/mlflow | 8d1a9e354b22919423e5295afd650e39191f701a | [
"Apache-2.0"
] | 2 | 2020-06-23T03:58:12.000Z | 2020-11-26T13:59:10.000Z | tests/utils/test_requirements_utils.py | ericgosno91/mlflow | 8d1a9e354b22919423e5295afd650e39191f701a | [
"Apache-2.0"
] | null | null | null | tests/utils/test_requirements_utils.py | ericgosno91/mlflow | 8d1a9e354b22919423e5295afd650e39191f701a | [
"Apache-2.0"
] | 1 | 2021-08-17T17:53:12.000Z | 2021-08-17T17:53:12.000Z | import os
import sys
import importlib
from unittest import mock
import importlib_metadata
import pytest
import mlflow
from mlflow.utils.requirements_utils import (
_is_comment,
_is_empty,
_is_requirements_file,
_strip_inline_comment,
_join_continued_lines,
_parse_requirements,
_prune_packa... | 33.413919 | 99 | 0.662684 | import os
import sys
import importlib
from unittest import mock
import importlib_metadata
import pytest
import mlflow
from mlflow.utils.requirements_utils import (
_is_comment,
_is_empty,
_is_requirements_file,
_strip_inline_comment,
_join_continued_lines,
_parse_requirements,
_prune_packa... | true | true |
f7162cd39631cdb90524c08f6d65d11f9c020727 | 9,440 | py | Python | reid/modeling/baseline.py | raoyongming/CAL | 76475ff56e399b276630d8bf3a4f5594803609a6 | [
"MIT"
] | 58 | 2021-08-19T16:18:41.000Z | 2022-03-30T13:00:15.000Z | reid/modeling/baseline.py | raoyongming/CAL | 76475ff56e399b276630d8bf3a4f5594803609a6 | [
"MIT"
] | 9 | 2021-09-07T03:46:13.000Z | 2022-03-24T07:22:41.000Z | reid/modeling/baseline.py | raoyongming/CAL | 76475ff56e399b276630d8bf3a4f5594803609a6 | [
"MIT"
] | 13 | 2021-08-20T05:08:09.000Z | 2022-03-07T13:12:29.000Z | import torch
from torch import nn
import torch.nn.functional as F
import sys
from .backbones.resnet import ResNet
sys.path.append('.')
EPSILON = 1e-12
def weights_init_kaiming(m):
classname = m.__class__.__name__
if classname.find('Linear') != -1:
nn.init.kaiming_normal_(m.weight, a=0, mode='fan_ou... | 33.835125 | 129 | 0.606144 | import torch
from torch import nn
import torch.nn.functional as F
import sys
from .backbones.resnet import ResNet
sys.path.append('.')
EPSILON = 1e-12
def weights_init_kaiming(m):
classname = m.__class__.__name__
if classname.find('Linear') != -1:
nn.init.kaiming_normal_(m.weight, a=0, mode='fan_ou... | true | true |
f7162d7130bd56f5b174a8b6dfb6e67c7c002e00 | 1,034 | py | Python | tests/test_runner.py | hwmrocker/boerewors | 2e9b901debb105d9c10e78c8d6f33929aa743daa | [
"Apache-2.0"
] | 10 | 2017-10-16T10:59:17.000Z | 2019-11-28T03:04:16.000Z | tests/test_runner.py | hwmrocker/boerewors | 2e9b901debb105d9c10e78c8d6f33929aa743daa | [
"Apache-2.0"
] | 1 | 2017-10-27T02:32:59.000Z | 2017-11-02T03:37:49.000Z | tests/test_runner.py | hwmrocker/boerewors | 2e9b901debb105d9c10e78c8d6f33929aa743daa | [
"Apache-2.0"
] | 5 | 2017-10-16T11:08:20.000Z | 2019-11-07T09:02:41.000Z | # Copyright 2017 trivago N.V.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 27.210526 | 74 | 0.713733 |
from context import runners
try:
from unittest.mock import Mock
except ImportError:
from mock import Mock
class MyRunner(runners.Runner):
def get_stages(self):
return [1, 2, 3]
def test_stages():
runner = MyRunner()
assert list(runner.get_stages()) == [1, 2, 3]
assert list(runner.st... | true | true |
f7162d7be06b9aa23574e675f52177aea117cc8e | 401 | py | Python | reddit_backend/reddit/migrations/0003_alter_userprofile_name.py | cursedclock/reddit-backend | fb5989c758f5459e510f6599c9b9798424c17ba9 | [
"MIT"
] | 1 | 2022-01-30T17:27:44.000Z | 2022-01-30T17:27:44.000Z | reddit_backend/reddit/migrations/0003_alter_userprofile_name.py | cursedclock/reddit-backend | fb5989c758f5459e510f6599c9b9798424c17ba9 | [
"MIT"
] | null | null | null | reddit_backend/reddit/migrations/0003_alter_userprofile_name.py | cursedclock/reddit-backend | fb5989c758f5459e510f6599c9b9798424c17ba9 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.8 on 2022-01-25 18:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('reddit', '0002_auto_20220125_1727'),
]
operations = [
migrations.AlterField(
model_name='userprofile',
name='name',
... | 21.105263 | 63 | 0.605985 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('reddit', '0002_auto_20220125_1727'),
]
operations = [
migrations.AlterField(
model_name='userprofile',
name='name',
field=models.CharField(max_length=50... | true | true |
f7162de5e6c0ff9b0b6fde9307f43c043b924a3c | 570 | py | Python | void/serve.py | claymation/void | 38055975a624dd9050f7604a73068c58f1185d01 | [
"MIT"
] | null | null | null | void/serve.py | claymation/void | 38055975a624dd9050f7604a73068c58f1185d01 | [
"MIT"
] | null | null | null | void/serve.py | claymation/void | 38055975a624dd9050f7604a73068c58f1185d01 | [
"MIT"
] | null | null | null | import http.server
import socketserver
class TCPServer(socketserver.TCPServer):
allow_reuse_address = True
def serve(root, port):
class Handler(http.server.SimpleHTTPRequestHandler):
def __init__(self, *args, **kwargs):
super().__init__(*args, directory=root, **kwargs)
print("Listen... | 25.909091 | 72 | 0.649123 | import http.server
import socketserver
class TCPServer(socketserver.TCPServer):
allow_reuse_address = True
def serve(root, port):
class Handler(http.server.SimpleHTTPRequestHandler):
def __init__(self, *args, **kwargs):
super().__init__(*args, directory=root, **kwargs)
print("Listen... | true | true |
f7162e0882fce0df624513ea516d61c4ad04a16b | 1,510 | py | Python | conntestd/speed_test.py | robputt796/ConTestD | e9e0f6377520e699afb4e038f79b2bc3b5bbbf64 | [
"Apache-2.0"
] | 5 | 2018-03-18T21:16:24.000Z | 2019-05-23T16:30:18.000Z | conntestd/speed_test.py | robputt796/ConTestD | e9e0f6377520e699afb4e038f79b2bc3b5bbbf64 | [
"Apache-2.0"
] | null | null | null | conntestd/speed_test.py | robputt796/ConTestD | e9e0f6377520e699afb4e038f79b2bc3b5bbbf64 | [
"Apache-2.0"
] | 1 | 2021-12-01T16:30:07.000Z | 2021-12-01T16:30:07.000Z | import datetime
import logging
import sys
from speedtest import Speedtest
from conntestd.db import get_db_session
from conntestd.db import SpeedTestResult
from conntestd.config import DB_CONN
logging.basicConfig(format='%(asctime)s %(levelname)s: %(message)s',
level=logging.INFO,
... | 28.490566 | 89 | 0.613245 | import datetime
import logging
import sys
from speedtest import Speedtest
from conntestd.db import get_db_session
from conntestd.db import SpeedTestResult
from conntestd.config import DB_CONN
logging.basicConfig(format='%(asctime)s %(levelname)s: %(message)s',
level=logging.INFO,
... | true | true |
f7162ec5ccfdab45c868e7d4895b0d5b40c0f2d9 | 33,222 | py | Python | openstack_controller/tests/test_simple_api.py | brentm5/integrations-core | 5cac8788c95d8820435ef9c5d32d6a5463cf491d | [
"BSD-3-Clause"
] | null | null | null | openstack_controller/tests/test_simple_api.py | brentm5/integrations-core | 5cac8788c95d8820435ef9c5d32d6a5463cf491d | [
"BSD-3-Clause"
] | null | null | null | openstack_controller/tests/test_simple_api.py | brentm5/integrations-core | 5cac8788c95d8820435ef9c5d32d6a5463cf491d | [
"BSD-3-Clause"
] | null | null | null | # (C) Datadog, Inc. 2018
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
import mock
import logging
import copy
import pytest
import simplejson as json
import requests
from datadog_checks.openstack_controller.api import ApiFactory, SimpleApi, Authenticator, Credential
from datadog_checks.o... | 36.913333 | 164 | 0.498796 | import mock
import logging
import copy
import pytest
import simplejson as json
import requests
from datadog_checks.openstack_controller.api import ApiFactory, SimpleApi, Authenticator, Credential
from datadog_checks.openstack_controller.exceptions import (
IncompleteIdentity,
MissingNovaEndpoint,
MissingN... | true | true |
f716302a4a1b0faf4eeecb2c309b0e786e32105d | 14,220 | py | Python | sample_application/__init__.py | cheewoei1997/sentiment-analysis | e936824de57a8cd40586a1a19145c6205b6c0843 | [
"MIT"
] | null | null | null | sample_application/__init__.py | cheewoei1997/sentiment-analysis | e936824de57a8cd40586a1a19145c6205b6c0843 | [
"MIT"
] | null | null | null | sample_application/__init__.py | cheewoei1997/sentiment-analysis | e936824de57a8cd40586a1a19145c6205b6c0843 | [
"MIT"
] | null | null | null | from flask import Flask, render_template, flash, request
from flask_bootstrap import Bootstrap
from flask_appconfig import AppConfig
from flask_wtf import Form, RecaptchaField
from flask_wtf.file import FileField
from wtforms import TextField, HiddenField, ValidationError, RadioField,\
BooleanField, SubmitField, In... | 34.019139 | 94 | 0.600563 | from flask import Flask, render_template, flash, request
from flask_bootstrap import Bootstrap
from flask_appconfig import AppConfig
from flask_wtf import Form, RecaptchaField
from flask_wtf.file import FileField
from wtforms import TextField, HiddenField, ValidationError, RadioField,\
BooleanField, SubmitField, In... | true | true |
f71630796ef66bcc8f7e0ca2c0d9cde2f3b48935 | 20,454 | py | Python | zerver/lib/test_runner.py | N-Shar-ma/zulip | 95303a9929424b55a1f7c7cce9313c4619a9533b | [
"Apache-2.0"
] | 4 | 2021-09-16T16:46:55.000Z | 2022-02-06T13:00:21.000Z | zerver/lib/test_runner.py | jai2201/zulip | 95303a9929424b55a1f7c7cce9313c4619a9533b | [
"Apache-2.0"
] | null | null | null | zerver/lib/test_runner.py | jai2201/zulip | 95303a9929424b55a1f7c7cce9313c4619a9533b | [
"Apache-2.0"
] | null | null | null | import multiprocessing
import os
import random
import shutil
from functools import partial
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Type, Union, cast
from unittest import TestLoader, TestSuite, mock, runner
from unittest.result import TestResult
from django.conf import settings
from django.d... | 41.321212 | 130 | 0.669453 | import multiprocessing
import os
import random
import shutil
from functools import partial
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Type, Union, cast
from unittest import TestLoader, TestSuite, mock, runner
from unittest.result import TestResult
from django.conf import settings
from django.d... | true | true |
f71631e249536be2614c39b0ec54682cd0027c08 | 1,177 | py | Python | setup.py | d-nery/nyuki | f185fababee380660930243515652093855acfe7 | [
"Apache-2.0"
] | null | null | null | setup.py | d-nery/nyuki | f185fababee380660930243515652093855acfe7 | [
"Apache-2.0"
] | null | null | null | setup.py | d-nery/nyuki | f185fababee380660930243515652093855acfe7 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
from pip.req import parse_requirements
from setuptools import setup, find_packages
try:
with open('VERSION.txt', 'r') as v:
version = v.read().strip()
except FileNotFoundError:
version = '0.0.0.dev0'
with open('DESCRIPTION', 'r') as d:
long_description = d.read()
# Require... | 29.425 | 128 | 0.6661 |
from pip.req import parse_requirements
from setuptools import setup, find_packages
try:
with open('VERSION.txt', 'r') as v:
version = v.read().strip()
except FileNotFoundError:
version = '0.0.0.dev0'
with open('DESCRIPTION', 'r') as d:
long_description = d.read()
install_reqs = parse_requiremen... | true | true |
f716332bfa3e033470b3ce76020eb7c792a7ea54 | 8,579 | py | Python | doc/source/conf.py | josh-friedlander-kando/arviz | 8bd1de30cbea184c1493f3272fdca8ec1e6bcc8e | [
"Apache-2.0"
] | null | null | null | doc/source/conf.py | josh-friedlander-kando/arviz | 8bd1de30cbea184c1493f3272fdca8ec1e6bcc8e | [
"Apache-2.0"
] | 1 | 2021-07-23T19:32:21.000Z | 2021-07-23T19:32:21.000Z | doc/source/conf.py | josh-friedlander-kando/arviz | 8bd1de30cbea184c1493f3272fdca8ec1e6bcc8e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# ArviZ documentation build configuration file, created by
# sphinx-quickstart on Wed Apr 11 18:33:59 2018.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# auto... | 30.530249 | 96 | 0.681198 |
import os
import re
import sys
from typing import Dict
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
import arviz
arviz.rcParams["data.load"] = "eager"
arviz.Numba.disable_numba()
sys.path.insert(0, os.path.abspath("../sphinxext"))
thumb_directory = "example_thu... | true | true |
f716336d6299fcdb7bed0490151a1ca232af284a | 290 | py | Python | sklift/datasets/__init__.py | rishawsingh/scikit-uplift | a46f11d24025f8489577640271abfc4d847d0334 | [
"MIT"
] | 403 | 2019-12-21T09:36:57.000Z | 2022-03-30T09:36:56.000Z | sklift/datasets/__init__.py | fspofficial/scikit-uplift | c9dd56aa0277e81ef7c4be62bf2fd33432e46f36 | [
"MIT"
] | 100 | 2020-02-29T11:52:21.000Z | 2022-03-29T23:14:33.000Z | sklift/datasets/__init__.py | fspofficial/scikit-uplift | c9dd56aa0277e81ef7c4be62bf2fd33432e46f36 | [
"MIT"
] | 81 | 2019-12-26T08:28:44.000Z | 2022-03-22T09:08:54.000Z | from .datasets import (
get_data_dir,
clear_data_dir,
fetch_x5, fetch_lenta,
fetch_criteo, fetch_hillstrom,
fetch_megafon
)
__all__ = [
'get_data_dir',
'clear_data_dir',
'fetch_x5', 'fetch_lenta',
'fetch_criteo', 'fetch_hillstrom',
'fetch_megafon'
] | 19.333333 | 38 | 0.672414 | from .datasets import (
get_data_dir,
clear_data_dir,
fetch_x5, fetch_lenta,
fetch_criteo, fetch_hillstrom,
fetch_megafon
)
__all__ = [
'get_data_dir',
'clear_data_dir',
'fetch_x5', 'fetch_lenta',
'fetch_criteo', 'fetch_hillstrom',
'fetch_megafon'
] | true | true |
f71633d94eec3d43c9c771dca70dfe474a05d300 | 491 | py | Python | build/sensor_actuator/catkin_generated/pkg.installspace.context.pc.py | kaiodt/kaio_ros_ws | d9ee0edb97d16cf2a0a6074fecd049db7367a032 | [
"BSD-2-Clause"
] | null | null | null | build/sensor_actuator/catkin_generated/pkg.installspace.context.pc.py | kaiodt/kaio_ros_ws | d9ee0edb97d16cf2a0a6074fecd049db7367a032 | [
"BSD-2-Clause"
] | null | null | null | build/sensor_actuator/catkin_generated/pkg.installspace.context.pc.py | kaiodt/kaio_ros_ws | d9ee0edb97d16cf2a0a6074fecd049db7367a032 | [
"BSD-2-Clause"
] | null | null | null | # generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "/home/kaiodt/kaio_ros_ws/install/include".split(';') if "/home/kaiodt/kaio_ros_ws/install/include" != "" else []
PROJECT_CATKIN_DEPENDS = "message_runtime;actionlib_msgs".replace(';', ' ')
PKG_CONFIG_L... | 54.555556 | 147 | 0.753564 | CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "/home/kaiodt/kaio_ros_ws/install/include".split(';') if "/home/kaiodt/kaio_ros_ws/install/include" != "" else []
PROJECT_CATKIN_DEPENDS = "message_runtime;actionlib_msgs".replace(';', ' ')
PKG_CONFIG_LIBRARIES_WITH_PREFIX = "".split(';') if "" != "" else []
... | true | true |
f71633e76aaac65d45ee61243fd61709c015ce9a | 2,671 | py | Python | download.py | HYUNMIN-HWANG/image-gpt | 457bbb212d8435d4bb20a416120301359cb3686b | [
"MIT"
] | 1,641 | 2020-06-17T18:25:14.000Z | 2022-03-29T08:04:07.000Z | download.py | HYUNMIN-HWANG/image-gpt | 457bbb212d8435d4bb20a416120301359cb3686b | [
"MIT"
] | 16 | 2020-06-17T20:08:03.000Z | 2021-12-06T03:18:33.000Z | download.py | HYUNMIN-HWANG/image-gpt | 457bbb212d8435d4bb20a416120301359cb3686b | [
"MIT"
] | 263 | 2020-06-17T18:53:24.000Z | 2022-03-27T11:39:04.000Z | import argparse
import json
import os
import sys
import requests
from tqdm import tqdm
def parse_arguments():
parser = argparse.ArgumentParser()
parser.add_argument("--download_dir", type=str, default="/root/downloads/")
parser.add_argument("--bert", action="store_true", help="download a bert model (defa... | 39.865672 | 146 | 0.639835 | import argparse
import json
import os
import sys
import requests
from tqdm import tqdm
def parse_arguments():
parser = argparse.ArgumentParser()
parser.add_argument("--download_dir", type=str, default="/root/downloads/")
parser.add_argument("--bert", action="store_true", help="download a bert model (defa... | true | true |
f716363d3776ba3009c25f34e002fe11df367a34 | 9,600 | py | Python | openstack/tests/unit/test_connection.py | IamFive/sdk-python | 223b04f90477f7de0f00b3e652d8672ba73271c8 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | openstack/tests/unit/test_connection.py | IamFive/sdk-python | 223b04f90477f7de0f00b3e652d8672ba73271c8 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | openstack/tests/unit/test_connection.py | IamFive/sdk-python | 223b04f90477f7de0f00b3e652d8672ba73271c8 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 39.183673 | 79 | 0.655729 |
import os
import fixtures
from keystoneauth1 import session as ksa_session
import mock
import os_client_config
from openstack import connection
from openstack import exceptions
from openstack import profile
from openstack import session
from openstack.tests.unit import base
CONFIG_AUTH_URL = "http://127.0.0.1:5000... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.