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 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c498df9a78bd33534951fe5b48a871a66008a16 | 740 | py | Python | static/generaMapas/generaCalendarioPolinico.py | othesoluciones/TFM | 8ed46985604c83c517612b38326b39a61b4cf102 | [
"MIT"
] | null | null | null | static/generaMapas/generaCalendarioPolinico.py | othesoluciones/TFM | 8ed46985604c83c517612b38326b39a61b4cf102 | [
"MIT"
] | null | null | null | static/generaMapas/generaCalendarioPolinico.py | othesoluciones/TFM | 8ed46985604c83c517612b38326b39a61b4cf102 | [
"MIT"
] | null | null | null | #Conectamos a la base de datos
import base64
import json
from pymongo import MongoClient as Connection
cadenaCon= 'mongodb://othesoluciones:'+base64.b64decode("b3RoZXNvbHVjaW9uZXM=")+'@ds029635.mlab.com:29635/othesoluciones1'
MONGODB_URI =cadenaCon
conexion = Connection(MONGODB_URI)
db = conexion.othesoluciones1
impo... | 35.238095 | 143 | 0.758108 |
import base64
import json
from pymongo import MongoClient as Connection
cadenaCon= 'mongodb://othesoluciones:'+base64.b64decode("b3RoZXNvbHVjaW9uZXM=")+'@ds029635.mlab.com:29635/othesoluciones1'
MONGODB_URI =cadenaCon
conexion = Connection(MONGODB_URI)
db = conexion.othesoluciones1
import pandas as pd
columnas =['... | true | true |
1c498e29631e47183b4ba18522e66da6b0b16e5d | 1,139 | py | Python | build.py | db4/conan-opencv | c624fdc34452ba0206f9862c16c8e5b52f1738f9 | [
"MIT"
] | null | null | null | build.py | db4/conan-opencv | c624fdc34452ba0206f9862c16c8e5b52f1738f9 | [
"MIT"
] | null | null | null | build.py | db4/conan-opencv | c624fdc34452ba0206f9862c16c8e5b52f1738f9 | [
"MIT"
] | 1 | 2018-09-14T10:18:35.000Z | 2018-09-14T10:18:35.000Z | from conan.packager import ConanMultiPackager
import os
available_versions = ["3.1.0", "3.4.0"]
def main():
"""
Main function.
"""
builder = ConanMultiPackager(build_policy="outdated")
if "CONAN_REFERENCE" in os.environ:
builder.add_common_builds(shared_option_name="OpenCV:shared", pure_... | 35.59375 | 117 | 0.656716 | from conan.packager import ConanMultiPackager
import os
available_versions = ["3.1.0", "3.4.0"]
def main():
builder = ConanMultiPackager(build_policy="outdated")
if "CONAN_REFERENCE" in os.environ:
builder.add_common_builds(shared_option_name="OpenCV:shared", pure_c=False)
else:
for vers... | true | true |
1c498e2f7add5e8cba6aa3ffe578938129f969b3 | 507 | py | Python | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/cli.py | romnn/cookiecutter-pypackage | 469228de74a6cd0a8065270ff7c930d016e2f045 | [
"BSD-3-Clause"
] | 1 | 2021-01-30T04:10:24.000Z | 2021-01-30T04:10:24.000Z | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/cli.py | romnnn/cookiecutter-pypackage | 469228de74a6cd0a8065270ff7c930d016e2f045 | [
"BSD-3-Clause"
] | null | null | null | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/cli.py | romnnn/cookiecutter-pypackage | 469228de74a6cd0a8065270ff7c930d016e2f045 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""Console script for {{cookiecutter.project_slug}}."""
import sys
import typing
import click
@click.command()
def main(args: typing.Optional[str] = None) -> int:
"""Console script for {{cookiecutter.project_slug}}."""
click.echo("Replace this message by putting your code into {{cook... | 25.35 | 103 | 0.682446 |
import sys
import typing
import click
@click.command()
def main(args: typing.Optional[str] = None) -> int:
click.echo("Replace this message by putting your code into {{cookiecutter.project_slug}}.cli.main")
click.echo("See click documentation at http://click.pocoo.org/")
return 0
if __name__ == "__ma... | true | true |
1c49903e1f2ffea5052f9e556c6d9cd76d45ad77 | 80,689 | py | Python | selfdrive/car/toyota/values.py | mohammedx49/ArnePilot01 | 81af1abadc9a9d572919bafeeb698f2a989d363b | [
"MIT"
] | null | null | null | selfdrive/car/toyota/values.py | mohammedx49/ArnePilot01 | 81af1abadc9a9d572919bafeeb698f2a989d363b | [
"MIT"
] | null | null | null | selfdrive/car/toyota/values.py | mohammedx49/ArnePilot01 | 81af1abadc9a9d572919bafeeb698f2a989d363b | [
"MIT"
] | null | null | null | # flake8: noqa
from selfdrive.car import dbc_dict
from cereal import car
Ecu = car.CarParams.Ecu
# Steer torque limits
class SteerLimitParams:
STEER_MAX = 1500
STEER_DELTA_UP = 10 # 1.5s time to peak torque
STEER_DELTA_DOWN = 44 # always lower than 45 otherwise the Rav4 faults (Prius seems ok with 50)... | 68.964957 | 1,405 | 0.603267 |
from selfdrive.car import dbc_dict
from cereal import car
Ecu = car.CarParams.Ecu
class SteerLimitParams:
STEER_MAX = 1500
STEER_DELTA_UP = 10
STEER_DELTA_DOWN = 44
STEER_ERROR_MAX = 350
class CAR:
PRIUS = "TOYOTA PRIUS 2017"
PRIUS_2019 = "TOYOTA PRIUS 2019"
RAV4H = "TOYOTA RAV4 HYBR... | true | true |
1c4990d4c73ad0f202de3c760de5c414e397c7d8 | 636 | py | Python | paths.py | ChiLlx/Modified-3D-UNet-Pytorch | 0b3bb64bbfa7c5422b2fc85d0c4eb37c0773afec | [
"MIT"
] | 193 | 2018-04-17T07:28:16.000Z | 2022-03-23T00:34:43.000Z | paths.py | ChiLlx/Modified-3D-UNet-Pytorch | 0b3bb64bbfa7c5422b2fc85d0c4eb37c0773afec | [
"MIT"
] | 7 | 2018-07-16T01:54:23.000Z | 2020-12-04T06:55:02.000Z | paths.py | ChiLlx/Modified-3D-UNet-Pytorch | 0b3bb64bbfa7c5422b2fc85d0c4eb37c0773afec | [
"MIT"
] | 50 | 2018-08-13T23:06:19.000Z | 2021-12-09T09:42:13.000Z | raw_training_data_folder = "/media/pkao/Dataset/BraTS2018/training"
raw_validation_data_folder = "/media/pkao/Dataset/BraTS/2017/Brats17ValidationData"
raw_testing_data_folder = "/media/pkao/Datase/BraTS/2017/Brats17TestingData"
preprocessed_training_data_folder = "/media/pkao/Dataset/DeepLearningData/BraTS_2018_train... | 63.6 | 121 | 0.849057 | raw_training_data_folder = "/media/pkao/Dataset/BraTS2018/training"
raw_validation_data_folder = "/media/pkao/Dataset/BraTS/2017/Brats17ValidationData"
raw_testing_data_folder = "/media/pkao/Datase/BraTS/2017/Brats17TestingData"
preprocessed_training_data_folder = "/media/pkao/Dataset/DeepLearningData/BraTS_2018_train... | true | true |
1c499129a87226688813507ae4e22c4b9909a7a1 | 520 | py | Python | example/main.py | helioh2/pygame-universe | 94be98072ff1644480aaaab9692c8040223c3fb1 | [
"MIT"
] | 1 | 2018-04-04T17:55:35.000Z | 2018-04-04T17:55:35.000Z | example/main.py | helioh2/pygame-universe | 94be98072ff1644480aaaab9692c8040223c3fb1 | [
"MIT"
] | null | null | null | example/main.py | helioh2/pygame-universe | 94be98072ff1644480aaaab9692c8040223c3fb1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from funcoes import *
''' ================= '''
''' Main (Big Bang):
'''
''' Jogo -> Jogo '''
''' inicie o mundo com main(JOGO_INICIAL) '''
def main(inic):
big_bang(inic, tela=TELA,
frequencia=60,
quando_tick=mover_jogo,
desenh... | 20.8 | 50 | 0.532692 |
from funcoes import *
def main(inic):
big_bang(inic, tela=TELA,
frequencia=60,
quando_tick=mover_jogo,
desenhar=desenha_jogo,
quando_tecla=trata_tecla,
quando_solta_tecla=trata_solta_tecla,
modo_debug=True,
fonte_debug=... | true | true |
1c4991c37149654c613707697ef34148eef8f639 | 2,815 | py | Python | git-auto-commit.py | electryone/git-auto-commit | 66dbd02d0d4696f7f12162784aff0c97318a1a74 | [
"MIT"
] | null | null | null | git-auto-commit.py | electryone/git-auto-commit | 66dbd02d0d4696f7f12162784aff0c97318a1a74 | [
"MIT"
] | null | null | null | git-auto-commit.py | electryone/git-auto-commit | 66dbd02d0d4696f7f12162784aff0c97318a1a74 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2018/9/29 22:49
# @Author : Huyd
# @Site :
# @File : git-auto-commit.py
# @Software: PyCharm
import datetime
import smtplib
import subprocess
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from email.header import He... | 32.356322 | 125 | 0.596803 |
import datetime
import smtplib
import subprocess
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from email.header import Header
import re
import schedule
import time
def send_mail(subject, message):
mail_host = "smtp.163.com"
mail_user = "electrycache1@163.com" ... | true | true |
1c499260da486610cee64c7a7a643e367163b5b2 | 4,052 | py | Python | objects/CSCG/_2d/forms/standard/_2_form/base/reconstruct.py | mathischeap/mifem | 3242e253fb01ca205a76568eaac7bbdb99e3f059 | [
"MIT"
] | 1 | 2020-10-14T12:48:35.000Z | 2020-10-14T12:48:35.000Z | objects/CSCG/_2d/forms/standard/_2_form/base/reconstruct.py | mathischeap/mifem | 3242e253fb01ca205a76568eaac7bbdb99e3f059 | [
"MIT"
] | null | null | null | objects/CSCG/_2d/forms/standard/_2_form/base/reconstruct.py | mathischeap/mifem | 3242e253fb01ca205a76568eaac7bbdb99e3f059 | [
"MIT"
] | null | null | null |
from screws.freeze.base import FrozenOnly
import numpy as np
class _2dCSCG_S2F_Reconstruct(FrozenOnly):
""""""
def __init__(self, f):
self._f_ = f
self._freeze_self_()
def __call__(self, xi, eta, ravel=False, i=None, vectorized=False, value_only=False):
"""
Reconstruct t... | 38.961538 | 107 | 0.488648 |
from screws.freeze.base import FrozenOnly
import numpy as np
class _2dCSCG_S2F_Reconstruct(FrozenOnly):
def __init__(self, f):
self._f_ = f
self._freeze_self_()
def __call__(self, xi, eta, ravel=False, i=None, vectorized=False, value_only=False):
f = self._f_
mesh = self._f_... | true | true |
1c4992765c22841944c3a0022d4163faee833f72 | 750 | py | Python | scheduleSynchronizer/urls.py | 497022407/Shifts-manager | beccb63c8622c015a9a453f586d4c3bb5d5066b9 | [
"Apache-2.0"
] | null | null | null | scheduleSynchronizer/urls.py | 497022407/Shifts-manager | beccb63c8622c015a9a453f586d4c3bb5d5066b9 | [
"Apache-2.0"
] | null | null | null | scheduleSynchronizer/urls.py | 497022407/Shifts-manager | beccb63c8622c015a9a453f586d4c3bb5d5066b9 | [
"Apache-2.0"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
# /
path('', views.home, name='home'),
path('guide', views.guide, name='guide'),
# TEMPORARY
path('signin', views.sign_in, name='signin'),
path('signout', views.sign_out, name='signout'),
path('calendar', views.calendar, name... | 32.608696 | 75 | 0.674667 | from django.urls import path
from . import views
urlpatterns = [
path('', views.home, name='home'),
path('guide', views.guide, name='guide'),
path('signin', views.sign_in, name='signin'),
path('signout', views.sign_out, name='signout'),
path('calendar', views.calendar, name='calendar'),
... | true | true |
1c49941779b1860c8f46a3c4c6efc4ea5ed1d14a | 374 | py | Python | onlinecourse/migrations/0002_auto_20220120_0050.py | jalvaradoWD/final-cloud-app-with-database | 9d3f814b68f24343b48c336dd4464764e805f0a5 | [
"Apache-2.0"
] | null | null | null | onlinecourse/migrations/0002_auto_20220120_0050.py | jalvaradoWD/final-cloud-app-with-database | 9d3f814b68f24343b48c336dd4464764e805f0a5 | [
"Apache-2.0"
] | null | null | null | onlinecourse/migrations/0002_auto_20220120_0050.py | jalvaradoWD/final-cloud-app-with-database | 9d3f814b68f24343b48c336dd4464764e805f0a5 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.1.3 on 2022-01-20 00:50
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('onlinecourse', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='choice',
name='is_correct',
... | 19.684211 | 47 | 0.588235 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('onlinecourse', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='choice',
name='is_correct',
field=models.BooleanField(),
),... | true | true |
1c49946e54bff8f5ded1a44c434d7ff67635335a | 7,120 | py | Python | veriloggen/types/ram.py | akmaru/veriloggen | 74f998139e8cf613f7703fa4cffd571bbf069bbc | [
"Apache-2.0"
] | null | null | null | veriloggen/types/ram.py | akmaru/veriloggen | 74f998139e8cf613f7703fa4cffd571bbf069bbc | [
"Apache-2.0"
] | null | null | null | veriloggen/types/ram.py | akmaru/veriloggen | 74f998139e8cf613f7703fa4cffd571bbf069bbc | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import print_function
import copy
import veriloggen.core.vtypes as vtypes
from veriloggen.core.module import Module
from . import util
def mkRAMDefinition(name, datawidth=32, addrwidth=10, numports=2,
initvals=None, sync=True, with_enable=Fal... | 33.584906 | 92 | 0.556039 | from __future__ import absolute_import
from __future__ import print_function
import copy
import veriloggen.core.vtypes as vtypes
from veriloggen.core.module import Module
from . import util
def mkRAMDefinition(name, datawidth=32, addrwidth=10, numports=2,
initvals=None, sync=True, with_enable=Fal... | true | true |
1c499523c6731619a57785345e99096f3cd43458 | 3,402 | py | Python | tapiriik/services/ratelimiting.py | Decathlon/exercisync | e9df9d4f2210fff8cfc8b34e2e5f9d09d84bddef | [
"Apache-2.0"
] | 11 | 2019-08-05T15:38:25.000Z | 2022-03-12T09:50:02.000Z | tapiriik/services/ratelimiting.py | Decathlon/exercisync | e9df9d4f2210fff8cfc8b34e2e5f9d09d84bddef | [
"Apache-2.0"
] | 31 | 2019-03-05T20:38:11.000Z | 2022-03-21T09:41:23.000Z | tapiriik/services/ratelimiting.py | Decathlon/exercisync | e9df9d4f2210fff8cfc8b34e2e5f9d09d84bddef | [
"Apache-2.0"
] | 8 | 2019-03-05T08:20:07.000Z | 2021-08-18T08:20:17.000Z | from tapiriik.database import ratelimit as rl_db, redis
from tapiriik.settings import _GLOBAL_LOGGER
from pymongo.read_preferences import ReadPreference
from datetime import datetime, timedelta
import math
import logging
class RateLimitExceededException(Exception):
pass
class RateLimit:
def Limit(key):
current_li... | 46.60274 | 147 | 0.726925 | from tapiriik.database import ratelimit as rl_db, redis
from tapiriik.settings import _GLOBAL_LOGGER
from pymongo.read_preferences import ReadPreference
from datetime import datetime, timedelta
import math
import logging
class RateLimitExceededException(Exception):
pass
class RateLimit:
def Limit(key):
current_li... | true | true |
1c4995509deb8fbfcad4283c6a2e9e2fcf5fef57 | 13 | py | Python | ProximityScore/ProximityScore.py | IndyMPO/IndyGeoprocessingTools | 968f9befc37252e065e8d8085c0d10f17a871152 | [
"Apache-2.0"
] | null | null | null | ProximityScore/ProximityScore.py | IndyMPO/IndyGeoprocessingTools | 968f9befc37252e065e8d8085c0d10f17a871152 | [
"Apache-2.0"
] | 3 | 2016-08-30T16:10:20.000Z | 2016-09-06T15:32:44.000Z | ProximityScore/ProximityScore.py | IndyMPO/IndyGeoprocessingTools | 968f9befc37252e065e8d8085c0d10f17a871152 | [
"Apache-2.0"
] | null | null | null | import arcpy
| 6.5 | 12 | 0.846154 | import arcpy
| true | true |
1c49969fcd2408de0311767f86ec53448a5425dc | 80 | py | Python | grokproject/__init__.py | zopefoundation/grokproject | 78d00bded86dbc1cf8ed2f561c8221eda7e68e7a | [
"ZPL-2.1"
] | 4 | 2015-12-05T05:47:56.000Z | 2017-08-22T13:45:02.000Z | grokproject/__init__.py | zopefoundation/grokproject | 78d00bded86dbc1cf8ed2f561c8221eda7e68e7a | [
"ZPL-2.1"
] | 12 | 2015-12-03T11:58:01.000Z | 2018-01-23T13:29:25.000Z | grokproject/__init__.py | zopefoundation/grokproject | 78d00bded86dbc1cf8ed2f561c8221eda7e68e7a | [
"ZPL-2.1"
] | 5 | 2016-03-21T10:23:36.000Z | 2020-09-27T02:47:31.000Z | from grokproject.templates import GrokProject
from grokproject.main import main
| 26.666667 | 45 | 0.875 | from grokproject.templates import GrokProject
from grokproject.main import main
| true | true |
1c4996ec7c2dfcc43f4cb7feb849a3a3828a477f | 858 | py | Python | Virtualenv/Env/src/GoTravel/Contact/migrations/0001_initial.py | Anoop01234/Go-Travel | aa91f1a4ce7e7ed78de8eadc55e6a25d1a73bdd8 | [
"MIT"
] | null | null | null | Virtualenv/Env/src/GoTravel/Contact/migrations/0001_initial.py | Anoop01234/Go-Travel | aa91f1a4ce7e7ed78de8eadc55e6a25d1a73bdd8 | [
"MIT"
] | null | null | null | Virtualenv/Env/src/GoTravel/Contact/migrations/0001_initial.py | Anoop01234/Go-Travel | aa91f1a4ce7e7ed78de8eadc55e6a25d1a73bdd8 | [
"MIT"
] | 1 | 2021-12-21T17:27:34.000Z | 2021-12-21T17:27:34.000Z | # Generated by Django 3.0.7 on 2020-06-23 02:13
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Contact',
fields=[
('id', models.AutoField(... | 28.6 | 114 | 0.538462 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Contact',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=... | true | true |
1c4997d7ab42517d38d4ecafb5aa2ac189d46bdc | 1,885 | py | Python | inbm/cloudadapter-agent/tests/unit/test_cloudadapter.py | ahameedx/intel-inb-manageability | aca445fa4cef0b608e6e88e74476547e10c06073 | [
"Apache-2.0"
] | 5 | 2021-12-13T21:19:31.000Z | 2022-01-18T18:29:43.000Z | inbm/cloudadapter-agent/tests/unit/test_cloudadapter.py | ahameedx/intel-inb-manageability | aca445fa4cef0b608e6e88e74476547e10c06073 | [
"Apache-2.0"
] | 45 | 2021-12-30T17:21:09.000Z | 2022-03-29T22:47:32.000Z | inbm/cloudadapter-agent/tests/unit/test_cloudadapter.py | ahameedx/intel-inb-manageability | aca445fa4cef0b608e6e88e74476547e10c06073 | [
"Apache-2.0"
] | 4 | 2022-01-26T17:42:54.000Z | 2022-03-30T04:48:04.000Z | """
Unit tests for the cloudadapter file
"""
import unittest
import mock
import sys
import cloudadapter.cloudadapter as cloudadapter
from cloudadapter.cloudadapter import CloudAdapter
from cloudadapter.exceptions import BadConfigError
class TestCloudAdapter(unittest.TestCase):
@mock.patch('cloudadapter.clou... | 39.270833 | 96 | 0.741114 |
import unittest
import mock
import sys
import cloudadapter.cloudadapter as cloudadapter
from cloudadapter.cloudadapter import CloudAdapter
from cloudadapter.exceptions import BadConfigError
class TestCloudAdapter(unittest.TestCase):
@mock.patch('cloudadapter.cloudadapter.fileConfig', autospec=True)
@mock.... | true | true |
1c4997ef0d7b724a972be742252a3257c5688768 | 660 | py | Python | videochat/pyserver/manage.py | GenBInc/quickhellou | fb97f995904a8397c631a7256f86905c5b16a7c0 | [
"MIT"
] | 1 | 2022-03-31T13:18:41.000Z | 2022-03-31T13:18:41.000Z | videochat/pyserver/manage.py | GenBInc/quickhellou | fb97f995904a8397c631a7256f86905c5b16a7c0 | [
"MIT"
] | null | null | null | videochat/pyserver/manage.py | GenBInc/quickhellou | fb97f995904a8397c631a7256f86905c5b16a7c0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'qhv2.settings')
try:
from django.core.management import execute_from_command_line
except ImportE... | 28.695652 | 73 | 0.677273 |
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'qhv2.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
... | true | true |
1c4998e95581100279df8ab9274b91042ee7fc13 | 479 | py | Python | software/old_stuff/lm75.py | 84ace/esp32_smart_keezer | 48f13ab377de82d3eea2c7a769ff3f82ff48fdd9 | [
"MIT"
] | 1 | 2022-01-27T21:30:10.000Z | 2022-01-27T21:30:10.000Z | software/old_stuff/lm75.py | 84ace/esp32_smart_keezer | 48f13ab377de82d3eea2c7a769ff3f82ff48fdd9 | [
"MIT"
] | null | null | null | software/old_stuff/lm75.py | 84ace/esp32_smart_keezer | 48f13ab377de82d3eea2c7a769ff3f82ff48fdd9 | [
"MIT"
] | null | null | null | class LM75(object):
ADDRESS = 0x48 # LM75 bus address
FREQUENCY = 100000 # I2C bus frequency
def __init__(self):
pass
def get_output(self):
"""Return raw output from the LM75 sensor."""
output = self.i2c.readfrom(self.ADDRESS, 2)
return output[0], output[1]
... | 28.176471 | 53 | 0.580376 | class LM75(object):
ADDRESS = 0x48
FREQUENCY = 100000
def __init__(self):
pass
def get_output(self):
output = self.i2c.readfrom(self.ADDRESS, 2)
return output[0], output[1]
def get_temp(self):
temp = self.get_output()
return int(temp[0]), floor... | true | true |
1c499a6ec3f70ca7497e6aebb8e03ced8e3f52ca | 91 | py | Python | framenet/apps.py | henryyang42/lifelog_annotation | 586f44132508f59e97dda701bd5602d26b79a6f4 | [
"MIT"
] | null | null | null | framenet/apps.py | henryyang42/lifelog_annotation | 586f44132508f59e97dda701bd5602d26b79a6f4 | [
"MIT"
] | null | null | null | framenet/apps.py | henryyang42/lifelog_annotation | 586f44132508f59e97dda701bd5602d26b79a6f4 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class FramenetConfig(AppConfig):
name = 'framenet'
| 15.166667 | 33 | 0.758242 | from django.apps import AppConfig
class FramenetConfig(AppConfig):
name = 'framenet'
| true | true |
1c499b1f6bad0e0e9467d88057d523b47ce4dcbc | 1,301 | py | Python | notifications/utils/models/tests.py | Revibe-Music/core-services | 6b11cf16ad2c35d948f3a5c0e7a161e5b7cfc1b2 | [
"MIT"
] | 2 | 2022-01-24T23:30:18.000Z | 2022-01-26T00:21:22.000Z | notifications/utils/models/tests.py | Revibe-Music/core-services | 6b11cf16ad2c35d948f3a5c0e7a161e5b7cfc1b2 | [
"MIT"
] | null | null | null | notifications/utils/models/tests.py | Revibe-Music/core-services | 6b11cf16ad2c35d948f3a5c0e7a161e5b7cfc1b2 | [
"MIT"
] | null | null | null | """
Created: 10 June 2020
"""
from revibe._helpers.test import RevibeTestCase
from notifications.models import Notification
from notifications.utils.models.notification import create_notification_uuid, mark_email_as_read
# -----------------------------------------------------------------------------
class Notifica... | 28.282609 | 123 | 0.651038 |
from revibe._helpers.test import RevibeTestCase
from notifications.models import Notification
from notifications.utils.models.notification import create_notification_uuid, mark_email_as_read
class NotificationUtilsTestCase(RevibeTestCase):
def setUp(self):
self._get_application()
self._get_use... | true | true |
1c499fc2f86c8a8a004cb58ecc8b62a1fa49790d | 485 | py | Python | parsl/tests/low_latency/utils.py | cylondata/parsl | 00ff9372bd841dafef8a0b3566c79ffe68f0e367 | [
"Apache-2.0"
] | 323 | 2017-07-28T21:31:27.000Z | 2022-03-05T13:06:05.000Z | parsl/tests/low_latency/utils.py | cylondata/parsl | 00ff9372bd841dafef8a0b3566c79ffe68f0e367 | [
"Apache-2.0"
] | 1,286 | 2017-06-01T16:50:00.000Z | 2022-03-31T16:45:14.000Z | parsl/tests/low_latency/utils.py | cylondata/parsl | 00ff9372bd841dafef8a0b3566c79ffe68f0e367 | [
"Apache-2.0"
] | 113 | 2017-06-03T11:38:40.000Z | 2022-03-26T16:43:05.000Z | import subprocess
def ping_time(ip, n=5):
"""
Returns the average ping time in microseconds.
Note: This function is inherently platform specific.
It currently works on Midway.
"""
cmd = "ping {} -c {}".format(ip, n)
p = subprocess.Popen(cmd.split(" "), stdout=subprocess.PIPE)
output =... | 28.529412 | 64 | 0.62268 | import subprocess
def ping_time(ip, n=5):
cmd = "ping {} -c {}".format(ip, n)
p = subprocess.Popen(cmd.split(" "), stdout=subprocess.PIPE)
output = str(p.communicate()[0])
stats = output.split("\n")[-1].split(" = ")[-1].split("/")
avg_ping_time = float(stats[1])
return avg_ping_time * 1000
| true | true |
1c49a0de93121462a77b6c4abf13849b5433cd52 | 4,847 | py | Python | chapter07/detect_car_bow_svm_sliding_window.py | insoo223/openCVhowse | d8885ab4f87a9d577fd660e60d41222dc2156332 | [
"BSD-3-Clause"
] | 286 | 2019-06-29T11:47:40.000Z | 2022-03-29T08:41:28.000Z | chapter07/detect_car_bow_svm_sliding_window.py | insoo223/openCVhowse | d8885ab4f87a9d577fd660e60d41222dc2156332 | [
"BSD-3-Clause"
] | 8 | 2020-10-01T17:48:04.000Z | 2022-03-26T04:27:06.000Z | chapter07/detect_car_bow_svm_sliding_window.py | insoo223/openCVhowse | d8885ab4f87a9d577fd660e60d41222dc2156332 | [
"BSD-3-Clause"
] | 153 | 2019-07-01T02:53:02.000Z | 2022-03-28T08:43:44.000Z | import cv2
import numpy as np
import os
from non_max_suppression import non_max_suppression_fast as nms
if not os.path.isdir('CarData'):
print('CarData folder not found. Please download and unzip '
'http://l2r.cs.uiuc.edu/~cogcomp/Data/Car/CarData.tar.gz '
'or https://github.com/gcr/arc-evalua... | 36.443609 | 78 | 0.621003 | import cv2
import numpy as np
import os
from non_max_suppression import non_max_suppression_fast as nms
if not os.path.isdir('CarData'):
print('CarData folder not found. Please download and unzip '
'http://l2r.cs.uiuc.edu/~cogcomp/Data/Car/CarData.tar.gz '
'or https://github.com/gcr/arc-evalua... | true | true |
1c49a501a055fdf11fd4806f3310e16640bf3419 | 1,209 | py | Python | experiments_dikower/controllers/drlbox/net/q_net.py | prokhn/onti-2019-bigdata | b9296141958f544177388be94072efce7bdc7814 | [
"MIT"
] | null | null | null | experiments_dikower/controllers/drlbox/net/q_net.py | prokhn/onti-2019-bigdata | b9296141958f544177388be94072efce7bdc7814 | [
"MIT"
] | null | null | null | experiments_dikower/controllers/drlbox/net/q_net.py | prokhn/onti-2019-bigdata | b9296141958f544177388be94072efce7bdc7814 | [
"MIT"
] | null | null | null |
import tensorflow as tf
from drlbox.common.namescope import TF_NAMESCOPE
from drlbox.net.net_base import RLNet
class QNet(RLNet):
def set_model(self, model):
self.model = model
self.weights = model.weights
self.ph_state, = model.inputs
self.tf_values, = model.outputs
def set... | 31.815789 | 78 | 0.643507 |
import tensorflow as tf
from drlbox.common.namescope import TF_NAMESCOPE
from drlbox.net.net_base import RLNet
class QNet(RLNet):
def set_model(self, model):
self.model = model
self.weights = model.weights
self.ph_state, = model.inputs
self.tf_values, = model.outputs
def set... | true | true |
1c49a67e7bb4ec8b16df469d4c6b5c559bb2054a | 493 | py | Python | dostaweemvse/dostaweemvse/models/order.py | ale3otik/DostaweemWse | 0887d47cbe5fba30c3c2b0ecf064d151efd961d0 | [
"MIT"
] | 3 | 2017-12-10T17:41:22.000Z | 2017-12-12T20:27:31.000Z | dostaweemvse/dostaweemvse/models/order.py | ale3otik/DostaweemWse | 0887d47cbe5fba30c3c2b0ecf064d151efd961d0 | [
"MIT"
] | null | null | null | dostaweemvse/dostaweemvse/models/order.py | ale3otik/DostaweemWse | 0887d47cbe5fba30c3c2b0ecf064d151efd961d0 | [
"MIT"
] | null | null | null | from django.db import models
from .route import Route
from .location import Location
class Order(models.Model):
route = models.ForeignKey(Route, on_delete=models.CASCADE)
metadata = models.CharField(max_length=50)
from_location = models.ForeignKey(Location, on_delete=models.CASCADE, related_name='location3... | 41.083333 | 99 | 0.774848 | from django.db import models
from .route import Route
from .location import Location
class Order(models.Model):
route = models.ForeignKey(Route, on_delete=models.CASCADE)
metadata = models.CharField(max_length=50)
from_location = models.ForeignKey(Location, on_delete=models.CASCADE, related_name='location3... | true | true |
1c49a68dfda9e081e60939541072bfa57b8b2ac7 | 99 | py | Python | qiniuFolderSync/utils.py | ipconfiger/qiniuFolderSync | 0e1362bb3dda6ca898040f8e019e712d6ed1db6b | [
"MIT"
] | null | null | null | qiniuFolderSync/utils.py | ipconfiger/qiniuFolderSync | 0e1362bb3dda6ca898040f8e019e712d6ed1db6b | [
"MIT"
] | null | null | null | qiniuFolderSync/utils.py | ipconfiger/qiniuFolderSync | 0e1362bb3dda6ca898040f8e019e712d6ed1db6b | [
"MIT"
] | null | null | null | # coding=utf8
import os
def getpath(dir_path, *path):
return os.path.join(dir_path, *path)
| 11 | 40 | 0.686869 |
import os
def getpath(dir_path, *path):
return os.path.join(dir_path, *path)
| true | true |
1c49a6bad5a201d8712133721c743ef53f0ea197 | 2,275 | py | Python | tests/unit/flow/test_flow_before_after.py | afizs/jina | 52c554c2d593e24129e86dfe3c71bf04f1495082 | [
"Apache-2.0"
] | 3 | 2021-07-30T09:47:54.000Z | 2021-07-31T22:29:20.000Z | tests/unit/flow/test_flow_before_after.py | sheetal01761/jina | 520fc0794fb43d96e1fc85534e9df3cf9c89c42e | [
"Apache-2.0"
] | 2 | 2021-07-14T14:07:18.000Z | 2022-02-06T05:00:41.000Z | tests/unit/flow/test_flow_before_after.py | sheetal01761/jina | 520fc0794fb43d96e1fc85534e9df3cf9c89c42e | [
"Apache-2.0"
] | 2 | 2021-10-06T07:28:11.000Z | 2021-11-18T20:20:18.000Z | import pytest
from jina import Executor, requests, __default_executor__
from jina import Flow
from tests import random_docs
@pytest.mark.parametrize('protocol', ['websocket', 'grpc', 'http'])
def test_flow(protocol):
docs = random_docs(10)
f = Flow(protocol=protocol).add(name='p1')
with f:
f.ind... | 26.149425 | 85 | 0.627692 | import pytest
from jina import Executor, requests, __default_executor__
from jina import Flow
from tests import random_docs
@pytest.mark.parametrize('protocol', ['websocket', 'grpc', 'http'])
def test_flow(protocol):
docs = random_docs(10)
f = Flow(protocol=protocol).add(name='p1')
with f:
f.ind... | true | true |
1c49a6c86e3fa57ac97eba6d634a4f64dce2ee44 | 654 | py | Python | runs/snort/10KB/src1-tgt1/ssl-par-max-iter00200.cfg.py | Largio/broeval | 89e831d07f066100afdd1a5b220f9f08f1c10b3d | [
"MIT"
] | null | null | null | runs/snort/10KB/src1-tgt1/ssl-par-max-iter00200.cfg.py | Largio/broeval | 89e831d07f066100afdd1a5b220f9f08f1c10b3d | [
"MIT"
] | null | null | null | runs/snort/10KB/src1-tgt1/ssl-par-max-iter00200.cfg.py | Largio/broeval | 89e831d07f066100afdd1a5b220f9f08f1c10b3d | [
"MIT"
] | null | null | null |
# Write results to this file
OUTFILE = 'runs/snort/10KB/src1-tgt1/ssl-par-max-iter00200.result.csv'
# Source computers for the request
SOURCE = ['10.0.0.1']
# Target machines for the requests (aka server)
TARGET = ['10.0.0.2']
# IDS Mode. (ATM: noids, min, max, http, ssl, ftp, icmp, mysql)
IDSMODE = 'max'
# Connec... | 24.222222 | 70 | 0.701835 |
OUTFILE = 'runs/snort/10KB/src1-tgt1/ssl-par-max-iter00200.result.csv'
SOURCE = ['10.0.0.1']
TARGET = ['10.0.0.2']
IDSMODE = 'max'
MODE = 'par'
EPOCHS = 100
ITER = 200
SIZE = 4
PROTOCOL = 'ssl' | true | true |
1c49a6f7de9175a674e3e1ba8b8c5f27a3fcd695 | 290 | py | Python | 1138_05_12-merge.py | nchaparr/Geospatial-Analysis-with-Python | 6e0d1ff429baa4205c63bf842ab950ed4176536f | [
"CC0-1.0"
] | null | null | null | 1138_05_12-merge.py | nchaparr/Geospatial-Analysis-with-Python | 6e0d1ff429baa4205c63bf842ab950ed4176536f | [
"CC0-1.0"
] | null | null | null | 1138_05_12-merge.py | nchaparr/Geospatial-Analysis-with-Python | 6e0d1ff429baa4205c63bf842ab950ed4176536f | [
"CC0-1.0"
] | null | null | null | """Merge multiple shapefiles"""
import glob
import shapefile
files = glob.glob("footprints_*shp")
w = shapefile.Writer()
r = None
for f in files:
r = shapefile.Reader(f)
w._shapes.extend(r.shapes())
w.records.extend(r.records())
w.fields = list(r.fields)
w.save("Merged")
| 22.307692 | 37 | 0.675862 | import glob
import shapefile
files = glob.glob("footprints_*shp")
w = shapefile.Writer()
r = None
for f in files:
r = shapefile.Reader(f)
w._shapes.extend(r.shapes())
w.records.extend(r.records())
w.fields = list(r.fields)
w.save("Merged")
| true | true |
1c49a7f9ce091fecb34b660858eb1cfba5796214 | 7,240 | py | Python | pynot/tests.py | adamora/pynot | 47abb7e9db85301a976c012380e3963c64590414 | [
"Apache-2.0"
] | 6 | 2018-09-15T08:05:34.000Z | 2019-01-19T22:51:27.000Z | pynot/tests.py | intelligenia/pynot | 47abb7e9db85301a976c012380e3963c64590414 | [
"Apache-2.0"
] | null | null | null | pynot/tests.py | intelligenia/pynot | 47abb7e9db85301a976c012380e3963c64590414 | [
"Apache-2.0"
] | null | null | null | from django.test import TestCase
from pynot.models import *
from pynot.factories import *
from rest_assured.testcases import *
from django.contrib.auth import get_user_model
from rest_framework.authtoken.models import Token
from rest_framework import serializers
class CategoryTestCase(ReadRESTAPITestCaseMixin,
... | 36.565657 | 100 | 0.623895 | from django.test import TestCase
from pynot.models import *
from pynot.factories import *
from rest_assured.testcases import *
from django.contrib.auth import get_user_model
from rest_framework.authtoken.models import Token
from rest_framework import serializers
class CategoryTestCase(ReadRESTAPITestCaseMixin,
... | true | true |
1c49a7fda9f17643c78c4e525ad84da9839557ec | 7,469 | py | Python | FastRCNN/BrainScript/PARAMETERS.py | jakkaj/CNTK_AMLWorkbench | 27a496c665f2565e15450da8743807f528326d5e | [
"MIT"
] | 6 | 2017-11-16T21:26:38.000Z | 2020-05-04T21:06:10.000Z | FastRCNN/BrainScript/PARAMETERS.py | jakkaj/CNTK_AMLWorkbench | 27a496c665f2565e15450da8743807f528326d5e | [
"MIT"
] | null | null | null | FastRCNN/BrainScript/PARAMETERS.py | jakkaj/CNTK_AMLWorkbench | 27a496c665f2565e15450da8743807f528326d5e | [
"MIT"
] | 2 | 2017-11-22T05:42:27.000Z | 2018-12-31T11:18:26.000Z | from __future__ import print_function
import os
from imdb_data import imdb_data
import fastRCNN, time, datetime
from fastRCNN.pascal_voc import pascal_voc # as nmsPython
print (datetime.datetime.fromtimestamp(time.time()).strftime('%Y-%m-%d %H:%M:%S'))
dataset = "Grocery"
#dataset = "pascalVoc"
#dataset = "pascalVoc_a... | 49.463576 | 217 | 0.641317 | from __future__ import print_function
import os
from imdb_data import imdb_data
import fastRCNN, time, datetime
from fastRCNN.pascal_voc import pascal_voc
print (datetime.datetime.fromtimestamp(time.time()).strftime('%Y-%m-%d %H:%M:%S'))
dataset = "Grocery"
Dir = self.rootDir
self.roi_minDimRel ... | true | true |
1c49ab770d5e3e8175eecd2530c65d772f092a4d | 3,811 | py | Python | util/lintlib.py | Xanewok/rust-clippy | 9d1792a4265c3645d716c5bf085c07be8749332a | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2019-05-14T09:10:46.000Z | 2019-05-14T09:10:46.000Z | util/lintlib.py | Xanewok/rust-clippy | 9d1792a4265c3645d716c5bf085c07be8749332a | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | util/lintlib.py | Xanewok/rust-clippy | 9d1792a4265c3645d716c5bf085c07be8749332a | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Common utils for the several housekeeping scripts.
import os
import re
import collections
import logging as log
log.basicConfig(level=log.INFO, format='%(levelname)s: %(message)s')
Lint = collections.namedtuple('Lint', 'name level doc sourcefile group')
Config = collections.namedtuple('Config', 'name ty doc defaul... | 31.758333 | 100 | 0.479402 |
import os
import re
import collections
import logging as log
log.basicConfig(level=log.INFO, format='%(levelname)s: %(message)s')
Lint = collections.namedtuple('Lint', 'name level doc sourcefile group')
Config = collections.namedtuple('Config', 'name ty doc default')
lintname_re = re.compile(r'''pub\s+([A-Z_][A-Z_... | true | true |
1c49abbc287cae05a51c953706e6233eceda83d3 | 682 | py | Python | qiskit/providers/ibmq/exceptions.py | delapuente/qiskit-ibmq-provider | 03322e8df52217ddb91c96f437dbeecebc4564ee | [
"Apache-2.0"
] | null | null | null | qiskit/providers/ibmq/exceptions.py | delapuente/qiskit-ibmq-provider | 03322e8df52217ddb91c96f437dbeecebc4564ee | [
"Apache-2.0"
] | null | null | null | qiskit/providers/ibmq/exceptions.py | delapuente/qiskit-ibmq-provider | 03322e8df52217ddb91c96f437dbeecebc4564ee | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2018, IBM.
#
# This source code is licensed under the Apache License, Version 2.0 found in
# the LICENSE.txt file in the root directory of this source tree.
"""Exception for the IBMQ module."""
from qiskit.exceptions import QiskitError
class IBMQError(QiskitError):
"""Base c... | 22 | 77 | 0.714076 |
from qiskit.exceptions import QiskitError
class IBMQError(QiskitError):
pass
class IBMQAccountError(IBMQError):
pass
class IBMQBackendError(IBMQError):
pass
class IBMQBackendValueError(IBMQError, ValueError):
pass
| true | true |
1c49ac44226dae72e7824740af6a64b46bbf9717 | 21,771 | py | Python | tests/test_ft_taxii.py | zul126/minemeld-core | 2eb9b9bfd7654aee57aabd5fb280d4e89a438daf | [
"Apache-2.0"
] | 147 | 2016-07-22T18:15:49.000Z | 2022-03-26T23:32:44.000Z | tests/test_ft_taxii.py | zul126/minemeld-core | 2eb9b9bfd7654aee57aabd5fb280d4e89a438daf | [
"Apache-2.0"
] | 167 | 2016-07-27T07:02:25.000Z | 2021-12-16T16:26:52.000Z | tests/test_ft_taxii.py | zul126/minemeld-core | 2eb9b9bfd7654aee57aabd5fb280d4e89a438daf | [
"Apache-2.0"
] | 112 | 2016-07-22T07:14:29.000Z | 2022-03-24T18:43:12.000Z | # -*- coding: utf-8 -*-
# Copyright 2016 Palo Alto Networks, 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 ... | 32.253333 | 138 | 0.558495 |
import gevent.monkey
gevent.monkey.patch_all(thread=False, select=False)
import unittest
import mock
import redis
import gevent
import greenlet
import time
import xmltodict
import os
import libtaxii.constants
import re
import lz4
import json
import minemeld.ft.taxii
import minemeld.ft
FTNAME = 'tes... | true | true |
1c49acb962d8f0d4657693061d94007f4a560623 | 1,487 | py | Python | tests/writers/test_boto3_stubs_package.py | greut/mypy_boto3_builder | e3d7fb4bbfbef72f173414bc6f7f9ed992c58333 | [
"MIT"
] | null | null | null | tests/writers/test_boto3_stubs_package.py | greut/mypy_boto3_builder | e3d7fb4bbfbef72f173414bc6f7f9ed992c58333 | [
"MIT"
] | null | null | null | tests/writers/test_boto3_stubs_package.py | greut/mypy_boto3_builder | e3d7fb4bbfbef72f173414bc6f7f9ed992c58333 | [
"MIT"
] | null | null | null | import tempfile
from pathlib import Path
from unittest.mock import MagicMock, patch
from mypy_boto3_builder.writers.boto3_stubs_package import write_boto3_stubs_package
class TestBoto3StubsPackage:
@patch("mypy_boto3_builder.writers.boto3_stubs_package.sort_imports")
@patch("mypy_boto3_builder.writers.boto3_... | 40.189189 | 84 | 0.705447 | import tempfile
from pathlib import Path
from unittest.mock import MagicMock, patch
from mypy_boto3_builder.writers.boto3_stubs_package import write_boto3_stubs_package
class TestBoto3StubsPackage:
@patch("mypy_boto3_builder.writers.boto3_stubs_package.sort_imports")
@patch("mypy_boto3_builder.writers.boto3_... | true | true |
1c49acdbc39a4f246a5459a9ce974252a307a5f5 | 3,326 | py | Python | spec2nii/nifti_orientation.py | NeutralKaon/spec2nii | 52f0dc42ad176fdbb173ac051803372909e9971c | [
"BSD-3-Clause"
] | 5 | 2020-06-24T08:25:51.000Z | 2021-06-30T16:49:37.000Z | spec2nii/nifti_orientation.py | NeutralKaon/spec2nii | 52f0dc42ad176fdbb173ac051803372909e9971c | [
"BSD-3-Clause"
] | 15 | 2021-11-15T14:57:24.000Z | 2022-03-25T10:07:47.000Z | spec2nii/nifti_orientation.py | NeutralKaon/spec2nii | 52f0dc42ad176fdbb173ac051803372909e9971c | [
"BSD-3-Clause"
] | 4 | 2020-06-30T16:16:31.000Z | 2021-08-05T19:13:11.000Z | import numpy as np
from scipy.spatial.transform import Rotation
class NIFTIOrient:
def __init__(self, affine):
self.Q44 = affine
qb, qc, qd, qx, qy, qz, dx, dy, dz, qfac = nifti_mat44_to_quatern(affine)
self.qb = qb
self.qc = qc
self.qd = qd
self.qx = qx
sel... | 23.422535 | 81 | 0.435057 | import numpy as np
from scipy.spatial.transform import Rotation
class NIFTIOrient:
def __init__(self, affine):
self.Q44 = affine
qb, qc, qd, qx, qy, qz, dx, dy, dz, qfac = nifti_mat44_to_quatern(affine)
self.qb = qb
self.qc = qc
self.qd = qd
self.qx = qx
sel... | true | true |
1c49ad6c5eb75f92292108b9fb7833bf2d72a793 | 4,623 | py | Python | tensornetwork/backends/backend_test.py | DavidBraun777/TensorNetwork | 55942a12a859a8c6f8be473e623dbf0ddfd790b5 | [
"Apache-2.0"
] | null | null | null | tensornetwork/backends/backend_test.py | DavidBraun777/TensorNetwork | 55942a12a859a8c6f8be473e623dbf0ddfd790b5 | [
"Apache-2.0"
] | null | null | null | tensornetwork/backends/backend_test.py | DavidBraun777/TensorNetwork | 55942a12a859a8c6f8be473e623dbf0ddfd790b5 | [
"Apache-2.0"
] | null | null | null | """Tests for graphmode_tensornetwork."""
import builtins
import sys
import pytest
import numpy as np
def clean_tensornetwork_modules():
for mod in list(sys.modules.keys()):
if mod.startswith('tensornetwork'):
sys.modules.pop(mod, None)
@pytest.fixture(autouse=True)
def clean_backend_import():
#never d... | 32.787234 | 77 | 0.776119 | import builtins
import sys
import pytest
import numpy as np
def clean_tensornetwork_modules():
for mod in list(sys.modules.keys()):
if mod.startswith('tensornetwork'):
sys.modules.pop(mod, None)
@pytest.fixture(autouse=True)
def clean_backend_import():
clean_tensornetwork_modules()
yield
clea... | true | true |
1c49ae8cef2d2a65f702a89e8a58574f58e7c5fc | 11,824 | py | Python | tests/test.py | tubaman/pyfacebook | 6fac843c6c52ed916482c9995b4eaa89631aab3a | [
"FSFAP"
] | 1 | 2020-05-19T05:38:35.000Z | 2020-05-19T05:38:35.000Z | tests/test.py | douglaswth/pyfacebook | 4a1427808ba41e33698c0e018d2ed44e7993b1c9 | [
"FSFAP"
] | null | null | null | tests/test.py | douglaswth/pyfacebook | 4a1427808ba41e33698c0e018d2ed44e7993b1c9 | [
"FSFAP"
] | null | null | null | import unittest
import sys
import os
import facebook
import urllib2
try:
from hashlib import md5
md5_constructor = md5
except ImportError:
import md5
md5_constructor = md5.new
try:
import simplejson
except ImportError:
from django.utils import simplejson
import httplib
from minim... | 43.470588 | 142 | 0.505751 | import unittest
import sys
import os
import facebook
import urllib2
try:
from hashlib import md5
md5_constructor = md5
except ImportError:
import md5
md5_constructor = md5.new
try:
import simplejson
except ImportError:
from django.utils import simplejson
import httplib
from minim... | true | true |
1c49aea1b2fec5e7a7e723bbfc78bae2a63ad735 | 3,912 | py | Python | atom/nucleus/python/nucleus_api/models/decision_tree_result_vo.py | sumit4-ttn/SDK | b3ae385e5415e47ac70abd0b3fdeeaeee9aa7cff | [
"Apache-2.0"
] | null | null | null | atom/nucleus/python/nucleus_api/models/decision_tree_result_vo.py | sumit4-ttn/SDK | b3ae385e5415e47ac70abd0b3fdeeaeee9aa7cff | [
"Apache-2.0"
] | null | null | null | atom/nucleus/python/nucleus_api/models/decision_tree_result_vo.py | sumit4-ttn/SDK | b3ae385e5415e47ac70abd0b3fdeeaeee9aa7cff | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Hydrogen Atom API
The Hydrogen Atom API # noqa: E501
OpenAPI spec version: 1.7.0
Contact: info@hydrogenplatform.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class DecisionTreeResultVO(object):
... | 27.549296 | 87 | 0.57771 |
import pprint
import re
import six
class DecisionTreeResultVO(object):
swagger_types = {
'entity_id': 'list[str]',
'entity_type': 'str'
}
attribute_map = {
'entity_id': 'entity_id',
'entity_type': 'entity_type'
}
def __init__(self, entity_id=None, entity_t... | true | true |
1c49af06fb182620ad77a0022f91480b1c789ab3 | 909 | py | Python | posts/migrations/0001_initial.py | CodeEnvironment/django-rest-framework-deploy-heroku | c6ffb20961c193b0f4dc1289de904b5d6750f335 | [
"MIT"
] | 3 | 2021-04-05T14:02:44.000Z | 2022-01-25T07:50:20.000Z | posts/migrations/0001_initial.py | CodeEnvironment/django-rest-framework-deploy-aws | d9cf1d016e22b9b5697c769bd094776d25a3f90b | [
"MIT"
] | null | null | null | posts/migrations/0001_initial.py | CodeEnvironment/django-rest-framework-deploy-aws | d9cf1d016e22b9b5697c769bd094776d25a3f90b | [
"MIT"
] | 1 | 2022-01-23T15:09:59.000Z | 2022-01-23T15:09:59.000Z | # Generated by Django 2.2.5 on 2020-08-16 10:43
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Posts',
fields=[
('id', models.AutoField(au... | 29.322581 | 114 | 0.561056 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Posts',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=Fa... | true | true |
1c49af27f673eeb7de969da70743dbbc5e30b487 | 154 | py | Python | Python/euclidian.py | AbdulConsole/Hacktoberfest2019-2 | b9619361b6cecf9b3e734972af3b0a03dba98d2e | [
"MIT"
] | 1 | 2019-10-28T20:12:23.000Z | 2019-10-28T20:12:23.000Z | Python/euclidian.py | AbdulConsole/Hacktoberfest2019-2 | b9619361b6cecf9b3e734972af3b0a03dba98d2e | [
"MIT"
] | null | null | null | Python/euclidian.py | AbdulConsole/Hacktoberfest2019-2 | b9619361b6cecf9b3e734972af3b0a03dba98d2e | [
"MIT"
] | 1 | 2020-10-16T14:10:12.000Z | 2020-10-16T14:10:12.000Z | from math import sqrt
# define euclidian distance
def euclidienne(x,y):
return sqrt((x[0]-y[0])**2+(x[1]-y[1])**2)
print(euclidienne((1,3),(2,2)))
| 17.111111 | 46 | 0.62987 | from math import sqrt
def euclidienne(x,y):
return sqrt((x[0]-y[0])**2+(x[1]-y[1])**2)
print(euclidienne((1,3),(2,2)))
| true | true |
1c49afe5fad9b3edfdb62cbe3f1abd9199670eec | 15,586 | py | Python | pscript/parser3.py | JesusZerpa/pscript | 5ac86c1b5983b47f3f0554e0801893d284f84b2d | [
"BSD-2-Clause"
] | 190 | 2018-02-26T00:19:37.000Z | 2022-03-29T13:35:33.000Z | pscript/parser3.py | JesusZerpa/pscript | 5ac86c1b5983b47f3f0554e0801893d284f84b2d | [
"BSD-2-Clause"
] | 53 | 2018-03-21T22:39:46.000Z | 2022-01-15T05:22:05.000Z | pscript/parser3.py | JesusZerpa/pscript | 5ac86c1b5983b47f3f0554e0801893d284f84b2d | [
"BSD-2-Clause"
] | 21 | 2018-04-16T21:13:00.000Z | 2022-02-27T23:28:14.000Z | """
Python Builtins
---------------
Most builtin functions (that make sense in JS) are automatically
translated to JavaScript: isinstance, issubclass, callable, hasattr,
getattr, setattr, delattr, print, len, max, min, chr, ord, dict, list,
tuple, range, pow, sum, round, int, float, str, bool, abs, divmod, all,
any, ... | 33.663067 | 86 | 0.568074 |
from . import commonast as ast
from . import stdlib
from .parser2 import Parser2, JSError, unify
from .stubs import RawJS
class Parser3(Parser2):
def function_this_is_js(self, node):
if len(node.arg_nodes) != 0:
raise JSError('this_is_js() expects... | true | true |
1c49b1235f8371ebf0a2bfea75889cf5b89b0310 | 977 | py | Python | fhir_post_from_directory.py | NimbusInformatics/bdcat-fhir-azure-prototype | c35184d037423c7bf4e7ccb7c9d2a91a1fc161ca | [
"Apache-2.0"
] | null | null | null | fhir_post_from_directory.py | NimbusInformatics/bdcat-fhir-azure-prototype | c35184d037423c7bf4e7ccb7c9d2a91a1fc161ca | [
"Apache-2.0"
] | null | null | null | fhir_post_from_directory.py | NimbusInformatics/bdcat-fhir-azure-prototype | c35184d037423c7bf4e7ccb7c9d2a91a1fc161ca | [
"Apache-2.0"
] | 1 | 2020-10-17T20:19:57.000Z | 2020-10-17T20:19:57.000Z | # Given a FHIR server, an auth token, and directory, this script finds the
# the .json files in the directory, and posts them to the FHIR server
import requests
import sys
import json
import urllib3
from pathlib import Path
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
fhir_server_uri = sy... | 31.516129 | 115 | 0.741044 |
import requests
import sys
import json
import urllib3
from pathlib import Path
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
fhir_server_uri = sys.argv[1]
token = sys.argv[2]
directory_path = sys.argv[3]
headers = {'Authorization' : "Bearer " + token, 'Accept' : 'application/json', 'Cont... | true | true |
1c49b15084ebbefe896922b679e5df502b62eff9 | 889 | py | Python | tests/bugs/core_1489_test.py | reevespaul/firebird-qa | 98f16f425aa9ab8ee63b86172f959d63a2d76f21 | [
"MIT"
] | null | null | null | tests/bugs/core_1489_test.py | reevespaul/firebird-qa | 98f16f425aa9ab8ee63b86172f959d63a2d76f21 | [
"MIT"
] | null | null | null | tests/bugs/core_1489_test.py | reevespaul/firebird-qa | 98f16f425aa9ab8ee63b86172f959d63a2d76f21 | [
"MIT"
] | null | null | null | #coding:utf-8
#
# id: bugs.core_1489
# title: DATEADD wrong work with NULL arguments
# decription:
# tracker_id: CORE-1489
# min_versions: []
# versions: 2.1.0
# qmid: bugs.core_1489
import pytest
from firebird.qa import db_factory, isql_act, Action
# version: 2.1.0
# resources: None... | 21.682927 | 97 | 0.656918 |
import pytest
from firebird.qa import db_factory, isql_act, Action
substitutions_1 = []
init_script_1 = """"""
db_1 = db_factory(sql_dialect=3, init=init_script_1)
test_script_1 = """SELECT 1, DATEADD(SECOND, Null, CAST('01.01.2007' AS DATE)) FROM RDB$DATABASE;
"""
act_1 = isql_act('db_1', test_script... | true | true |
1c49b49b5655f4bd51f7a622c855b147b4dbaa5f | 6,632 | py | Python | phypartspiecharts/phypartspiecharts.py | joelnitta/phyloscripts | ef308fc45e8aae904bf8e235ec0a9809b588a6ea | [
"MIT"
] | null | null | null | phypartspiecharts/phypartspiecharts.py | joelnitta/phyloscripts | ef308fc45e8aae904bf8e235ec0a9809b588a6ea | [
"MIT"
] | null | null | null | phypartspiecharts/phypartspiecharts.py | joelnitta/phyloscripts | ef308fc45e8aae904bf8e235ec0a9809b588a6ea | [
"MIT"
] | 2 | 2020-06-08T18:11:32.000Z | 2021-04-05T13:43:14.000Z | #!/usr/bin/env python
helptext= '''
Generate the "Pie Chart" representation of gene tree conflict from Smith et al. 2015 from
the output of phyparts, the bipartition summary software described in the same paper.
The input files include three files produced by PhyParts, and a file containing a species
tree in Newick f... | 35.465241 | 202 | 0.740199 |
helptext= '''
Generate the "Pie Chart" representation of gene tree conflict from Smith et al. 2015 from
the output of phyparts, the bipartition summary software described in the same paper.
The input files include three files produced by PhyParts, and a file containing a species
tree in Newick format (likely, the tr... | true | true |
1c49b4d84b1d5b5b155c9774146d459ed14b8043 | 408 | py | Python | examples/use_cases/case4_show_commands/send_command.py | johnbarneta/netmiko | 331187987526f0f784bdf28c85c5256c480d955e | [
"MIT"
] | 2 | 2019-07-23T02:27:19.000Z | 2019-07-23T02:27:25.000Z | examples/use_cases/case4_show_commands/send_command.py | johnbarneta/netmiko | 331187987526f0f784bdf28c85c5256c480d955e | [
"MIT"
] | 4 | 2020-03-21T22:58:35.000Z | 2020-03-25T12:11:26.000Z | examples/use_cases/case4_show_commands/send_command.py | johnbarneta/netmiko | 331187987526f0f784bdf28c85c5256c480d955e | [
"MIT"
] | 1 | 2019-10-16T19:02:32.000Z | 2019-10-16T19:02:32.000Z | #!/usr/bin/env python
from netmiko import Netmiko
from getpass import getpass
cisco1 = {
"host": "cisco1.twb-tech.com",
"username": "pyclass",
"password": getpass(),
"device_type": "cisco_ios",
}
net_connect = Netmiko(**cisco1)
command = "show ip int brief"
print()
print(net_connect.find_prompt())
ou... | 19.428571 | 42 | 0.708333 |
from netmiko import Netmiko
from getpass import getpass
cisco1 = {
"host": "cisco1.twb-tech.com",
"username": "pyclass",
"password": getpass(),
"device_type": "cisco_ios",
}
net_connect = Netmiko(**cisco1)
command = "show ip int brief"
print()
print(net_connect.find_prompt())
output = net_connect.se... | true | true |
1c49b4ed9d05d014fcba032d54090b1151a01932 | 2,265 | py | Python | physics3d/character_controller.py | B3CTOR/runner-ursina-engine | 59ce82d1107420f17e3129cbe00ddbbd7047f68b | [
"MIT"
] | null | null | null | physics3d/character_controller.py | B3CTOR/runner-ursina-engine | 59ce82d1107420f17e3129cbe00ddbbd7047f68b | [
"MIT"
] | null | null | null | physics3d/character_controller.py | B3CTOR/runner-ursina-engine | 59ce82d1107420f17e3129cbe00ddbbd7047f68b | [
"MIT"
] | null | null | null | from ursina import Entity, Vec3, application
from panda3d.bullet import BulletWorld, BulletCapsuleShape, BulletCharacterControllerNode
class CharacterController(BulletCharacterControllerNode):
def __init__(self, world:BulletWorld, entity:Entity, radius=1, height=2, name='Player', **opts) -> None:
super()._... | 27.621951 | 108 | 0.628256 | from ursina import Entity, Vec3, application
from panda3d.bullet import BulletWorld, BulletCapsuleShape, BulletCharacterControllerNode
class CharacterController(BulletCharacterControllerNode):
def __init__(self, world:BulletWorld, entity:Entity, radius=1, height=2, name='Player', **opts) -> None:
super()._... | true | true |
1c49b5f49bd919e8e9e35d1e105629de687aa9d2 | 2,770 | py | Python | nasa/nasa_response_handler.py | mariosyb/pub_twitter_apod_bot | a0da8ae049cee5cb7df2d702e750615e332a9668 | [
"Apache-2.0"
] | null | null | null | nasa/nasa_response_handler.py | mariosyb/pub_twitter_apod_bot | a0da8ae049cee5cb7df2d702e750615e332a9668 | [
"Apache-2.0"
] | null | null | null | nasa/nasa_response_handler.py | mariosyb/pub_twitter_apod_bot | a0da8ae049cee5cb7df2d702e750615e332a9668 | [
"Apache-2.0"
] | null | null | null | import enum
from datetime import date, timedelta
COPYRIGHT_PARAMETER = 'copyright' # this will be in response if the image is not public domain
TITLE_PARAMETER = 'title'
EXPLANATION_PARAMETER = 'explanation'
MEDIA_TYPE_PARAMETER = 'media_type'
HD_URL_PARAMETER = 'hdurl'
DATE_FORMAT = '%Y-%m-%d'
class NasaMediaType(... | 23.87931 | 95 | 0.685199 | import enum
from datetime import date, timedelta
COPYRIGHT_PARAMETER = 'copyright'
TITLE_PARAMETER = 'title'
EXPLANATION_PARAMETER = 'explanation'
MEDIA_TYPE_PARAMETER = 'media_type'
HD_URL_PARAMETER = 'hdurl'
DATE_FORMAT = '%Y-%m-%d'
class NasaMediaType(enum.Enum):
image = 'IMAGE'
video = 'VIDEO'
def ge... | true | true |
1c49b6165bb06b0ed8202ea757ce392b9cc7274e | 896 | py | Python | tests/bcbio/test_bcbio.py | parlundin/scilifelab | e5f4be45e2e9ff6c0756be46ad34dfb7d20a4b4a | [
"MIT"
] | 1 | 2016-03-21T14:04:09.000Z | 2016-03-21T14:04:09.000Z | tests/bcbio/test_bcbio.py | parlundin/scilifelab | e5f4be45e2e9ff6c0756be46ad34dfb7d20a4b4a | [
"MIT"
] | 35 | 2015-01-22T08:25:02.000Z | 2020-02-17T12:09:12.000Z | tests/bcbio/test_bcbio.py | parlundin/scilifelab | e5f4be45e2e9ff6c0756be46ad34dfb7d20a4b4a | [
"MIT"
] | 6 | 2015-01-16T15:32:08.000Z | 2020-01-30T14:34:40.000Z | import os
import tempfile
import shutil
import unittest
from ..data import data_files
from scilifelab.bcbio.qc import RunInfoParser
filedir = os.path.abspath(os.path.realpath(os.path.dirname(__file__)))
RunInfo = data_files["RunInfo.xml"]
class TestBcbioQC(unittest.TestCase):
"""Test for bcbio qc module"""
d... | 28.903226 | 70 | 0.670759 | import os
import tempfile
import shutil
import unittest
from ..data import data_files
from scilifelab.bcbio.qc import RunInfoParser
filedir = os.path.abspath(os.path.realpath(os.path.dirname(__file__)))
RunInfo = data_files["RunInfo.xml"]
class TestBcbioQC(unittest.TestCase):
def setUp(self):
self.rootdi... | true | true |
1c49b706b8a5d60732fbf10c9acffef8503ea28d | 7,072 | py | Python | examples/simple_dqn.py | ofantomas/rlax | 7bf3bf13d4496f1b708f4ccb5865215a16c618d6 | [
"Apache-2.0"
] | null | null | null | examples/simple_dqn.py | ofantomas/rlax | 7bf3bf13d4496f1b708f4ccb5865215a16c618d6 | [
"Apache-2.0"
] | null | null | null | examples/simple_dqn.py | ofantomas/rlax | 7bf3bf13d4496f1b708f4ccb5865215a16c618d6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 DeepMind Technologies Limited. 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 ... | 38.021505 | 80 | 0.724689 |
import collections
import random
from absl import app
from absl import flags
from bsuite.environments import catch
import haiku as hk
from haiku import nets
import jax
import jax.numpy as jnp
import numpy as np
import optax
import rlax
import experiment
Params = collections.namedtuple("Params", "online ... | true | true |
1c49b765839e7dc8a74136e35d3e6f215885011c | 8,060 | py | Python | docs/conf.py | jonnyguio/tsuru | 30a8d657fbb05e5b64fe8c7babc67f1e618842bf | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | jonnyguio/tsuru | 30a8d657fbb05e5b64fe8c7babc67f1e618842bf | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | jonnyguio/tsuru | 30a8d657fbb05e5b64fe8c7babc67f1e618842bf | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# tsuru documentation build configuration file, created by
# sphinx-quickstart on Wed Aug 8 11:09:54 2012.
#
# 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 c... | 30.881226 | 80 | 0.711911 |
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
extensions = [
'sphinx.ext.mathjax',
'tsuru_sphinx.handlers',
]
source_suffix = '.rst'
master_doc = 'index'
project = u'tsuru'
copyright = u'2017, tsuru authors'
# |version| and |release|, also used in various oth... | true | true |
1c49b884e3cdaad9254dce2a1831a4b6797541bf | 41 | py | Python | tests/__init__.py | robert2398/docs_parser | 8ddb8820ebeb0a5b8da11e81fe7fbfceab71e413 | [
"MIT"
] | null | null | null | tests/__init__.py | robert2398/docs_parser | 8ddb8820ebeb0a5b8da11e81fe7fbfceab71e413 | [
"MIT"
] | null | null | null | tests/__init__.py | robert2398/docs_parser | 8ddb8820ebeb0a5b8da11e81fe7fbfceab71e413 | [
"MIT"
] | null | null | null | """Unit test package for docs_parser."""
| 20.5 | 40 | 0.707317 | true | true | |
1c49b978a6af8f17af06e34921de32180b66587b | 467 | py | Python | worlds/migrations/0051_pipeline_logging.py | cognitive-space/warpzone | 06acee2add83cf9ddf981b4e4187dd742e627561 | [
"MIT"
] | 1 | 2022-02-25T12:04:13.000Z | 2022-02-25T12:04:13.000Z | worlds/migrations/0051_pipeline_logging.py | cognitive-space/warpzone | 06acee2add83cf9ddf981b4e4187dd742e627561 | [
"MIT"
] | null | null | null | worlds/migrations/0051_pipeline_logging.py | cognitive-space/warpzone | 06acee2add83cf9ddf981b4e4187dd742e627561 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.10 on 2022-01-17 16:08
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('worlds', '0050_alter_completedlog_pod'),
]
operations = [
migrations.AddField(
model_name='pipeline',
name='logging... | 24.578947 | 126 | 0.605996 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('worlds', '0050_alter_completedlog_pod'),
]
operations = [
migrations.AddField(
model_name='pipeline',
name='logging',
field=models.CharField(choices=[(... | true | true |
1c49b9af782f450f47a2cc9226a2b3a154659404 | 9,972 | py | Python | sigal.conf.py | flamableconcrete/DnD-Watercolor-Gallery | 6e8984ba56d2516ee0e17cbfb415fb2198d608cd | [
"MIT"
] | 7 | 2020-10-02T02:47:00.000Z | 2022-03-06T13:00:48.000Z | sigal.conf.py | flamableconcrete/DnD-Watercolor-Gallery | 6e8984ba56d2516ee0e17cbfb415fb2198d608cd | [
"MIT"
] | 1 | 2021-11-28T22:06:20.000Z | 2021-11-28T22:06:20.000Z | sigal.conf.py | flamableconcrete/DnD-Watercolor-Gallery | 6e8984ba56d2516ee0e17cbfb415fb2198d608cd | [
"MIT"
] | 1 | 2020-10-02T02:47:04.000Z | 2020-10-02T02:47:04.000Z | # All configuration values have a default; values that are commented out serve
# to show the default. Default values are specified when modified in this
# example config file
# Gallery title. Can be set here or as the '--title' option of the `sigal
# build` command, or in the 'index.md' file of the source directory.
#... | 33.019868 | 119 | 0.695347 |
source = "albums"
theme = "my-sigal-theme"
use_orig = True
img_size = (1076, 816)
essor = 'ResizeToFit'
# Autorotate images
# Warning: this setting is not compatible with `copy_exif_data` (see below),
# because Sigal can't save the modified Orientation tag (currently Pillo... | true | true |
1c49b9b3ba4bd5a9767f7b527ecc21f6732caf9f | 687 | py | Python | Content/Data Structures/Matrix.py | MovsisyanM/Data-Structures-And-Algos-Revisit | 3bb128a4a5476914c164b1a3c1b533a8eace8604 | [
"MIT"
] | 3 | 2020-12-24T16:49:14.000Z | 2021-08-10T17:19:16.000Z | Content/Data Structures/Matrix.py | MovsisyanM/Data-Structures-And-Algos-Revisit | 3bb128a4a5476914c164b1a3c1b533a8eace8604 | [
"MIT"
] | null | null | null | Content/Data Structures/Matrix.py | MovsisyanM/Data-Structures-And-Algos-Revisit | 3bb128a4a5476914c164b1a3c1b533a8eace8604 | [
"MIT"
] | 1 | 2020-12-25T15:37:36.000Z | 2020-12-25T15:37:36.000Z | class Matrix:
"""No, not the movie.
A 2d array with many methods to make it act like a matrix"""
def __init__(self, size, fill_with=0):
assert (size >= 1), "Matrix size too small, must be positive integer"
this.size = math.floor(size)
this.mem = [[fill_with] * this.size] * this.size... | 25.444444 | 97 | 0.640466 | class Matrix:
def __init__(self, size, fill_with=0):
assert (size >= 1), "Matrix size too small, must be positive integer"
this.size = math.floor(size)
this.mem = [[fill_with] * this.size] * this.size
def __getitem__(self, key):
return copy.copy(this.mem[key])
def __m... | true | true |
1c49ba3af2eaa48f8e0bb0d3f22a566b9e7df7f7 | 1,212 | py | Python | tests/test_roi.py | EXLER/CILISSA | 452b9233d0d4a5139b9ab022b9178d9cde832359 | [
"MIT"
] | null | null | null | tests/test_roi.py | EXLER/CILISSA | 452b9233d0d4a5139b9ab022b9178d9cde832359 | [
"MIT"
] | 1 | 2021-10-15T19:55:56.000Z | 2021-10-15T19:55:56.000Z | tests/test_roi.py | EXLER/CILISSA | 452b9233d0d4a5139b9ab022b9178d9cde832359 | [
"MIT"
] | null | null | null | from pathlib import Path
from cilissa.images import Image, ImagePair
from cilissa.metrics import MSE
from cilissa.roi import ROI
from cilissa.transformations import Equalization
from tests.base import BaseTest
class TestROI(BaseTest):
@classmethod
def setUpClass(cls) -> None:
super().setUpClass()
... | 32.756757 | 86 | 0.70462 | from pathlib import Path
from cilissa.images import Image, ImagePair
from cilissa.metrics import MSE
from cilissa.roi import ROI
from cilissa.transformations import Equalization
from tests.base import BaseTest
class TestROI(BaseTest):
@classmethod
def setUpClass(cls) -> None:
super().setUpClass()
... | true | true |
1c49bbbc3c51bc3b92d9cf824afce38dc820b85b | 16,100 | py | Python | tests/handlers/test_e2e_room_keys.py | cleveritcz/synapse | caead3e45968a9f753da7bc11ee588ab4efda858 | [
"Apache-2.0"
] | 1 | 2019-05-01T11:05:51.000Z | 2019-05-01T11:05:51.000Z | tests/handlers/test_e2e_room_keys.py | cleveritcz/synapse | caead3e45968a9f753da7bc11ee588ab4efda858 | [
"Apache-2.0"
] | null | null | null | tests/handlers/test_e2e_room_keys.py | cleveritcz/synapse | caead3e45968a9f753da7bc11ee588ab4efda858 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2016 OpenMarket Ltd
# Copyright 2017 New Vector Ltd
#
# 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
#
# ... | 34.623656 | 89 | 0.605093 |
import copy
import mock
from twisted.internet import defer
import synapse.api.errors
import synapse.handlers.e2e_room_keys
import synapse.storage
from synapse.api import errors
from tests import unittest, utils
room_keys = {
"rooms": {
"!abc:matrix.org": {
"sessions": {
... | true | true |
1c49bbdc54235d9fd6a0bca037e561e4f50df361 | 18,581 | py | Python | store/models.py | olaoluwa-98/tetris | 2daf4f7dc24c655cadc71394aea2aa68879bf6ea | [
"MIT"
] | null | null | null | store/models.py | olaoluwa-98/tetris | 2daf4f7dc24c655cadc71394aea2aa68879bf6ea | [
"MIT"
] | null | null | null | store/models.py | olaoluwa-98/tetris | 2daf4f7dc24c655cadc71394aea2aa68879bf6ea | [
"MIT"
] | null | null | null | from django.conf import settings
from django.db import models
from django.contrib.auth.models import AbstractUser, UserManager
from django.contrib.auth import get_user_model
from django.utils.crypto import get_random_string
from .addresses import STATES
from autoslug import AutoSlugField
from django.urls import reverse... | 36.220273 | 130 | 0.645875 | from django.conf import settings
from django.db import models
from django.contrib.auth.models import AbstractUser, UserManager
from django.contrib.auth import get_user_model
from django.utils.crypto import get_random_string
from .addresses import STATES
from autoslug import AutoSlugField
from django.urls import reverse... | true | true |
1c49bcf86193b8dd320433d8f581a02d71c51fc7 | 927 | py | Python | PyPoll/main.py | amitpatel02-atl/Python-Challenge | e864b87b40c64fa7f5b6a3ad98da2f31c8028790 | [
"ADSL"
] | null | null | null | PyPoll/main.py | amitpatel02-atl/Python-Challenge | e864b87b40c64fa7f5b6a3ad98da2f31c8028790 | [
"ADSL"
] | null | null | null | PyPoll/main.py | amitpatel02-atl/Python-Challenge | e864b87b40c64fa7f5b6a3ad98da2f31c8028790 | [
"ADSL"
] | null | null | null | # First we'll import the os module
# This will allow us to create file paths across operating systems
import os
# Module for reading CSV files
import csv
# Set path for file
csvpath = os.path.join("election_data.csv")
#Open the csv
with open(csvpath) as csvfile:
csvreader = csv.reader(csvfile, delimiter=",")
... | 24.394737 | 70 | 0.674218 |
# This will allow us to create file paths across operating systems
import os
# Module for reading CSV files
import csv
# Set path for file
csvpath = os.path.join("election_data.csv")
#Open the csv
with open(csvpath) as csvfile:
csvreader = csv.reader(csvfile, delimiter=",")
#Read the header row first (skip... | true | true |
1c49bd27ad29632093673b01d9d464f573e77386 | 5,118 | py | Python | discord/ui/modal.py | DeadPool3333/enhanced-discord.py | be34c7e521c9edbe6d8ff949962c0ab777821712 | [
"MIT"
] | 4 | 2021-09-28T12:45:00.000Z | 2022-02-04T20:11:58.000Z | discord/ui/modal.py | DeadPool3333/enhanced-discord.py | be34c7e521c9edbe6d8ff949962c0ab777821712 | [
"MIT"
] | 2 | 2021-11-07T12:31:33.000Z | 2022-01-06T17:06:51.000Z | discord/ui/modal.py | DeadPool3333/enhanced-discord.py | be34c7e521c9edbe6d8ff949962c0ab777821712 | [
"MIT"
] | 8 | 2022-01-10T22:26:03.000Z | 2022-02-25T14:26:04.000Z | from __future__ import annotations
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple
import os
import asyncio
import sys
import traceback
from .item import Item
from itertools import groupby
from .view import _ViewWeights as _ModalWeights
from ..interactions import Interaction
if TYPE_CHECKING:
... | 29.413793 | 112 | 0.603751 | from __future__ import annotations
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple
import os
import asyncio
import sys
import traceback
from .item import Item
from itertools import groupby
from .view import _ViewWeights as _ModalWeights
from ..interactions import Interaction
if TYPE_CHECKING:
... | true | true |
1c49bde9cb2690f493422ebf0eb42afb5f96147d | 654 | py | Python | src/directional_clustering/clustering/kmeans/__init__.py | arpastrana/directional_clustering | 78fd39fe4ad207b2a639deddf4ba12d5580df5c6 | [
"MIT"
] | 6 | 2020-08-04T15:24:22.000Z | 2022-02-02T21:34:33.000Z | src/directional_clustering/clustering/kmeans/__init__.py | arpastrana/directional_clustering | 78fd39fe4ad207b2a639deddf4ba12d5580df5c6 | [
"MIT"
] | 3 | 2020-10-30T02:33:08.000Z | 2020-11-04T19:45:08.000Z | src/directional_clustering/clustering/kmeans/__init__.py | arpastrana/directional_clustering | 78fd39fe4ad207b2a639deddf4ba12d5580df5c6 | [
"MIT"
] | null | null | null | """
directional_clustering.clustering.kmeans
****************************
.. currentmodule:: directional_clustering.clustering.kmeans
Classes
=======
.. autosummary::
:toctree: generated/
:nosignatures:
Functions
=========
.. autosummary::
:toctree: generated/
:nosignatures:
"""
from __future__... | 16.769231 | 62 | 0.689602 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from .operations import *
from .distances import *
from ._kmeans import *
from .cosine import *
from .variational import *
from .euclidean import *
__all__ = [name for name in dir() if not name.startswith('... | true | true |
1c49be5ca86913a07ac3f5f1c7e0e1e3d9ac11be | 408 | py | Python | integration_tests/mass_simulator_ITG_test.py | hoondental/smtm | f7648da652c5437ee27efef6fbf2480045130c16 | [
"MIT"
] | 16 | 2020-02-21T08:18:04.000Z | 2022-03-29T06:34:29.000Z | integration_tests/mass_simulator_ITG_test.py | hoondental/smtm | f7648da652c5437ee27efef6fbf2480045130c16 | [
"MIT"
] | 31 | 2019-11-11T13:06:47.000Z | 2022-02-26T12:14:41.000Z | integration_tests/mass_simulator_ITG_test.py | msaltnet/smtm | b2b480a59204e7d730d60ec037b00660d9dd235d | [
"MIT"
] | 12 | 2020-07-03T06:44:22.000Z | 2022-03-30T03:03:05.000Z | import time
import unittest
from smtm import MassSimulator
from unittest.mock import *
class MassSimulatorIntegrationTests(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
@patch("builtins.print")
def test_ITG_run_single_simulation(self, mock_print):
mass = ... | 21.473684 | 70 | 0.720588 | import time
import unittest
from smtm import MassSimulator
from unittest.mock import *
class MassSimulatorIntegrationTests(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
@patch("builtins.print")
def test_ITG_run_single_simulation(self, mock_print):
mass = ... | true | true |
1c49bf29b541c47c8d66c29b20e2bf30bc1b27d6 | 765 | py | Python | tests/journal.ext/info_example.py | PyreFramework/pyre | 345c7449a3416eea1c1affa74fb32faff30a6aaa | [
"BSD-3-Clause"
] | null | null | null | tests/journal.ext/info_example.py | PyreFramework/pyre | 345c7449a3416eea1c1affa74fb32faff30a6aaa | [
"BSD-3-Clause"
] | null | null | null | tests/journal.ext/info_example.py | PyreFramework/pyre | 345c7449a3416eea1c1affa74fb32faff30a6aaa | [
"BSD-3-Clause"
] | null | null | null | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
#
# michael a.g. aïvázis <michael.aivazis@para-sim.com>
# (c) 1998-2022 all rights reserved
def test():
"""
Exercise the info channel with a realistic example
"""
# get the trash can
from journal.ext.journal import Trash as trash
# and the channe... | 19.615385 | 57 | 0.627451 |
def test():
from journal.ext.journal import Trash as trash
from journal.ext.journal import Informational as info
channel = info(name="tests.journal.info")
channel.device = trash()
channel.notes["time"] = "now"
channel.line("info channel:")
channel.log("... | true | true |
1c49bfa2d1946ee3be217dd485422832d454b222 | 292 | py | Python | xicam/spectral/operations/clustering.py | Xi-CAM/Xi-cam.spectral | 62240c4992ba79a2f97db99ade988a4613566e98 | [
"BSD-3-Clause"
] | null | null | null | xicam/spectral/operations/clustering.py | Xi-CAM/Xi-cam.spectral | 62240c4992ba79a2f97db99ade988a4613566e98 | [
"BSD-3-Clause"
] | 10 | 2020-09-15T03:16:26.000Z | 2021-02-06T08:17:47.000Z | xicam/spectral/operations/clustering.py | Xi-CAM/Xi-cam.spectral | 62240c4992ba79a2f97db99ade988a4613566e98 | [
"BSD-3-Clause"
] | 1 | 2020-10-20T17:06:43.000Z | 2020-10-20T17:06:43.000Z | # k-means
## scikit-learn.cluster.kmeans
# hierarchical clustering analysis "EMSC" (Extended Multiplicative Scattering Correction)
## https://scikit-learn.org/stable/modules/clustering.html#hierarchical-clustering
## https://github.com/RPCausin/EMSC/blob/master/EMSC.py: (Bassan, Konevskikh)
| 48.666667 | 89 | 0.794521 | true | true | |
1c49c0b805416ccceb49291147df00302441da20 | 10,379 | py | Python | test/mitmproxy/test_optmanager.py | dotnes/mitmproxy | 5eb17bbf6d47c8d703763bfa41cf1ff3f98a632f | [
"MIT"
] | 1 | 2017-12-27T09:05:23.000Z | 2017-12-27T09:05:23.000Z | test/mitmproxy/test_optmanager.py | dotnes/mitmproxy | 5eb17bbf6d47c8d703763bfa41cf1ff3f98a632f | [
"MIT"
] | null | null | null | test/mitmproxy/test_optmanager.py | dotnes/mitmproxy | 5eb17bbf6d47c8d703763bfa41cf1ff3f98a632f | [
"MIT"
] | 2 | 2018-09-03T19:26:31.000Z | 2019-04-08T23:05:15.000Z | import copy
import pytest
import typing
import argparse
from mitmproxy import options
from mitmproxy import optmanager
from mitmproxy import exceptions
class TO(optmanager.OptManager):
def __init__(self):
super().__init__()
self.add_option("one", typing.Optional[int], None, "help")
self.a... | 24.137209 | 81 | 0.598902 | import copy
import pytest
import typing
import argparse
from mitmproxy import options
from mitmproxy import optmanager
from mitmproxy import exceptions
class TO(optmanager.OptManager):
def __init__(self):
super().__init__()
self.add_option("one", typing.Optional[int], None, "help")
self.a... | true | true |
1c49c25e5e36e3834b02920900d27d8725a5e1cf | 1,182 | py | Python | pets/forms/pets.py | IvanParvanovski/petstagram-repository | 03f1464d4f5919712446f812fad044056f9a15f6 | [
"MIT"
] | 2 | 2021-06-10T08:18:00.000Z | 2021-06-12T19:10:49.000Z | pets/forms/pets.py | IvanParvanovski/petstagram-repository | 03f1464d4f5919712446f812fad044056f9a15f6 | [
"MIT"
] | null | null | null | pets/forms/pets.py | IvanParvanovski/petstagram-repository | 03f1464d4f5919712446f812fad044056f9a15f6 | [
"MIT"
] | null | null | null | from django import forms
from pets.models.pet import Pet
class PetCreateForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
for (_, field) in self.fields.items():
field.widget.attrs['class'] = 'form-control'
class Meta:
model = P... | 25.148936 | 56 | 0.358714 | from django import forms
from pets.models.pet import Pet
class PetCreateForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
for (_, field) in self.fields.items():
field.widget.attrs['class'] = 'form-control'
class Meta:
model = P... | true | true |
1c49c279cce146a4c48b5adc7ff7367616606ace | 2,101 | py | Python | wagtail_commons/core/management/commands/bootstrap_users.py | bgrace/wagtail-commons | 37985629e3098842c08f6ae7072c2af8a69319f0 | [
"BSD-3-Clause"
] | 13 | 2015-03-13T06:44:47.000Z | 2021-08-01T02:36:36.000Z | wagtail_commons/core/management/commands/bootstrap_users.py | bgrace/wagtail-commons | 37985629e3098842c08f6ae7072c2af8a69319f0 | [
"BSD-3-Clause"
] | null | null | null | wagtail_commons/core/management/commands/bootstrap_users.py | bgrace/wagtail-commons | 37985629e3098842c08f6ae7072c2af8a69319f0 | [
"BSD-3-Clause"
] | 1 | 2016-02-07T20:54:40.000Z | 2016-02-07T20:54:40.000Z | from django.conf import settings
__author__ = 'brett@codigious.com'
import codecs
import os
from optparse import make_option
import yaml
import yaml.parser
from django.contrib.auth.models import User
from django.db.utils import IntegrityError
from django.core.management.base import BaseCommand, CommandError
class ... | 36.859649 | 108 | 0.585436 | from django.conf import settings
__author__ = 'brett@codigious.com'
import codecs
import os
from optparse import make_option
import yaml
import yaml.parser
from django.contrib.auth.models import User
from django.db.utils import IntegrityError
from django.core.management.base import BaseCommand, CommandError
class ... | true | true |
1c49c4ae101e4f898905a971de616b3252a2ebed | 4,978 | py | Python | oauth2.py | mats-ch/ctfd-oauth | 59d9c6bd22c69f12d909329cc94293270fb09ba6 | [
"MIT"
] | null | null | null | oauth2.py | mats-ch/ctfd-oauth | 59d9c6bd22c69f12d909329cc94293270fb09ba6 | [
"MIT"
] | null | null | null | oauth2.py | mats-ch/ctfd-oauth | 59d9c6bd22c69f12d909329cc94293270fb09ba6 | [
"MIT"
] | null | null | null | from flask import render_template, session, redirect
from flask_dance.contrib import azure, github
import flask_dance.contrib
import os
from CTFd.auth import confirm, register, reset_password, login
from CTFd.models import db, Users
from CTFd.utils import set_config
from CTFd.utils.logging import log
from CTFd.utils.s... | 35.557143 | 136 | 0.631579 | from flask import render_template, session, redirect
from flask_dance.contrib import azure, github
import flask_dance.contrib
import os
from CTFd.auth import confirm, register, reset_password, login
from CTFd.models import db, Users
from CTFd.utils import set_config
from CTFd.utils.logging import log
from CTFd.utils.s... | true | true |
1c49c504b6dafe6dbc71503afe31a87262f71392 | 950 | py | Python | noggin/middleware.py | mscherer/noggin | 0e3be29de02a1ba7aaf247493c5adf7d08e5f64b | [
"MIT"
] | null | null | null | noggin/middleware.py | mscherer/noggin | 0e3be29de02a1ba7aaf247493c5adf7d08e5f64b | [
"MIT"
] | null | null | null | noggin/middleware.py | mscherer/noggin | 0e3be29de02a1ba7aaf247493c5adf7d08e5f64b | [
"MIT"
] | null | null | null | import python_freeipa
from flask import make_response, render_template
class IPAErrorHandler:
def __init__(self, app, error_template):
self.app = app
self.template = error_template
self.init_app()
def init_app(self):
self.app.wsgi_app = IPAWSGIMiddleware(
self.app.... | 30.645161 | 78 | 0.690526 | import python_freeipa
from flask import make_response, render_template
class IPAErrorHandler:
def __init__(self, app, error_template):
self.app = app
self.template = error_template
self.init_app()
def init_app(self):
self.app.wsgi_app = IPAWSGIMiddleware(
self.app.... | true | true |
1c49c50fb5c3d93475f03b91a1ed2d767b508c0a | 158 | py | Python | Hello_World/main.py | sostrowski/python | f01ac6f7ca491e10209ce7e3c37647e08d8f90af | [
"MIT"
] | null | null | null | Hello_World/main.py | sostrowski/python | f01ac6f7ca491e10209ce7e3c37647e08d8f90af | [
"MIT"
] | null | null | null | Hello_World/main.py | sostrowski/python | f01ac6f7ca491e10209ce7e3c37647e08d8f90af | [
"MIT"
] | null | null | null | # This program says hello and asks for my name.
print('Hello world!')
print('What is your name?')
myName = input()
print('It is good to meet you, ' + myName)
| 26.333333 | 47 | 0.689873 |
print('Hello world!')
print('What is your name?')
myName = input()
print('It is good to meet you, ' + myName)
| true | true |
1c49c5326968324058812cb3a486dd5da42909e9 | 4,645 | py | Python | qa/rpc-tests/test_framework.py | hkaase/TestCoin | 73c647a99e933085ecc04c1d51491eeb44a922a4 | [
"MIT"
] | null | null | null | qa/rpc-tests/test_framework.py | hkaase/TestCoin | 73c647a99e933085ecc04c1d51491eeb44a922a4 | [
"MIT"
] | null | null | null | qa/rpc-tests/test_framework.py | hkaase/TestCoin | 73c647a99e933085ecc04c1d51491eeb44a922a4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
# Copyright (c) 2014 The Testcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Base class for RPC testing
# Add python-Testcoinrpc to module search path:
import os
import sys
sys.path.a... | 33.178571 | 105 | 0.613563 |
import os
import sys
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "python-Testcoinrpc"))
import shutil
import tempfile
import traceback
from Testcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
from util import *
class TestcoinTestFramework(object):
def run_t... | true | true |
1c49c54ee3d9340721f261f16dae2ce932e7cc4a | 5,228 | py | Python | surgeo/scripts/weighted_mean.py | yashd94/surgeo | dc449b7332e143d97321bc844739840c4b0c3666 | [
"MIT"
] | null | null | null | surgeo/scripts/weighted_mean.py | yashd94/surgeo | dc449b7332e143d97321bc844739840c4b0c3666 | [
"MIT"
] | null | null | null | surgeo/scripts/weighted_mean.py | yashd94/surgeo | dc449b7332e143d97321bc844739840c4b0c3666 | [
"MIT"
] | null | null | null | import csv
import math
import itertools
import io
def get_weighted_mean(percentage_index_numbers,
analyzed_subject_index_numbers,
filepath_in,
filepath_out=''):
'''Gives the weighted mean of a particular data set.
Args:
filepat... | 45.068966 | 79 | 0.547437 | import csv
import math
import itertools
import io
def get_weighted_mean(percentage_index_numbers,
analyzed_subject_index_numbers,
filepath_in,
filepath_out=''):
with open(filepath_in, 'rU') as input_csv:
csv_reader = csv.reader(in... | true | true |
1c49c5b532ee2b7117c40d61eb0624ccde59523b | 17,483 | py | Python | qa/common/trace_summary.py | akbargumbira/server | a087c141c62923b61543651eeb5f134806cbaf2d | [
"BSD-3-Clause"
] | null | null | null | qa/common/trace_summary.py | akbargumbira/server | a087c141c62923b61543651eeb5f134806cbaf2d | [
"BSD-3-Clause"
] | null | null | null | qa/common/trace_summary.py | akbargumbira/server | a087c141c62923b61543651eeb5f134806cbaf2d | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
# Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistributions of source code must retain the above copyright
# notice, t... | 40.65814 | 174 | 0.566493 |
import argparse
import json
import sys
import numpy as np
FLAGS = None
def add_span(span_map, timestamps, span_name, ts_start, ts_end):
for tag in (ts_start, ts_end):
if tag not in timestamps:
raise ValueError('timestamps missing "{}": {}'.format(
t... | true | true |
1c49c641c007103fba76421fc78571e90fbff9c1 | 1,284 | py | Python | cpm/code/leastSquareSolver.py | jvc2688/cpm | 409e9ada39fc6238a63a75fb8474a3af70410347 | [
"MIT"
] | 1 | 2015-08-13T19:26:23.000Z | 2015-08-13T19:26:23.000Z | cpm/code/leastSquareSolver.py | jvc2688/cpm | 409e9ada39fc6238a63a75fb8474a3af70410347 | [
"MIT"
] | null | null | null | cpm/code/leastSquareSolver.py | jvc2688/cpm | 409e9ada39fc6238a63a75fb8474a3af70410347 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import division, print_function
__all__ = ["linear_least_squares"]
import numpy as np
from scipy import linalg
def linear_least_squares(A, y, yvar=None, l2=None):
"""
Solve a linear system as fast as possible.
:param A: ``(ndata, nbasis)``
... | 26.204082 | 78 | 0.57243 |
from __future__ import division, print_function
__all__ = ["linear_least_squares"]
import numpy as np
from scipy import linalg
def linear_least_squares(A, y, yvar=None, l2=None):
if yvar is not None:
CiA = A / yvar[:, None]
Ciy = y / yvar[:, None]
else:
CiA = A
Ciy = y... | true | true |
1c49c75a54956fe7a7977bc79452b0fbce941fc1 | 157 | py | Python | solution/lcp06.py | sth4nothing/pyleetcode | 70ac2dc55b0cbcd243b38103a96dd796538a3c05 | [
"MIT"
] | null | null | null | solution/lcp06.py | sth4nothing/pyleetcode | 70ac2dc55b0cbcd243b38103a96dd796538a3c05 | [
"MIT"
] | null | null | null | solution/lcp06.py | sth4nothing/pyleetcode | 70ac2dc55b0cbcd243b38103a96dd796538a3c05 | [
"MIT"
] | null | null | null | import math
from typing import List
class Solution:
def minCount(self, coins: List[int]) -> int:
return sum(map(lambda c:math.ceil(c/2), coins))
| 26.166667 | 55 | 0.681529 | import math
from typing import List
class Solution:
def minCount(self, coins: List[int]) -> int:
return sum(map(lambda c:math.ceil(c/2), coins))
| true | true |
1c49c954463613879c282f1b71d006111054bf6c | 4,568 | py | Python | pype/plugins/maya/publish/validate_muster_connection.py | tokejepsen/pype | 8f2b2b631cc5d3ad93eeb5ad3bc6110d32466ed3 | [
"MIT"
] | null | null | null | pype/plugins/maya/publish/validate_muster_connection.py | tokejepsen/pype | 8f2b2b631cc5d3ad93eeb5ad3bc6110d32466ed3 | [
"MIT"
] | null | null | null | pype/plugins/maya/publish/validate_muster_connection.py | tokejepsen/pype | 8f2b2b631cc5d3ad93eeb5ad3bc6110d32466ed3 | [
"MIT"
] | null | null | null | import os
import json
import appdirs
import pyblish.api
from avalon.vendor import requests
from pype.plugin import contextplugin_should_run
import pype.maya.action
class ValidateMusterConnection(pyblish.api.ContextPlugin):
"""
Validate Muster REST API Service is running and we have valid auth token
"""
... | 37.442623 | 97 | 0.637916 | import os
import json
import appdirs
import pyblish.api
from avalon.vendor import requests
from pype.plugin import contextplugin_should_run
import pype.maya.action
class ValidateMusterConnection(pyblish.api.ContextPlugin):
label = "Validate Muster REST API Service"
order = pyblish.api.ValidatorOrder
hos... | true | true |
1c49c9837d339902372100015afa8dd09aa825df | 718 | py | Python | tests/main.py | deeso/json-search-replace | d1dd75cfaecb65bf8fcbad0c80a0bd839eccaa8d | [
"Apache-2.0"
] | 1 | 2019-02-08T14:42:45.000Z | 2019-02-08T14:42:45.000Z | tests/main.py | deeso/manipin-json | d1dd75cfaecb65bf8fcbad0c80a0bd839eccaa8d | [
"Apache-2.0"
] | null | null | null | tests/main.py | deeso/manipin-json | d1dd75cfaecb65bf8fcbad0c80a0bd839eccaa8d | [
"Apache-2.0"
] | null | null | null | from wrapper_tests.upsert_test import *
from wrapper_tests.upsertvaluedict_test import *
import os
import logging
import sys
import argparse
import signal
logging.getLogger().setLevel(logging.DEBUG)
ch = logging.StreamHandler(sys.stdout)
ch.setLevel(logging.DEBUG)
formatter = logging.Formatter('[%(asctime)s - %(name)s... | 26.592593 | 71 | 0.721448 | from wrapper_tests.upsert_test import *
from wrapper_tests.upsertvaluedict_test import *
import os
import logging
import sys
import argparse
import signal
logging.getLogger().setLevel(logging.DEBUG)
ch = logging.StreamHandler(sys.stdout)
ch.setLevel(logging.DEBUG)
formatter = logging.Formatter('[%(asctime)s - %(name)s... | true | true |
1c49c9dd5478932c655374fad541acbfc8952eeb | 2,650 | py | Python | deploy/utils/predictor.py | Sibo2rr/PaddleClas | b575e002cde44631b2dfc6333f4cfe43f0d0fc81 | [
"Apache-2.0"
] | 3 | 2021-12-16T06:59:04.000Z | 2021-12-16T06:59:24.000Z | deploy/utils/predictor.py | hello3281/PaddleClas | 8103f010c75ce4b4bee51ede8d057da4c6bd446a | [
"Apache-2.0"
] | null | null | null | deploy/utils/predictor.py | hello3281/PaddleClas | 8103f010c75ce4b4bee51ede8d057da4c6bd446a | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 36.805556 | 78 | 0.689434 |
import os
import argparse
import base64
import shutil
import cv2
import numpy as np
from paddle.inference import Config
from paddle.inference import create_predictor
class Predictor(object):
def __init__(self, args, inference_model_dir=None):
if args.use_fp16 is True:
as... | true | true |
1c49ca0ede398431f0496d09c172189ae299c254 | 5,375 | py | Python | pinax/apps/basic_profiles/views.py | skabber/pinax | 6fdee6b7bbbb597074d45122badf3a6dd75e0b92 | [
"MIT"
] | 2 | 2015-12-27T23:07:51.000Z | 2016-05-09T08:57:28.000Z | pinax/apps/basic_profiles/views.py | SMiGL/pinax | d08b2655fe661566bd13c5c170b1a4cad9e67a1d | [
"MIT"
] | null | null | null | pinax/apps/basic_profiles/views.py | SMiGL/pinax | d08b2655fe661566bd13c5c170b1a4cad9e67a1d | [
"MIT"
] | null | null | null | from django.conf import settings
from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext
from django.contrib.auth.models import User
from django.http import HttpResponse, HttpResponseForbidden
from django.utils.translation import ugettext_lazy as _
from django.util... | 43 | 172 | 0.614512 | from django.conf import settings
from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext
from django.contrib.auth.models import User
from django.http import HttpResponse, HttpResponseForbidden
from django.utils.translation import ugettext_lazy as _
from django.util... | true | true |
1c49ca865c275afff6e3b397b4fb7f0c5ba2036e | 1,962 | py | Python | mysite/polls/views.py | allentv/pycon-django-workshop | 931c3b672882616355053f1d84432ecaacddfbfc | [
"MIT"
] | null | null | null | mysite/polls/views.py | allentv/pycon-django-workshop | 931c3b672882616355053f1d84432ecaacddfbfc | [
"MIT"
] | null | null | null | mysite/polls/views.py | allentv/pycon-django-workshop | 931c3b672882616355053f1d84432ecaacddfbfc | [
"MIT"
] | null | null | null | from django.shortcuts import get_object_or_404, render
from django.http import HttpResponseRedirect
from django.urls import reverse
from django.views import generic
from .models import Question
def index(request):
latest_question_list = Question.objects.order_by('-pub_date')[:5]
context = {
'latest_... | 33.827586 | 82 | 0.705403 | from django.shortcuts import get_object_or_404, render
from django.http import HttpResponseRedirect
from django.urls import reverse
from django.views import generic
from .models import Question
def index(request):
latest_question_list = Question.objects.order_by('-pub_date')[:5]
context = {
'latest_... | true | true |
1c49cadd0256d125b86d00b3f7ba4dc0283c375c | 3,458 | py | Python | torchio/data/inference/aggregator.py | Jimmy2027/torchio | 98e5f4f379e877fa20c49f93645a3d0e0834f650 | [
"MIT"
] | null | null | null | torchio/data/inference/aggregator.py | Jimmy2027/torchio | 98e5f4f379e877fa20c49f93645a3d0e0834f650 | [
"MIT"
] | null | null | null | torchio/data/inference/aggregator.py | Jimmy2027/torchio | 98e5f4f379e877fa20c49f93645a3d0e0834f650 | [
"MIT"
] | null | null | null | from typing import Tuple
import torch
import numpy as np
from ...utils import to_tuple
from ...torchio import TypeData, TypeTuple
from ..subject import Subject
class GridAggregator:
r"""Aggregate patches for dense inference.
This class is typically used to build a volume made of batches after
inference o... | 39.747126 | 100 | 0.622325 | from typing import Tuple
import torch
import numpy as np
from ...utils import to_tuple
from ...torchio import TypeData, TypeTuple
from ..subject import Subject
class GridAggregator:
def __init__(
self,
sample: Subject,
patch_overlap: TypeTuple,
out_channels: int = 1... | true | true |
1c49cb658dbcd25048b0ba1ab66c8574e990ca81 | 1,086 | py | Python | test/terra/pulse/de/__init__.py | sagarpahwa/qiskit-aer | 77e40c8d99fd0490d85285e96f87e4905017b646 | [
"Apache-2.0"
] | 313 | 2018-12-19T09:19:12.000Z | 2022-03-21T18:15:41.000Z | test/terra/pulse/de/__init__.py | sagarpahwa/qiskit-aer | 77e40c8d99fd0490d85285e96f87e4905017b646 | [
"Apache-2.0"
] | 933 | 2018-12-21T02:56:49.000Z | 2022-03-30T01:19:54.000Z | test/terra/pulse/de/__init__.py | sagarpahwa/qiskit-aer | 77e40c8d99fd0490d85285e96f87e4905017b646 | [
"Apache-2.0"
] | 313 | 2018-12-19T14:52:55.000Z | 2022-02-28T20:20:14.000Z | # This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2019, 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or d... | 32.909091 | 79 | 0.714549 |
import os
def load_tests(loader, standard_tests, pattern):
this_dir = os.path.dirname(__file__)
if pattern in ['test*.py', '*_test.py']:
package_tests = loader.discover(start_dir=this_dir, pattern=pattern)
standard_tests.addTests(package_tests)
elif pattern in ['profile*.py', ... | true | true |
1c49cba02d177d2ba601cb3a59b70360782c086a | 174,750 | py | Python | DungeonGenerator.py | JaxxyIV/ALttPDoorRandomizer | bbad1d1d8b1020b50453b66b2d88c5fb8712be38 | [
"MIT"
] | 42 | 2019-08-22T16:19:51.000Z | 2022-03-30T17:39:39.000Z | DungeonGenerator.py | JaxxyIV/ALttPDoorRandomizer | bbad1d1d8b1020b50453b66b2d88c5fb8712be38 | [
"MIT"
] | 48 | 2019-09-04T22:47:03.000Z | 2022-01-13T22:16:13.000Z | DungeonGenerator.py | JaxxyIV/ALttPDoorRandomizer | bbad1d1d8b1020b50453b66b2d88c5fb8712be38 | [
"MIT"
] | 35 | 2020-01-10T09:12:53.000Z | 2022-03-23T08:22:25.000Z | import RaceRandom as random
import collections
import itertools
from collections import defaultdict, deque
from functools import reduce
import logging
import math
import operator as op
import time
from typing import List
from BaseClasses import DoorType, Direction, CrystalBarrier, RegionType, Polarity, PolSlot, floode... | 44.544991 | 160 | 0.614152 | import RaceRandom as random
import collections
import itertools
from collections import defaultdict, deque
from functools import reduce
import logging
import math
import operator as op
import time
from typing import List
from BaseClasses import DoorType, Direction, CrystalBarrier, RegionType, Polarity, PolSlot, floode... | true | true |
1c49cc9c62f8a2e1acc97ec88014ca7f54dbd2f8 | 861 | py | Python | tests/test_settings.py | ibqn/django-graphql-jwt | dd92319071092bb517187904f3ac0610e8443edf | [
"MIT"
] | 1 | 2019-06-19T12:05:08.000Z | 2019-06-19T12:05:08.000Z | tests/test_settings.py | ibqn/django-graphql-jwt | dd92319071092bb517187904f3ac0610e8443edf | [
"MIT"
] | 1 | 2018-11-01T05:12:50.000Z | 2018-11-01T05:12:50.000Z | tests/test_settings.py | ibqn/django-graphql-jwt | dd92319071092bb517187904f3ac0610e8443edf | [
"MIT"
] | 1 | 2021-03-10T17:53:41.000Z | 2021-03-10T17:53:41.000Z | from datetime import timedelta
from django.test import TestCase
from graphql_jwt import settings
class SettingsTests(TestCase):
def test_perform_import(self):
f = settings.perform_import(id, '')
self.assertEqual(f, id)
f = settings.perform_import('datetime.timedelta', '')
self.... | 27.774194 | 61 | 0.70964 | from datetime import timedelta
from django.test import TestCase
from graphql_jwt import settings
class SettingsTests(TestCase):
def test_perform_import(self):
f = settings.perform_import(id, '')
self.assertEqual(f, id)
f = settings.perform_import('datetime.timedelta', '')
self.... | true | true |
1c49cd379a153b4789e7d9393eb5505762cb9e05 | 576 | py | Python | services/models/mnemosyne.py | life-game-player/Hephaestus | 0c695193d8d2d8c70061e2e26ec8c718544342c6 | [
"MIT"
] | null | null | null | services/models/mnemosyne.py | life-game-player/Hephaestus | 0c695193d8d2d8c70061e2e26ec8c718544342c6 | [
"MIT"
] | null | null | null | services/models/mnemosyne.py | life-game-player/Hephaestus | 0c695193d8d2d8c70061e2e26ec8c718544342c6 | [
"MIT"
] | null | null | null | import torch
def create(
host, user, passwd,
module, operator, operation, result
):
"""
Operation:
1: Create
2: Modify
3: Query
4: Delete
Result:
0: Succeeded
1: Failed
"""
conn = torch.connect(host, user, pas... | 22.153846 | 78 | 0.53125 | import torch
def create(
host, user, passwd,
module, operator, operation, result
):
conn = torch.connect(host, user, passwd, 'hephaestus')
list_sql = list()
list_sql.append(
"INSERT INTO mnemosyne(module, operator, operation, result) "
"VALUES('{}', {}, {}, {})".format(module, oper... | true | true |
1c49ce60fe551913416a74e91ae623292230edb4 | 2,260 | py | Python | bclearer_boson_1_1_source/b_code/configurations/getters/boson_1_2e_k_configuration_getter_separate_names_and_instances.py | boro-alpha/bclearer_boson_1_1 | 15207d240fd3144b155922dc5c5d14822023026a | [
"MIT"
] | 1 | 2021-07-20T15:48:58.000Z | 2021-07-20T15:48:58.000Z | bclearer_boson_1_1_source/b_code/configurations/getters/boson_1_2e_k_configuration_getter_separate_names_and_instances.py | boro-alpha/bclearer_boson_1_1 | 15207d240fd3144b155922dc5c5d14822023026a | [
"MIT"
] | null | null | null | bclearer_boson_1_1_source/b_code/configurations/getters/boson_1_2e_k_configuration_getter_separate_names_and_instances.py | boro-alpha/bclearer_boson_1_1 | 15207d240fd3144b155922dc5c5d14822023026a | [
"MIT"
] | null | null | null | from bclearer_boson_1_1_source.b_code.common_knowledge.inspire_matched_ea_objects import InspireMatchedEaObjects
from bclearer_source.b_code.common_knowledge.convention_shift_operation_types import ConventionShiftOperationTypes
from bclearer_source.b_code.configurations.bespoke_name_to_instance_configuration_objects im... | 55.121951 | 138 | 0.815044 | from bclearer_boson_1_1_source.b_code.common_knowledge.inspire_matched_ea_objects import InspireMatchedEaObjects
from bclearer_source.b_code.common_knowledge.convention_shift_operation_types import ConventionShiftOperationTypes
from bclearer_source.b_code.configurations.bespoke_name_to_instance_configuration_objects im... | true | true |
1c49cebb0a5ba4d641d71c1a1b47be7267c38f1c | 13,667 | py | Python | LPIPSmodels/dist_model.py | HERMINDERSINGH1234/ML_Extra_Resolution_Increases | 1fefceeab83f03fa8194cb63f78c5dbf7e90aeae | [
"Apache-2.0"
] | 1 | 2021-07-17T10:13:10.000Z | 2021-07-17T10:13:10.000Z | LPIPSmodels/dist_model.py | HERMINDERSINGH1234/ML_Extra_Resolution_Increases | 1fefceeab83f03fa8194cb63f78c5dbf7e90aeae | [
"Apache-2.0"
] | null | null | null | LPIPSmodels/dist_model.py | HERMINDERSINGH1234/ML_Extra_Resolution_Increases | 1fefceeab83f03fa8194cb63f78c5dbf7e90aeae | [
"Apache-2.0"
] | null | null | null |
from __future__ import absolute_import
import sys
sys.path.append('..')
sys.path.append('.')
import numpy as np
import torch
from torch import nn
import os
from collections import OrderedDict
from torch.autograd import Variable
import itertools
from .base_model import BaseModel
from scipy.ndimage import... | 41.795107 | 279 | 0.599693 |
from __future__ import absolute_import
import sys
sys.path.append('..')
sys.path.append('.')
import numpy as np
import torch
from torch import nn
import os
from collections import OrderedDict
from torch.autograd import Variable
import itertools
from .base_model import BaseModel
from scipy.ndimage import... | true | true |
1c49cf543130427f0a2e98a414b5ce3c3321b3df | 6,004 | py | Python | sdk/python/pulumi_azure_nextgen/azurestack/latest/customer_subscription.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/azurestack/latest/customer_subscription.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/azurestack/latest/customer_subscription.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__a... | 44.474074 | 287 | 0.659893 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__all__ = ['CustomerSubscription']
warnings.warn("""The 'latest' version is deprecated. Please migrate to the resource in the top-level module: 'azure-nextgen:azuresta... | true | true |
1c49cfd95d576b090d11ac58239cd27ff7c71312 | 553 | py | Python | scripts/RunServer.py | ekg/shasta | e2fd3c3d79fb4cafe77c62f6af2fef46f7a04b01 | [
"BSD-3-Clause"
] | null | null | null | scripts/RunServer.py | ekg/shasta | e2fd3c3d79fb4cafe77c62f6af2fef46f7a04b01 | [
"BSD-3-Clause"
] | null | null | null | scripts/RunServer.py | ekg/shasta | e2fd3c3d79fb4cafe77c62f6af2fef46f7a04b01 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python3
import os
import shasta
import GetConfig
# Find the path to the docs directory.
thisScriptPath = os.path.realpath(__file__)
thisScriptDirectory = os.path.dirname(thisScriptPath)
thisScriptParentDirectory = os.path.dirname(thisScriptDirectory)
docsDirectory = thisScriptParentDirectory + '/docs'
# R... | 22.12 | 64 | 0.793852 |
import os
import shasta
import GetConfig
thisScriptPath = os.path.realpath(__file__)
thisScriptDirectory = os.path.dirname(thisScriptPath)
thisScriptParentDirectory = os.path.dirname(thisScriptDirectory)
docsDirectory = thisScriptParentDirectory + '/docs'
config = GetConfig.getConfig()
a = shasta.Assembler()
a.... | true | true |
1c49d18f431832a15fe255123e31a03b0a805e27 | 5,159 | py | Python | settings.py | garyp/djwed | a3cecfa77f55574fecc05621a33d0cdd20a85fb2 | [
"MIT"
] | 1 | 2021-01-27T09:56:00.000Z | 2021-01-27T09:56:00.000Z | settings.py | garyp/djwed | a3cecfa77f55574fecc05621a33d0cdd20a85fb2 | [
"MIT"
] | null | null | null | settings.py | garyp/djwed | a3cecfa77f55574fecc05621a33d0cdd20a85fb2 | [
"MIT"
] | null | null | null | # Django settings for djwed project.
import logging
from socket import gethostname
production = False
# This is the production hostname (as I'd develop on a desktop and then run
# the system on a colo server.)
if 'my-colo-server' == gethostname().split(".")[0]:
production = True
if not production:
DEBUG = Tr... | 32.043478 | 101 | 0.724559 |
import logging
from socket import gethostname
production = False
# the system on a colo server.)
if 'my-colo-server' == gethostname().split(".")[0]:
production = True
if not production:
DEBUG = True
else:
DEBUG = False
TEMPLATE_DEBUG = DEBUG
logging.basicConfig(level=logging.INFO)
ADMINS = (
('B... | true | true |
1c49d22b406a20082fc4ddf2a42ae03c8ebb4cf3 | 1,325 | py | Python | spanner/google/cloud/spanner.py | bomboradata/bombora-google-cloud-python | 255bbebe6c50490f40fcc3eed40bae1e77e03859 | [
"Apache-2.0"
] | null | null | null | spanner/google/cloud/spanner.py | bomboradata/bombora-google-cloud-python | 255bbebe6c50490f40fcc3eed40bae1e77e03859 | [
"Apache-2.0"
] | null | null | null | spanner/google/cloud/spanner.py | bomboradata/bombora-google-cloud-python | 255bbebe6c50490f40fcc3eed40bae1e77e03859 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 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 a... | 30.813953 | 74 | 0.767547 |
from __future__ import absolute_import
from google.cloud.spanner_v1 import __version__
from google.cloud.spanner_v1 import AbstractSessionPool
from google.cloud.spanner_v1 import BurstyPool
from google.cloud.spanner_v1 import Client
from google.cloud.spanner_v1 import enums
from google.cloud.spanner_v1 ... | true | true |
1c49d2430b558f5439579e9257bf1022eef95d92 | 583 | py | Python | script.plexodus/service.py | MR-Unknown-Cm/addons | 8df1ebe58c95620bb02a05dbae7bf37954915cbd | [
"Apache-2.0"
] | 1 | 2020-03-03T10:01:21.000Z | 2020-03-03T10:01:21.000Z | script.plexodus/service.py | MR-Unknown-Cm/addons | 8df1ebe58c95620bb02a05dbae7bf37954915cbd | [
"Apache-2.0"
] | null | null | null | script.plexodus/service.py | MR-Unknown-Cm/addons | 8df1ebe58c95620bb02a05dbae7bf37954915cbd | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import xbmc
import xbmcgui
import xbmcaddon
def main():
if xbmc.getInfoLabel('Window(10000).Property(script.plexodus.service.started)'):
# Prevent add-on updates from starting a new version of the addon
return
xbmcgui.Window(10000).setProperty('script.plexodus.service.... | 27.761905 | 87 | 0.686106 |
import xbmc
import xbmcgui
import xbmcaddon
def main():
if xbmc.getInfoLabel('Window(10000).Property(script.plexodus.service.started)'):
return
xbmcgui.Window(10000).setProperty('script.plexodus.service.started', '1')
if xbmcaddon.Addon().getSetting('kiosk.mode') == 'true':
xbm... | true | true |
1c49d2ea6b5f5d7265c638d9c946745c6efc2c2a | 1,696 | py | Python | examples/p3/Ball.py | djpeach/pygamer | 77a0cdab58bc29d06cc88c8cc823850794fe0bf0 | [
"MIT"
] | null | null | null | examples/p3/Ball.py | djpeach/pygamer | 77a0cdab58bc29d06cc88c8cc823850794fe0bf0 | [
"MIT"
] | null | null | null | examples/p3/Ball.py | djpeach/pygamer | 77a0cdab58bc29d06cc88c8cc823850794fe0bf0 | [
"MIT"
] | null | null | null | import pygame
import pygamer
import time
class Ball(pygamer.Object):
def __init__(self, speed, color, radius, center_position):
rect = pygame.rect.Rect(center_position[0] - radius, center_position[1] - radius, radius * 2, radius * 2)
super().__init__(rect, speed)
self.color = color
... | 39.44186 | 127 | 0.598467 | import pygame
import pygamer
import time
class Ball(pygamer.Object):
def __init__(self, speed, color, radius, center_position):
rect = pygame.rect.Rect(center_position[0] - radius, center_position[1] - radius, radius * 2, radius * 2)
super().__init__(rect, speed)
self.color = color
... | true | true |
1c49d35a318a1a44c92df86786fbdadfd07a7a15 | 196 | py | Python | detectron/lib/python3.6/site-packages/torchvision/version.py | JustinBear99/Mask_RCNN | d43eaf7c6ebf29d4d6da796a0f7ff5561e21acff | [
"Apache-2.0"
] | null | null | null | detectron/lib/python3.6/site-packages/torchvision/version.py | JustinBear99/Mask_RCNN | d43eaf7c6ebf29d4d6da796a0f7ff5561e21acff | [
"Apache-2.0"
] | null | null | null | detectron/lib/python3.6/site-packages/torchvision/version.py | JustinBear99/Mask_RCNN | d43eaf7c6ebf29d4d6da796a0f7ff5561e21acff | [
"Apache-2.0"
] | null | null | null | __version__ = '0.6.1'
git_version = '35d732ac53aebbed917993523d685b4cb09ef6ea'
from torchvision.extension import _check_cuda_version
if _check_cuda_version() > 0:
cuda = _check_cuda_version()
| 32.666667 | 56 | 0.811224 | __version__ = '0.6.1'
git_version = '35d732ac53aebbed917993523d685b4cb09ef6ea'
from torchvision.extension import _check_cuda_version
if _check_cuda_version() > 0:
cuda = _check_cuda_version()
| true | true |
1c49d3ed3d448eb8beffb819f40560927ff5b27b | 12,269 | py | Python | testtools/tests/test_run.py | sparkiegeek/testtools | f86658ac18521db4254e7292c4a4dda6017d930e | [
"MIT"
] | null | null | null | testtools/tests/test_run.py | sparkiegeek/testtools | f86658ac18521db4254e7292c4a4dda6017d930e | [
"MIT"
] | null | null | null | testtools/tests/test_run.py | sparkiegeek/testtools | f86658ac18521db4254e7292c4a4dda6017d930e | [
"MIT"
] | null | null | null | # Copyright (c) 2010 testtools developers. See LICENSE for details.
"""Tests for the test runner logic."""
import doctest
import io
from unittest import TestSuite
import sys
from textwrap import dedent
from extras import try_import
fixtures = try_import('fixtures')
testresources = try_import('testresources')
import ... | 34.175487 | 83 | 0.615454 |
import doctest
import io
from unittest import TestSuite
import sys
from textwrap import dedent
from extras import try_import
fixtures = try_import('fixtures')
testresources = try_import('testresources')
import unittest
import testtools
from testtools import TestCase, run, skipUnless
from testtools.compat import (
... | true | true |
1c49d5612454adebb23817577e69371c43f1abab | 17,792 | py | Python | coap/coapTransmitter.py | TimothyClaeys/coap | 02487f06980c5c434fcf7efc0f04a97a081e1f13 | [
"BSD-3-Clause"
] | 53 | 2015-03-04T19:41:29.000Z | 2021-09-27T18:39:52.000Z | coap/coapTransmitter.py | TimothyClaeys/coap | 02487f06980c5c434fcf7efc0f04a97a081e1f13 | [
"BSD-3-Clause"
] | 7 | 2016-05-18T15:49:43.000Z | 2019-06-12T15:06:30.000Z | coap/coapTransmitter.py | TimothyClaeys/coap | 02487f06980c5c434fcf7efc0f04a97a081e1f13 | [
"BSD-3-Clause"
] | 57 | 2015-01-07T08:54:54.000Z | 2021-09-27T18:39:55.000Z | import logging
class NullHandler(logging.Handler):
def emit(self, record):
pass
log = logging.getLogger('coapTransmitter')
log.setLevel(logging.ERROR)
log.addHandler(NullHandler())
import time
import threading
import random
from . import coapDefines as d
from . import coapException ... | 34.48062 | 176 | 0.519054 | import logging
class NullHandler(logging.Handler):
def emit(self, record):
pass
log = logging.getLogger('coapTransmitter')
log.setLevel(logging.ERROR)
log.addHandler(NullHandler())
import time
import threading
import random
from . import coapDefines as d
from . import coapException ... | true | true |
1c49d5f237a286b2bb5c13f14cb28491327c2343 | 3,576 | py | Python | funboost/factories/publisher_factotry.py | DJMIN/funboost | 7570ca2909bb0b44a1080f5f98aa96c86d3da9d4 | [
"Apache-2.0"
] | null | null | null | funboost/factories/publisher_factotry.py | DJMIN/funboost | 7570ca2909bb0b44a1080f5f98aa96c86d3da9d4 | [
"Apache-2.0"
] | null | null | null | funboost/factories/publisher_factotry.py | DJMIN/funboost | 7570ca2909bb0b44a1080f5f98aa96c86d3da9d4 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# @Author : ydf
# @Time : 2019/8/8 0008 13:16
import copy
from typing import Callable
from funboost.publishers.confluent_kafka_publisher import ConfluentKafkaPublisher
from funboost.publishers.http_publisher import HTTPPublisher
from funboost.publishers.kombu_publisher import KombuPublisher... | 43.609756 | 111 | 0.782438 |
import copy
from typing import Callable
from funboost.publishers.confluent_kafka_publisher import ConfluentKafkaPublisher
from funboost.publishers.http_publisher import HTTPPublisher
from funboost.publishers.kombu_publisher import KombuPublisher
from funboost.publishers.nats_publisher import NatsPublisher
from funb... | true | true |
1c49d63275e5e8dd3611c5fba177eb143551df99 | 15,890 | py | Python | docs/source/conf.py | crusaderky/distributed | d1cf1d452aece30b75adaf7f73f7cfdc69a63c4a | [
"BSD-3-Clause"
] | 1,358 | 2016-02-09T21:25:27.000Z | 2022-03-30T08:06:36.000Z | docs/source/conf.py | crusaderky/distributed | d1cf1d452aece30b75adaf7f73f7cfdc69a63c4a | [
"BSD-3-Clause"
] | 4,789 | 2016-02-10T00:13:43.000Z | 2022-03-31T23:56:27.000Z | docs/source/conf.py | crusaderky/distributed | d1cf1d452aece30b75adaf7f73f7cfdc69a63c4a | [
"BSD-3-Clause"
] | 791 | 2016-02-19T04:34:38.000Z | 2022-03-31T16:26:38.000Z | from __future__ import annotations
#
# Dask.distributed documentation build configuration file, created by
# sphinx-quickstart on Tue Oct 6 14:42:44 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
# auto... | 32.428571 | 117 | 0.685903 | from __future__ import annotations
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.todo",
"sphinx.ext.ifconfig",
"sphinx.ext.viewcode",
"sphinx.ext.autosummary",
"sphinx.ext.extlinks",
"sphinx.ext.intersphinx",
"numpydoc",
"sphinx_click.ext",
]
numpydoc_s... | true | true |
1c49d6af950d52fdab2916b0e3bb2e50b50c6d22 | 6,893 | py | Python | python/paddle/incubate/operators/graph_reindex.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | 11 | 2016-08-29T07:43:26.000Z | 2016-08-29T07:51:24.000Z | python/paddle/incubate/operators/graph_reindex.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | null | null | null | python/paddle/incubate/operators/graph_reindex.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | 1 | 2021-12-09T08:59:17.000Z | 2021-12-09T08:59:17.000Z | # Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 45.649007 | 94 | 0.596402 |
import paddle
from paddle.fluid.layer_helper import LayerHelper
from paddle.fluid.framework import _non_static_mode
from paddle.fluid.data_feeder import check_variable_and_dtype
from paddle.fluid import core
from paddle import _C_ops
def graph_reindex(x,
neighbors,
co... | true | true |
1c49d6baa6cc4f1e16d6a5132cb65e2120088470 | 1,158 | py | Python | Advent of Code/2020/3/3.py | dimitrov-dimitar/competitive-programming | f2b022377baf6d4beff213fc513907b774c12352 | [
"MIT"
] | null | null | null | Advent of Code/2020/3/3.py | dimitrov-dimitar/competitive-programming | f2b022377baf6d4beff213fc513907b774c12352 | [
"MIT"
] | null | null | null | Advent of Code/2020/3/3.py | dimitrov-dimitar/competitive-programming | f2b022377baf6d4beff213fc513907b774c12352 | [
"MIT"
] | null | null | null | matrix = []
with open('input') as f:
for row in f:
row_matrix = [x for x in row if x != '\n']
row_matrix *= 1000
matrix.append(row_matrix)
# print(matrix[0])
i, j = 0, 0
counter_1 = counter_2 = counter_3 = counter_4 = counter_5 = 0
# Part One
# 3, 1
while True:
if i >= len(matrix):
... | 13.623529 | 64 | 0.486183 | matrix = []
with open('input') as f:
for row in f:
row_matrix = [x for x in row if x != '\n']
row_matrix *= 1000
matrix.append(row_matrix)
i, j = 0, 0
counter_1 = counter_2 = counter_3 = counter_4 = counter_5 = 0
while True:
if i >= len(matrix):
break
if matrix[i][j] ... | true | true |
1c49d6e03e4aa9f496a950a08e7afb8664ce56e7 | 4,752 | py | Python | Simple Text classifiers/Text Classification on 20Newsgroup using NN/20ng_classifier - Conv1d.py | tejasurya/Text_Classification_using_Neural_Networks | d4852780e6c86843aee768d306d19428c8cb9c7f | [
"MIT"
] | 1 | 2020-04-30T16:15:42.000Z | 2020-04-30T16:15:42.000Z | Simple Text classifiers/Text Classification on 20Newsgroup using NN/20ng_classifier - Conv1d.py | tejasurya/Text_Classification_using_Neural_Networks | d4852780e6c86843aee768d306d19428c8cb9c7f | [
"MIT"
] | null | null | null | Simple Text classifiers/Text Classification on 20Newsgroup using NN/20ng_classifier - Conv1d.py | tejasurya/Text_Classification_using_Neural_Networks | d4852780e6c86843aee768d306d19428c8cb9c7f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Feb 6 15:55:01 2018
@author: HP
"""
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 5 14:31:43 2018
@author: HP
"""
import os
import pandas as pd
import nltk
import gensim
from gensim import corpora, models, similarities
from nltk.corpus import stopwords
from nltk.tokeniz... | 23.180488 | 100 | 0.742635 |
import os
import pandas as pd
import nltk
import gensim
from gensim import corpora, models, similarities
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
from gensim.models.keyedvectors import KeyedVectors as KV
from numpy import asarray
from numpy import zeros
import numpy as np
from keras... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.