hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c274ae3cdc60a37d8c9d089e4a5b8124c450eca | 4,001 | py | Python | Hallowing_Jump_Sound/jump-sound.py | emceeaich/Adafruit_Learning_System_Guides | 632619cfeb24463b1cec57e5361e8a7150093ff2 | [
"MIT"
] | null | null | null | Hallowing_Jump_Sound/jump-sound.py | emceeaich/Adafruit_Learning_System_Guides | 632619cfeb24463b1cec57e5361e8a7150093ff2 | [
"MIT"
] | null | null | null | Hallowing_Jump_Sound/jump-sound.py | emceeaich/Adafruit_Learning_System_Guides | 632619cfeb24463b1cec57e5361e8a7150093ff2 | [
"MIT"
] | null | null | null | """
Jump & touch sound example for Adafruit Hallowing. Plays different sounds
in response to jumping and capacitive touch pads.
Image display requires CircuitPython 4.0.0-alpha1 or later (with displayio
support). WILL work with earlier versions, just no image shown!
"""
import time
import busio
import board
import dig... | 36.372727 | 100 | 0.695576 |
import time
import busio
import board
import digitalio
import audioio
import audiocore
import touchio
import neopixel
def load_wav(name):
return audiocore.WaveFile(open(name + '.wav', 'rb'))
def play_wav(wav):
AUDIO.play(wav)
while AUDIO.playing:
pass
time.sleep(1)
TOUCH_WAV =... | true | true |
1c274afae2f7272e860bf63577beacd3f84161d1 | 144,098 | py | Python | numpy/lib/tests/test_function_base.py | andrekwr/numpy | e564fcbecfb0b589e224e6e66e8894105a46aedf | [
"BSD-3-Clause"
] | 1 | 2021-12-14T18:48:58.000Z | 2021-12-14T18:48:58.000Z | numpy/lib/tests/test_function_base.py | andrekwr/numpy | e564fcbecfb0b589e224e6e66e8894105a46aedf | [
"BSD-3-Clause"
] | null | null | null | numpy/lib/tests/test_function_base.py | andrekwr/numpy | e564fcbecfb0b589e224e6e66e8894105a46aedf | [
"BSD-3-Clause"
] | 1 | 2022-02-09T22:48:38.000Z | 2022-02-09T22:48:38.000Z | import operator
import warnings
import sys
import decimal
from fractions import Fraction
import math
import pytest
import hypothesis
from hypothesis.extra.numpy import arrays
import hypothesis.strategies as st
import numpy as np
from numpy import ma
from numpy.testing import (
assert_, assert_equal, assert_array_... | 37.554861 | 102 | 0.526364 | import operator
import warnings
import sys
import decimal
from fractions import Fraction
import math
import pytest
import hypothesis
from hypothesis.extra.numpy import arrays
import hypothesis.strategies as st
import numpy as np
from numpy import ma
from numpy.testing import (
assert_, assert_equal, assert_array_... | true | true |
1c274cc9d2f9d6f789fa85586f85a730981ba449 | 1,168 | py | Python | mnist.py | AndreaCeccarelli/gpu-monitor | aad4dc88387a69235e9c370cb08da1f16ba4aa96 | [
"MIT"
] | 4 | 2021-11-02T08:06:22.000Z | 2022-02-08T13:18:51.000Z | mnist.py | AndreaCeccarelli/gpu-monitor | aad4dc88387a69235e9c370cb08da1f16ba4aa96 | [
"MIT"
] | null | null | null | mnist.py | AndreaCeccarelli/gpu-monitor | aad4dc88387a69235e9c370cb08da1f16ba4aa96 | [
"MIT"
] | null | null | null | import torch as torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import numpy as np
from art.utils import load_dataset
import art.attacks
from art.classifiers import PyTorchClassifier
from art.utils import load_mnist
from art.utils import load_cifar10
import torchvision
import tor... | 30.736842 | 82 | 0.759418 | import torch as torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import numpy as np
from art.utils import load_dataset
import art.attacks
from art.classifiers import PyTorchClassifier
from art.utils import load_mnist
from art.utils import load_cifar10
import torchvision
import tor... | true | true |
1c274d8704129bb83e036a9d404cf97bd2d102d9 | 3,160 | py | Python | tests/managers_regress/models.py | ponsonio-aurea/django | dc165ec8e5698ffc6dee6b510f1f92c9fd7467fe | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | tests/managers_regress/models.py | ponsonio-aurea/django | dc165ec8e5698ffc6dee6b510f1f92c9fd7467fe | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | tests/managers_regress/models.py | ponsonio-aurea/django | dc165ec8e5698ffc6dee6b510f1f92c9fd7467fe | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | """
Various edge-cases for model managers.
"""
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.db import models
class OnlyFred(models.Manager):
def get_queryset(self):
return super(OnlyFred, ... | 22.733813 | 105 | 0.704114 |
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.db import models
class OnlyFred(models.Manager):
def get_queryset(self):
return super(OnlyFred, self).get_queryset().filter(name='fred')
clas... | true | true |
1c274e5b809bb2c4b705ee53b4536e20dba9600f | 1,843 | py | Python | migrations/versions/8ee20266bb5b_.py | Ahmad-Zaky/fuyyr_udacity_proj | 469bc164bccf2593f111c98b8c7320f28db0d580 | [
"MIT"
] | null | null | null | migrations/versions/8ee20266bb5b_.py | Ahmad-Zaky/fuyyr_udacity_proj | 469bc164bccf2593f111c98b8c7320f28db0d580 | [
"MIT"
] | null | null | null | migrations/versions/8ee20266bb5b_.py | Ahmad-Zaky/fuyyr_udacity_proj | 469bc164bccf2593f111c98b8c7320f28db0d580 | [
"MIT"
] | null | null | null | """empty message
Revision ID: 8ee20266bb5b
Revises: 1923544c6b0c
Create Date: 2021-03-05 14:01:26.410106
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '8ee20266bb5b'
down_revision = '1923544c6b0c'
branch_labels = None
depends_on = None
def upgrade():
# ... | 34.773585 | 67 | 0.663592 | from alembic import op
import sqlalchemy as sa
revision = '8ee20266bb5b'
down_revision = '1923544c6b0c'
branch_labels = None
depends_on = None
def upgrade():
)
op.create_unique_constraint(None, 'artists', ['facebook_link'])
op.create_unique_constraint(None, 'artists', ['website'])
op.alter_column('... | true | true |
1c274ed191337ac67f985de693cf97ed7be5a4fd | 463 | py | Python | test.py | florianwolz/prime | 5ac29c523c5730e1d50c5d4703658427fdddfac3 | [
"Apache-2.0"
] | null | null | null | test.py | florianwolz/prime | 5ac29c523c5730e1d50c5d4703658427fdddfac3 | [
"Apache-2.0"
] | 1 | 2019-03-04T07:19:36.000Z | 2019-03-04T07:19:36.000Z | test.py | florianwolz/prime | 5ac29c523c5730e1d50c5d4703658427fdddfac3 | [
"Apache-2.0"
] | null | null | null | #from prime.output import Index, Indices
#import time
#idx = Indices(8)
#print(len(idx.indices))
#idx.symmetrize([(0,1),(2,3),(4,5),(6,7)])
#print(len(idx.indices))
#for id in idx.indices:
# print(id)
#print()
#idx.exchangeSymmetrize([((0,1,2,3,4,5,6,7),(4,5,6,7,0,1,2,3))])
#for id in idx.indices:
# print(id)... | 22.047619 | 87 | 0.701944 |
from sympy.combinatorics import Permutation
from sympy.combinatorics.tensor_can import get_symmetric_group_sgs, bsgs_direct_product
| true | true |
1c274f27e772cab5464e27845094eefd17aacc57 | 2,582 | py | Python | scripts/translate.py | schultet/goa | b76af608109ff217a2b68ca4e66582850c0a47ea | [
"MIT"
] | 2 | 2019-05-13T11:59:18.000Z | 2019-05-13T12:37:51.000Z | scripts/translate.py | schultet/goa | b76af608109ff217a2b68ca4e66582850c0a47ea | [
"MIT"
] | null | null | null | scripts/translate.py | schultet/goa | b76af608109ff217a2b68ca4e66582850c0a47ea | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- encoding: utf-8 -*-
import os
import argparse
import subprocess
from glob import glob
def translatefolder(src, trg, **kw):
python = kw.get("python", "python3")
translate = kw.get("translate", "./translate/translate.py")
port = int(kw.get("port", 3035))
host = kw.get("host"... | 28.373626 | 79 | 0.558869 |
import os
import argparse
import subprocess
from glob import glob
def translatefolder(src, trg, **kw):
python = kw.get("python", "python3")
translate = kw.get("translate", "./translate/translate.py")
port = int(kw.get("port", 3035))
host = kw.get("host", "127.0.0.1")
if not os.path.exi... | true | true |
1c274fb96e315214f39fff435e59fd902501a242 | 375 | py | Python | catch/datasets/mercadeo.py | broadinstitute/catch | 2fedca15f921116f580de8b2ae7ac9972932e59e | [
"MIT"
] | 58 | 2018-01-24T16:31:37.000Z | 2022-02-25T07:46:35.000Z | catch/datasets/mercadeo.py | broadinstitute/catch | 2fedca15f921116f580de8b2ae7ac9972932e59e | [
"MIT"
] | 29 | 2018-04-17T17:36:06.000Z | 2022-02-25T11:48:58.000Z | catch/datasets/mercadeo.py | broadinstitute/catch | 2fedca15f921116f580de8b2ae7ac9972932e59e | [
"MIT"
] | 16 | 2018-05-23T12:19:41.000Z | 2021-08-09T04:16:00.000Z | """Dataset with 'Mercadeo virus' sequences.
A dataset with 2 'Mercadeo virus' genomes.
THIS PYTHON FILE WAS GENERATED BY A COMPUTER PROGRAM! DO NOT EDIT!
"""
import sys
from catch.datasets import GenomesDatasetSingleChrom
ds = GenomesDatasetSingleChrom(__name__, __file__, __spec__)
ds.add_fasta_path("data/mercade... | 23.4375 | 66 | 0.784 |
import sys
from catch.datasets import GenomesDatasetSingleChrom
ds = GenomesDatasetSingleChrom(__name__, __file__, __spec__)
ds.add_fasta_path("data/mercadeo.fasta.gz", relative=True)
sys.modules[__name__] = ds
| true | true |
1c2750da6855674f85cb8a23e6af3aabb053a192 | 11,628 | py | Python | tests/tagifai/test_data.py | udapy/applied-ml | 9cd4efb5ae4b201f10c92cc1f79b64c04e99b1f7 | [
"MIT"
] | null | null | null | tests/tagifai/test_data.py | udapy/applied-ml | 9cd4efb5ae4b201f10c92cc1f79b64c04e99b1f7 | [
"MIT"
] | null | null | null | tests/tagifai/test_data.py | udapy/applied-ml | 9cd4efb5ae4b201f10c92cc1f79b64c04e99b1f7 | [
"MIT"
] | null | null | null | # tests/tagifai/test_data.py
# Test tagifai/data.py components.
import itertools
import tempfile
from argparse import Namespace
from collections import Counter
from pathlib import Path
import numpy as np
import pytest
from app import config
from tagifai import data, main, utils
@pytest.fixture(scope="module")
def ... | 33.802326 | 100 | 0.580323 |
import itertools
import tempfile
from argparse import Namespace
from collections import Counter
from pathlib import Path
import numpy as np
import pytest
from app import config
from tagifai import data, main, utils
@pytest.fixture(scope="module")
def tags():
tags_url = "https://raw.githubusercontent.com... | true | true |
1c2750e6e4011850f001f5ea6be6fa6d2acbd02d | 4,488 | py | Python | module/arguments.py | takoyaki1116/CGCNN2 | 5a12c19135e36ea8a642d452cfc0f8c8da5ee435 | [
"MIT"
] | null | null | null | module/arguments.py | takoyaki1116/CGCNN2 | 5a12c19135e36ea8a642d452cfc0f8c8da5ee435 | [
"MIT"
] | null | null | null | module/arguments.py | takoyaki1116/CGCNN2 | 5a12c19135e36ea8a642d452cfc0f8c8da5ee435 | [
"MIT"
] | null | null | null | import argparse
import sys
import torch
def arguments():
parser = argparse.ArgumentParser('CGCNN Combined Model Transfer Learning')
parser.add_argument('data_options', metavar='OPTIONS', nargs='+',
help='dataset options, started with the path to root dir, '
... | 61.479452 | 121 | 0.576426 | import argparse
import sys
import torch
def arguments():
parser = argparse.ArgumentParser('CGCNN Combined Model Transfer Learning')
parser.add_argument('data_options', metavar='OPTIONS', nargs='+',
help='dataset options, started with the path to root dir, '
... | true | true |
1c275195645d496d6151ada60a3623883830ca2a | 30 | py | Python | hangmanapp/__init__.py | kamyarg/hangman | 75788c359b32887301fa8a945dedbbc0e7c8bd23 | [
"MIT"
] | null | null | null | hangmanapp/__init__.py | kamyarg/hangman | 75788c359b32887301fa8a945dedbbc0e7c8bd23 | [
"MIT"
] | null | null | null | hangmanapp/__init__.py | kamyarg/hangman | 75788c359b32887301fa8a945dedbbc0e7c8bd23 | [
"MIT"
] | null | null | null |
from .views import MainRoute
| 10 | 28 | 0.8 |
from .views import MainRoute
| true | true |
1c2751ce9cd044cf70f8dfdf68d0c2f40179d756 | 428 | py | Python | elstruct/elstruct/reader/_nwchem6/__init__.py | sjklipp/autoio | e2b471e9c9dec933319c98a30d4d519ca5d47645 | [
"Apache-2.0"
] | null | null | null | elstruct/elstruct/reader/_nwchem6/__init__.py | sjklipp/autoio | e2b471e9c9dec933319c98a30d4d519ca5d47645 | [
"Apache-2.0"
] | 1 | 2022-02-15T19:35:14.000Z | 2022-02-15T19:35:14.000Z | elstruct/elstruct/reader/_nwchem6/__init__.py | sjklipp/autoio | e2b471e9c9dec933319c98a30d4d519ca5d47645 | [
"Apache-2.0"
] | 13 | 2020-06-24T05:21:11.000Z | 2021-05-05T19:58:30.000Z | """ nwchem6 output reading module """
from elstruct.reader._nwchem6.energ import energy
from elstruct.reader._nwchem6.surface import gradient
from elstruct.reader._nwchem6.molecule import opt_geometry
from elstruct.reader._nwchem6.version import program_name
from elstruct.reader._nwchem6.version import program_version
... | 26.75 | 60 | 0.778037 | from elstruct.reader._nwchem6.energ import energy
from elstruct.reader._nwchem6.surface import gradient
from elstruct.reader._nwchem6.molecule import opt_geometry
from elstruct.reader._nwchem6.version import program_name
from elstruct.reader._nwchem6.version import program_version
__all__ = [
'energy',
'gradi... | true | true |
1c2751dbe94e8cf781f4a7f8dbffbd99567e1755 | 442 | py | Python | image-analysis/one-offs/rename_7-9.py | sdrammis/Friedman-Hueske-2019 | 16a383aac7697bccc9b7bcb5b394b4961093bd5c | [
"MIT"
] | 1 | 2021-01-06T09:17:10.000Z | 2021-01-06T09:17:10.000Z | image-analysis/one-offs/rename_7-9.py | sdrammis/Friedman-Hueske-2020 | 16a383aac7697bccc9b7bcb5b394b4961093bd5c | [
"MIT"
] | 6 | 2021-01-28T20:32:31.000Z | 2022-03-25T18:58:51.000Z | image-analysis/one-offs/rename_7-9.py | sdrammis/Friedman-Hueske-2019 | 16a383aac7697bccc9b7bcb5b394b4961093bd5c | [
"MIT"
] | 2 | 2020-10-29T17:33:46.000Z | 2021-01-06T09:17:16.000Z | import os
d = "\\\\chunky.mit.edu\\analysis3\\strio_matrix_cv\\Alexander_Emily_Erik\\FINAL EXPORTED IMAGES\\experiment 9\\"
for ext in ['fitc', 'cy5', 'dapi']:
if ext == 'fitc':
new = 'MSN'
elif ext == 'cy5':
new = 'PV'
elif ext == 'dapi':
new = 'HDprot'
for filename in os.lis... | 29.466667 | 114 | 0.570136 | import os
d = "\\\\chunky.mit.edu\\analysis3\\strio_matrix_cv\\Alexander_Emily_Erik\\FINAL EXPORTED IMAGES\\experiment 9\\"
for ext in ['fitc', 'cy5', 'dapi']:
if ext == 'fitc':
new = 'MSN'
elif ext == 'cy5':
new = 'PV'
elif ext == 'dapi':
new = 'HDprot'
for filename in os.lis... | true | true |
1c275224229f891dd0097b5b72d17edeac275878 | 405 | py | Python | HealthcareCRUD/HealthcareCRUD/asgi.py | arjuns007/CapstoneCRUD_HealthcarePrescription | 7d604dc0aba9a1093c7ea73cbeacf9c2b090c432 | [
"MIT"
] | null | null | null | HealthcareCRUD/HealthcareCRUD/asgi.py | arjuns007/CapstoneCRUD_HealthcarePrescription | 7d604dc0aba9a1093c7ea73cbeacf9c2b090c432 | [
"MIT"
] | null | null | null | HealthcareCRUD/HealthcareCRUD/asgi.py | arjuns007/CapstoneCRUD_HealthcarePrescription | 7d604dc0aba9a1093c7ea73cbeacf9c2b090c432 | [
"MIT"
] | null | null | null | """
ASGI config for HealthcareCRUD project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANG... | 23.823529 | 78 | 0.792593 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'HealthcareCRUD.settings')
application = get_asgi_application()
| true | true |
1c275280d8bbf481a68a08a3458c9b130dbeac7e | 3,418 | py | Python | astropy/constants/__init__.py | vdye/astropy | 2865905fa520c540a025e34fd52ee5a3b28d75d9 | [
"BSD-3-Clause"
] | null | null | null | astropy/constants/__init__.py | vdye/astropy | 2865905fa520c540a025e34fd52ee5a3b28d75d9 | [
"BSD-3-Clause"
] | null | null | null | astropy/constants/__init__.py | vdye/astropy | 2865905fa520c540a025e34fd52ee5a3b28d75d9 | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Contains astronomical and physical constants for use in Astropy or other
places.
A typical use case might be::
>>> from astropy.constants import c, m_e
>>> # ... define the mass of something you want the rest energy of as m ...
>>> m = m_... | 31.357798 | 111 | 0.648917 |
import warnings
from contextlib import contextmanager
from astropy.utils import find_current_module
from astropy.utils.decorators import deprecated
from astropy import units
del units
from .constant import Constant, EMConstant
from . import si
from . import cgs
from .config import codata, iaudata
from . ... | true | true |
1c2752f70c6a6e9658d0d7317e7773c6ba49c664 | 175 | py | Python | fileinfo/logger.py | swilltec/fileinfo | 37f7d35c4c3d363a682a3c2336de9f6c813d9375 | [
"MIT"
] | null | null | null | fileinfo/logger.py | swilltec/fileinfo | 37f7d35c4c3d363a682a3c2336de9f6c813d9375 | [
"MIT"
] | null | null | null | fileinfo/logger.py | swilltec/fileinfo | 37f7d35c4c3d363a682a3c2336de9f6c813d9375 | [
"MIT"
] | 1 | 2020-08-09T22:41:22.000Z | 2020-08-09T22:41:22.000Z | import datetime
class Logger:
def __init__(self):
self.messages = []
def log(self, message):
self.messages.append((datetime.datetime.now(), message)) | 21.875 | 64 | 0.645714 | import datetime
class Logger:
def __init__(self):
self.messages = []
def log(self, message):
self.messages.append((datetime.datetime.now(), message)) | true | true |
1c27538db8cc94b5a38623d0f4a3474414a024fd | 3,915 | py | Python | nano/hooks.py | erpcloudsystems/nano | c1656fba12e459a889157eabb72aeb2b739a7633 | [
"MIT"
] | null | null | null | nano/hooks.py | erpcloudsystems/nano | c1656fba12e459a889157eabb72aeb2b739a7633 | [
"MIT"
] | null | null | null | nano/hooks.py | erpcloudsystems/nano | c1656fba12e459a889157eabb72aeb2b739a7633 | [
"MIT"
] | null | null | null | from . import __version__ as app_version
app_name = "nano"
app_title = "Nano"
app_publisher = "ERP Cloud Systems"
app_description = "Custom App For Nano"
app_icon = "octicon octicon-file-directory"
app_color = "grey"
app_email = "mg@erpcloud.systems"
app_license = "MIT"
scheduler_events = {
"all": [
"nano.function... | 21.510989 | 78 | 0.649808 | from . import __version__ as app_version
app_name = "nano"
app_title = "Nano"
app_publisher = "ERP Cloud Systems"
app_description = "Custom App For Nano"
app_icon = "octicon octicon-file-directory"
app_color = "grey"
app_email = "mg@erpcloud.systems"
app_license = "MIT"
scheduler_events = {
"all": [
"nano.function... | true | true |
1c27543091b9f7103c417ec4582adae9e720deac | 628 | py | Python | Standard Library/unittesting/Testing_Demo/300 robot.py | shubhamnag14/Python-Documents | d3fee0ad90232b413f6ac1b562588fb255b79e42 | [
"Apache-2.0"
] | 2 | 2020-11-27T13:21:05.000Z | 2021-04-19T21:14:21.000Z | Standard Library/unittesting/Testing_Demo/300 robot.py | shubhamnag14/Python-Documents | d3fee0ad90232b413f6ac1b562588fb255b79e42 | [
"Apache-2.0"
] | null | null | null | Standard Library/unittesting/Testing_Demo/300 robot.py | shubhamnag14/Python-Documents | d3fee0ad90232b413f6ac1b562588fb255b79e42 | [
"Apache-2.0"
] | 1 | 2021-06-27T20:31:42.000Z | 2021-06-27T20:31:42.000Z | class Robot:
def __init__(self, name, battery=100, skills=[]):
self.name = name
self.battery = battery
self.skills = skills
def charge(self):
self.battery = 100
return self
def say_name(self):
if self.battery > 0:
self.battery -= 1
return f"BEEP BOOP BEEP BOOP. I AM {self.name.upper()}"
return... | 24.153846 | 60 | 0.697452 | class Robot:
def __init__(self, name, battery=100, skills=[]):
self.name = name
self.battery = battery
self.skills = skills
def charge(self):
self.battery = 100
return self
def say_name(self):
if self.battery > 0:
self.battery -= 1
return f"BEEP BOOP BEEP BOOP. I AM {self.name.upper()}"
return... | true | true |
1c2754877a0d22a7650b5b118a971f20f3bd3b25 | 7,664 | py | Python | models/rank/fgcnn/model.py | michaelwang123/PaddleRec | 4feb0a7f962e918bdfa4f7289a9ddfd08d459824 | [
"Apache-2.0"
] | 3 | 2020-09-22T02:46:30.000Z | 2021-06-17T06:43:37.000Z | models/rank/fgcnn/model.py | hzj1558718/PaddleRec | 927e363e42ab55dd2961b0fbbb23c2578d289105 | [
"Apache-2.0"
] | null | null | null | models/rank/fgcnn/model.py | hzj1558718/PaddleRec | 927e363e42ab55dd2961b0fbbb23c2578d289105 | [
"Apache-2.0"
] | 1 | 2021-01-11T06:31:36.000Z | 2021-01-11T06:31:36.000Z | # 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 app... | 43.545455 | 81 | 0.564718 |
import math
from collections import OrderedDict
import paddle.fluid as fluid
from paddlerec.core.utils import envs
from paddlerec.core.model import ModelBase
class Model(ModelBase):
def __init__(self, config):
ModelBase.__init__(self, config)
def _init_hyper_parameters(self):
... | true | true |
1c27557a29888c037664acdff233705c431752e4 | 70,582 | py | Python | python/quadruped_reactive_walking/Planner.py | nim65s/quadruped-reactive-walking | 1e0f4069fd11af85abf10bfc8f9d66200c672646 | [
"BSD-2-Clause"
] | 6 | 2021-03-03T10:59:19.000Z | 2022-03-13T15:05:25.000Z | python/quadruped_reactive_walking/Planner.py | nim65s/quadruped-reactive-walking | 1e0f4069fd11af85abf10bfc8f9d66200c672646 | [
"BSD-2-Clause"
] | null | null | null | python/quadruped_reactive_walking/Planner.py | nim65s/quadruped-reactive-walking | 1e0f4069fd11af85abf10bfc8f9d66200c672646 | [
"BSD-2-Clause"
] | 2 | 2021-05-17T13:34:29.000Z | 2022-03-03T10:58:37.000Z | # coding: utf8
import Joystick
#from matplotlib import pyplot as plt
import time
import numpy as np
import math
import pinocchio as pin
import tsid
import utils_mpc
import FootTrajectoryGenerator as ftg
import libquadruped_reactive_walking as la
np.set_printoptions(precision=3, linewidth=300)
class PyPlanner:
"""... | 40.798844 | 192 | 0.547009 |
import Joystick
import time
import numpy as np
import math
import pinocchio as pin
import tsid
import utils_mpc
import FootTrajectoryGenerator as ftg
import libquadruped_reactive_walking as la
np.set_printoptions(precision=3, linewidth=300)
class PyPlanner:
def __init__(self, dt, dt_tsid, T_gait, T_mpc, k_mpc,... | true | true |
1c27560b41a728e77918146bba6282cf939a6677 | 1,122 | py | Python | python/test/test_close_transaction.py | KoenBal/OANDA_V20_Client | e67b9dbaddff6ed23e355d3ce7f9c9972799c702 | [
"MIT"
] | 1 | 2018-10-25T03:57:32.000Z | 2018-10-25T03:57:32.000Z | python/test/test_close_transaction.py | KoenBal/OANDA_V20_Client | e67b9dbaddff6ed23e355d3ce7f9c9972799c702 | [
"MIT"
] | null | null | null | python/test/test_close_transaction.py | KoenBal/OANDA_V20_Client | e67b9dbaddff6ed23e355d3ce7f9c9972799c702 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
OANDA v20 REST API
The full OANDA v20 REST API Specification. This specification defines how to interact with v20 Accounts, Trades, Orders, Pricing and more. To authenticate use the string 'Bearer ' followed by the token which can be obtained at https://www.oanda.com/demo-account/tpa/perso... | 27.365854 | 298 | 0.720143 |
from __future__ import absolute_import
import unittest
import oanda
from oanda.models.close_transaction import CloseTransaction
from oanda.rest import ApiException
class TestCloseTransaction(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def testCloseTransact... | true | true |
1c2756d14c78c4cd49c57cefade40b0ede98d1a1 | 2,617 | py | Python | tests/asgi/snapshots/snap_test_query_execution.py | solocompt/ariadne | 7a508a7eb64edb0f3992c9ff919066989e9f29f2 | [
"BSD-3-Clause"
] | null | null | null | tests/asgi/snapshots/snap_test_query_execution.py | solocompt/ariadne | 7a508a7eb64edb0f3992c9ff919066989e9f29f2 | [
"BSD-3-Clause"
] | 1 | 2019-07-04T07:47:40.000Z | 2019-07-04T07:47:40.000Z | tests/asgi/snapshots/snap_test_query_execution.py | deep-compute/ariadne | e9df95f41f1fa21325165cd63c78d87686532db1 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# snapshottest: v1 - https://goo.gl/zC4yUc
from __future__ import unicode_literals
from snapshottest import Snapshot
snapshots = Snapshot()
snapshots['test_query_is_executed_for_post_json_request 1'] = {
'data': {
'status': True
}
}
snapshots['test_complex_query_is_executed_... | 23.576577 | 99 | 0.568972 |
from __future__ import unicode_literals
from snapshottest import Snapshot
snapshots = Snapshot()
snapshots['test_query_is_executed_for_post_json_request 1'] = {
'data': {
'status': True
}
}
snapshots['test_complex_query_is_executed_for_post_json_request 1'] = {
'data': {
'hello': 'Hel... | true | true |
1c27570abe67c4771783c66e3b1289805d0fed70 | 271 | py | Python | blog/views/home.py | feynubrick/blog-django | e7beb458f5ad913649c0455ffb4d536f5a3cf1a6 | [
"MIT"
] | null | null | null | blog/views/home.py | feynubrick/blog-django | e7beb458f5ad913649c0455ffb4d536f5a3cf1a6 | [
"MIT"
] | null | null | null | blog/views/home.py | feynubrick/blog-django | e7beb458f5ad913649c0455ffb4d536f5a3cf1a6 | [
"MIT"
] | null | null | null | from django.http import HttpResponse, HttpRequest
from django.template import loader
def get_home_page(request: HttpRequest) -> HttpResponse:
template = loader.get_template('blog/home.html')
context = {}
return HttpResponse(template.render(context, request)) | 38.714286 | 58 | 0.774908 | from django.http import HttpResponse, HttpRequest
from django.template import loader
def get_home_page(request: HttpRequest) -> HttpResponse:
template = loader.get_template('blog/home.html')
context = {}
return HttpResponse(template.render(context, request)) | true | true |
1c275770788ae605d0220738d9d8587fcab00c2b | 4,459 | py | Python | proxyclient/tools/dump_pmgr.py | leeehui/m1n1 | c947f6aec39c2248b0ff8e2165fa1196a0b54712 | [
"MIT"
] | null | null | null | proxyclient/tools/dump_pmgr.py | leeehui/m1n1 | c947f6aec39c2248b0ff8e2165fa1196a0b54712 | [
"MIT"
] | null | null | null | proxyclient/tools/dump_pmgr.py | leeehui/m1n1 | c947f6aec39c2248b0ff8e2165fa1196a0b54712 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# SPDX-License-Identifier: MIT
import sys, pathlib
sys.path.append(str(pathlib.Path(__file__).resolve().parents[1]))
from m1n1 import adt
from m1n1.setup import *
dt = u.adt
pmgr = dt["/arm-io/pmgr"]
dev_by_id = {dev.id: dev for dev in pmgr.devices}
pd_by_id = {pd.id: pd for pd in pmgr.power_... | 34.565891 | 133 | 0.567168 |
import sys, pathlib
sys.path.append(str(pathlib.Path(__file__).resolve().parents[1]))
from m1n1 import adt
from m1n1.setup import *
dt = u.adt
pmgr = dt["/arm-io/pmgr"]
dev_by_id = {dev.id: dev for dev in pmgr.devices}
pd_by_id = {pd.id: pd for pd in pmgr.power_domains}
clk_by_id = {clk.id: clk for clk in pmgr.cl... | true | true |
1c27582b153d80f2a8d271b14eebf415bca6525d | 1,186 | py | Python | isi_sdk_8_1_1/test/test_summary_protocol_stats_protocol_stats_protocol_data_item.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_8_1_1/test/test_summary_protocol_stats_protocol_stats_protocol_data_item.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_8_1_1/test/test_summary_protocol_stats_protocol_stats_protocol_data_item.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 6
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import isi_sdk_8_1_1
from i... | 28.926829 | 161 | 0.775717 |
from __future__ import absolute_import
import unittest
import isi_sdk_8_1_1
from isi_sdk_8_1_1.models.summary_protocol_stats_protocol_stats_protocol_data_item import SummaryProtocolStatsProtocolStatsProtocolDataItem
from isi_sdk_8_1_1.rest import ApiException
class TestSummaryProtocolStatsProtocolStatsProtoco... | true | true |
1c2758aa2922e9c69c2c244b10a6bbb10ddbce32 | 3,762 | py | Python | acrylamid/hooks.py | farleykr/acrylamid | c6c0f60b594d2920f6387ba82b552093d7c5fe1b | [
"BSD-2-Clause-FreeBSD"
] | 61 | 2015-01-15T23:23:11.000Z | 2022-03-24T16:39:31.000Z | acrylamid/hooks.py | farleykr/acrylamid | c6c0f60b594d2920f6387ba82b552093d7c5fe1b | [
"BSD-2-Clause-FreeBSD"
] | 28 | 2015-01-26T22:32:24.000Z | 2022-01-13T01:11:56.000Z | acrylamid/hooks.py | farleykr/acrylamid | c6c0f60b594d2920f6387ba82b552093d7c5fe1b | [
"BSD-2-Clause-FreeBSD"
] | 25 | 2015-01-22T19:26:29.000Z | 2021-06-30T21:53:06.000Z | # -*- encoding: utf-8 -*-
#
# Copyright 2013 Martin Zimmermann <info@posativ.org>. All rights reserved.
# License: BSD Style, 2 clauses -- see LICENSE.
import os
import io
import re
import types
import shutil
import multiprocessing
from os.path import isfile, getmtime, isdir, dirname
from tempfile import mkstemp
from... | 26.871429 | 85 | 0.641414 |
import os
import io
import re
import types
import shutil
import multiprocessing
from os.path import isfile, getmtime, isdir, dirname
from tempfile import mkstemp
from functools import partial
from acrylamid import log
from acrylamid.errors import AcrylamidException
from acrylamid.compat import string_types, iter... | true | true |
1c2758e91fe106c0c2e9273a06425e9814aaa555 | 5,875 | py | Python | meetenjoy/executor.py | vladlytvynenko/mj | 0186440b52d7d9655a4d75d76faf67638de880a8 | [
"MIT"
] | null | null | null | meetenjoy/executor.py | vladlytvynenko/mj | 0186440b52d7d9655a4d75d76faf67638de880a8 | [
"MIT"
] | null | null | null | meetenjoy/executor.py | vladlytvynenko/mj | 0186440b52d7d9655a4d75d76faf67638de880a8 | [
"MIT"
] | null | null | null | import argparse
import json
import sys
from pprint import PrettyPrinter
from typing import List
from .browser import Browser
from .config import CONFIG_PATH
from .custom_logger import logger
from .services import RoomService, AliasService
class Executor:
def __init__(self, commands=None):
self.commands ... | 37.183544 | 105 | 0.644426 | import argparse
import json
import sys
from pprint import PrettyPrinter
from typing import List
from .browser import Browser
from .config import CONFIG_PATH
from .custom_logger import logger
from .services import RoomService, AliasService
class Executor:
def __init__(self, commands=None):
self.commands ... | true | true |
1c2758f82e464950fcc6b110c59a4a51de384ed9 | 15,354 | py | Python | notebooks/denerator_tests/actions/actions.py | Collen-Roller/Rasa-Denerator | 728d21d93f21a18c9de7be303ceae59392de9a41 | [
"MIT"
] | 11 | 2019-09-11T13:48:53.000Z | 2021-11-26T00:48:57.000Z | notebooks/denerator_tests/actions/actions.py | Collen-Roller/Rasa-Denerator | 728d21d93f21a18c9de7be303ceae59392de9a41 | [
"MIT"
] | 2 | 2019-10-18T17:21:54.000Z | 2021-10-08T06:45:11.000Z | notebooks/denerator_tests/actions/actions.py | Collen-Roller/Rasa-Denerator | 728d21d93f21a18c9de7be303ceae59392de9a41 | [
"MIT"
] | 4 | 2019-10-04T14:43:06.000Z | 2021-06-16T21:23:23.000Z | # -*- coding: utf-8 -*-
import logging
from datetime import datetime
from typing import Text, Dict, Any, List
import json
from rasa_sdk import Action, Tracker
from rasa_sdk.executor import CollectingDispatcher
from rasa_sdk.forms import FormAction
from rasa_sdk.events import SlotSet, UserUtteranceReverted, Conversatio... | 31.78882 | 88 | 0.606096 |
import logging
from datetime import datetime
from typing import Text, Dict, Any, List
import json
from rasa_sdk import Action, Tracker
from rasa_sdk.executor import CollectingDispatcher
from rasa_sdk.forms import FormAction
from rasa_sdk.events import SlotSet, UserUtteranceReverted, ConversationPaused
import config
... | true | true |
1c2758f97791d4dd0965a9b51e26edc373c94e8f | 3,551 | py | Python | var/spack/repos/builtin/packages/siesta/package.py | padamson/spack | d3f67a48552691b4846ccc4a10f76740b154090c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2018-11-16T02:42:57.000Z | 2019-06-06T19:18:50.000Z | var/spack/repos/builtin/packages/siesta/package.py | padamson/spack | d3f67a48552691b4846ccc4a10f76740b154090c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 32 | 2020-12-15T17:29:20.000Z | 2022-03-21T15:08:31.000Z | var/spack/repos/builtin/packages/siesta/package.py | padamson/spack | d3f67a48552691b4846ccc4a10f76740b154090c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2021-07-19T20:31:27.000Z | 2021-07-19T21:14:14.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
from spack import *
class Siesta(Package):
"""SIESTA performs electronic structure calculations and ab i... | 41.290698 | 181 | 0.537032 |
import os
from spack import *
class Siesta(Package):
homepage = "https://departments.icmab.es/leem/siesta/"
version('4.0.1', sha256='bfb9e4335ae1d1639a749ce7e679e739fdead5ee5766b5356ea1d259a6b1e6d1', url='https://launchpad.net/siesta/4.0/4.0.1/+download/siesta-4.0.1.tar.gz')
version('3.2-pl-5', s... | true | true |
1c27591eab65b6a147b7f5c95f88c7e88728c275 | 2,680 | py | Python | tests/query_test.py | jmgilman/bdantic | 3caa66d681da7a0cf0dbd6481c3f9005a8f2d8b9 | [
"MIT"
] | 3 | 2022-02-02T19:38:59.000Z | 2022-02-16T03:39:50.000Z | tests/query_test.py | jmgilman/bdantic | 3caa66d681da7a0cf0dbd6481c3f9005a8f2d8b9 | [
"MIT"
] | null | null | null | tests/query_test.py | jmgilman/bdantic | 3caa66d681da7a0cf0dbd6481c3f9005a8f2d8b9 | [
"MIT"
] | null | null | null | import string
from copy import copy
from typing import Any, Dict, List, Tuple, Type
import beancount_hypothesis as h
from beancount.core import amount, data
from beancount.query import query as bquery
from conftest import Ctx
from hypothesis import given
from hypothesis import strategies as s
from bdantic.models impo... | 24.144144 | 79 | 0.531716 | import string
from copy import copy
from typing import Any, Dict, List, Tuple, Type
import beancount_hypothesis as h
from beancount.core import amount, data
from beancount.query import query as bquery
from conftest import Ctx
from hypothesis import given
from hypothesis import strategies as s
from bdantic.models impo... | true | true |
1c2759a52e9866242861f5e52e5ee7b5361d64a3 | 3,006 | py | Python | run_mypy.py | Jairard/meson | bda11fe25d1efe688d251148cb7cf7939cd50433 | [
"Apache-2.0"
] | 1 | 2022-01-31T01:49:10.000Z | 2022-01-31T01:49:10.000Z | run_mypy.py | Jairard/meson | bda11fe25d1efe688d251148cb7cf7939cd50433 | [
"Apache-2.0"
] | null | null | null | run_mypy.py | Jairard/meson | bda11fe25d1efe688d251148cb7cf7939cd50433 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
from pathlib import Path
import argparse
import os
import subprocess
import sys
import typing as T
from mesonbuild.mesonlib import version_compare
modules = [
# fully typed submodules
# 'mesonbuild/ast',
'mesonbuild/cmake',
'mesonbuild/compilers',
'mesonbuild/dependencies',... | 27.833333 | 108 | 0.665669 |
from pathlib import Path
import argparse
import os
import subprocess
import sys
import typing as T
from mesonbuild.mesonlib import version_compare
modules = [
'mesonbuild/cmake',
'mesonbuild/compilers',
'mesonbuild/dependencies',
'mesonbuild/interpreter/primitives',
'mesonbuild/interpr... | true | true |
1c2759c508e88457e4d36c8f97a704bc82811000 | 3,601 | py | Python | plugins/broadcast.py | kristy-offl/URL-With-BROADCAST | 33b6db252ec9c7d1e69d8386d5fbed10c785776b | [
"MIT"
] | null | null | null | plugins/broadcast.py | kristy-offl/URL-With-BROADCAST | 33b6db252ec9c7d1e69d8386d5fbed10c785776b | [
"MIT"
] | null | null | null | plugins/broadcast.py | kristy-offl/URL-With-BROADCAST | 33b6db252ec9c7d1e69d8386d5fbed10c785776b | [
"MIT"
] | 2 | 2021-10-05T12:10:57.000Z | 2021-11-02T04:46:37.000Z | import time
import string
import random
import asyncio
import datetime
import aiofiles.os
import traceback
from sample_config import Config
from database.access_db import db
from pyrogram import Client as MeG
from pyrogram import filters
from pyrogram.types import Message
from pyrogram.errors import FloodWait, InputUse... | 34.295238 | 152 | 0.618162 | import time
import string
import random
import asyncio
import datetime
import aiofiles.os
import traceback
from sample_config import Config
from database.access_db import db
from pyrogram import Client as MeG
from pyrogram import filters
from pyrogram.types import Message
from pyrogram.errors import FloodWait, InputUse... | true | true |
1c275a8220872310a9d8055ba245f28a022daa52 | 231 | py | Python | time program 2.py | fdagreat/ericPythoneCodes | a80348160db7a9bb388ec4c0c933bd488689db56 | [
"MIT"
] | null | null | null | time program 2.py | fdagreat/ericPythoneCodes | a80348160db7a9bb388ec4c0c933bd488689db56 | [
"MIT"
] | null | null | null | time program 2.py | fdagreat/ericPythoneCodes | a80348160db7a9bb388ec4c0c933bd488689db56 | [
"MIT"
] | null | null | null | total_seconds=int(input("Enter number of seconds"))
hours=int(total_seconds//3600)
minutes=int((total_seconds%3600)//60)
seconds=int((total_seconds%3600)%60)
print("Hours:",hours,",","Minutes:",minutes,",","Seconds:",seconds)
| 38.5 | 68 | 0.722944 | total_seconds=int(input("Enter number of seconds"))
hours=int(total_seconds//3600)
minutes=int((total_seconds%3600)//60)
seconds=int((total_seconds%3600)%60)
print("Hours:",hours,",","Minutes:",minutes,",","Seconds:",seconds)
| true | true |
1c275aeed36a97be576046d76fae64a69100ddeb | 1,997 | py | Python | gnttb-cli.py | a2ohm/gnttb-cli | ecfdd6d0e4c7fe9efdfafc071f941c463f9fe0c1 | [
"MIT"
] | null | null | null | gnttb-cli.py | a2ohm/gnttb-cli | ecfdd6d0e4c7fe9efdfafc071f941c463f9fe0c1 | [
"MIT"
] | null | null | null | gnttb-cli.py | a2ohm/gnttb-cli | ecfdd6d0e4c7fe9efdfafc071f941c463f9fe0c1 | [
"MIT"
] | null | null | null | #! /usr/bin/python3
# -*- coding:utf-8 -*-
import argparse
import sys
from sub.compare import compare
from sub.get import get
from sub.search import search
# Check the gnttb version
import gnttb
gnttb_neededVersion = '1.2'
if gnttb.__version__ < gnttb_neededVersion:
print("You are using version {} of gnttb, but... | 39.156863 | 140 | 0.757136 |
import argparse
import sys
from sub.compare import compare
from sub.get import get
from sub.search import search
import gnttb
gnttb_neededVersion = '1.2'
if gnttb.__version__ < gnttb_neededVersion:
print("You are using version {} of gnttb, but at least version {} is needed.".format(gnttb.__version__, gnttb_n... | true | true |
1c275ba8dcd225a588179bf6692909da3efd5144 | 3,196 | py | Python | beast/plotting/plot_cmd.py | cmurray-astro/beast | cbbf6a663126367632c065ae63b341bea325e2ea | [
"BSD-3-Clause"
] | null | null | null | beast/plotting/plot_cmd.py | cmurray-astro/beast | cbbf6a663126367632c065ae63b341bea325e2ea | [
"BSD-3-Clause"
] | 1 | 2020-06-25T16:26:02.000Z | 2020-06-25T16:26:02.000Z | beast/plotting/plot_cmd.py | cmurray-astro/beast | cbbf6a663126367632c065ae63b341bea325e2ea | [
"BSD-3-Clause"
] | null | null | null | # plot_cmd.py
# Plots a generic CMD from real or simulated BEAST fitting data
# Petia YMJ
# Created 9/13/18
# Updated 10/05/18
import numpy as np
import matplotlib.pyplot as plt
from astropy.io import fits
from functools import reduce
from beast.plotting.beastplotlib import initialize_parser
__all__ = ["plot_cmd"]
... | 25.568 | 83 | 0.610138 |
import numpy as np
import matplotlib.pyplot as plt
from astropy.io import fits
from functools import reduce
from beast.plotting.beastplotlib import initialize_parser
__all__ = ["plot_cmd"]
def plot_cmd(
fitsfile,
mag1_filter="F475W",
mag2_filter="F814W",
mag3_filter="F475W",
show_plot=True... | true | true |
1c275c93e69b69842692e81b880eefc41e4d6315 | 4,000 | py | Python | 6.00.1x-pset3.py | thiagork/MIT-6.00.1x | 173397907dea61d3f0f1634fee41551f326d207f | [
"MIT"
] | null | null | null | 6.00.1x-pset3.py | thiagork/MIT-6.00.1x | 173397907dea61d3f0f1634fee41551f326d207f | [
"MIT"
] | null | null | null | 6.00.1x-pset3.py | thiagork/MIT-6.00.1x | 173397907dea61d3f0f1634fee41551f326d207f | [
"MIT"
] | null | null | null | # MIT 6.00.1x
# Problem Set 3
# Hangman Game
import random
import string
WORDLIST_FILENAME = "words.txt"
def loadWords():
"""
Returns a list of valid words. Words are strings of lowercase letters.
"""
print("Loading word list from file...")
# inFile: file
inFile = open(WORDLIST_FILENAME, 'r'... | 31.007752 | 79 | 0.63775 |
import random
import string
WORDLIST_FILENAME = "words.txt"
def loadWords():
print("Loading word list from file...")
inFile = open(WORDLIST_FILENAME, 'r')
line = inFile.readline()
wordlist = line.split()
print(" ", len(wordlist), "words loaded.")
return wordlist
def choo... | true | true |
1c275e36e1454f80bc2f1ca9aaac8aee793848e3 | 1,709 | py | Python | data/p2DJ/New/R2/benchmark/startCirq136.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p2DJ/New/R2/benchmark/startCirq136.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p2DJ/New/R2/benchmark/startCirq136.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 5/15/20 4:49 PM
# @File : grover.py
# qubit number=2
# total number=9
import cirq
import cirq.google as cg
from typing import Optional
import sys
from math import log2
import numpy as np
#thatsNoCode
from cirq.contrib.svg import SVGCircuit
# Symbols for ... | 27.126984 | 77 | 0.690462 |
import cirq
import cirq.google as cg
from typing import Optional
import sys
from math import log2
import numpy as np
from cirq.contrib.svg import SVGCircuit
def make_circuit(n: int, input_qubit):
c = cirq.Circuit()
c.append(cirq.H.on(input_qubit[0]))
c.append(cirq.H.on(input_qubit[1]))
... | true | true |
1c275e422e7e0952952f8cc94e71bddba2041351 | 459 | py | Python | pong/main.py | zachpanz88/gset-kinect | e651d5c4e0be87aecd8c8e1a6aa07a59ca50d6ed | [
"MIT"
] | 1 | 2020-02-20T06:44:18.000Z | 2020-02-20T06:44:18.000Z | pong/main.py | zachpanz88/gset-kinect | e651d5c4e0be87aecd8c8e1a6aa07a59ca50d6ed | [
"MIT"
] | null | null | null | pong/main.py | zachpanz88/gset-kinect | e651d5c4e0be87aecd8c8e1a6aa07a59ca50d6ed | [
"MIT"
] | null | null | null | from controller import Controller
from core.game import Game
from core.color import *
import pygame
from time import sleep
def run():
game = Game("Pong")
game.start()
# create and start the controller
controller = Controller(game)
controller.start()
# keep looping the game
while True:
# tell the controll... | 15.827586 | 45 | 0.712418 | from controller import Controller
from core.game import Game
from core.color import *
import pygame
from time import sleep
def run():
game = Game("Pong")
game.start()
controller = Controller(game)
controller.start()
while True:
controller.go()
game.delay(.016)
if __name__ == "__main__":
r... | true | true |
1c275fd55ff9197b1af25f5ce1a6bdc47fc68b18 | 2,495 | py | Python | pysmapi/interfaces/Image_Recycle.py | lllucius/pysmapi | c0d802edb58e835e4d48cb9c28ccfccfe5b5c686 | [
"Apache-2.0"
] | null | null | null | pysmapi/interfaces/Image_Recycle.py | lllucius/pysmapi | c0d802edb58e835e4d48cb9c28ccfccfe5b5c686 | [
"Apache-2.0"
] | null | null | null | pysmapi/interfaces/Image_Recycle.py | lllucius/pysmapi | c0d802edb58e835e4d48cb9c28ccfccfe5b5c686 | [
"Apache-2.0"
] | null | null | null |
# Copyright 2018-2019 Leland Lucius
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:#www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | 27.417582 | 76 | 0.60481 |
smapi import *
class Image_Recycle(Request):
def __init__(self,
**kwargs):
super(Image_Recycle, self).__init__(**kwargs)
self._recycled = 0
self._not_recycled = 0
self._failing_array = []
@property
def recycled(self):
return self._r... | true | true |
1c27607c15abb9bba74428a650c5c3f96aa6577a | 13,505 | py | Python | tests/test_sqs.py | ktravis/cloud-custodian | d5f61d8a09f8a37a85777b527ee87c363040fbd1 | [
"Apache-2.0"
] | null | null | null | tests/test_sqs.py | ktravis/cloud-custodian | d5f61d8a09f8a37a85777b527ee87c363040fbd1 | [
"Apache-2.0"
] | null | null | null | tests/test_sqs.py | ktravis/cloud-custodian | d5f61d8a09f8a37a85777b527ee87c363040fbd1 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Capital One Services, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 36.303763 | 98 | 0.544761 |
from __future__ import absolute_import, division, print_function, unicode_literals
from .common import BaseTest, functional
from botocore.exceptions import ClientError
import json
import time
class TestSqsAction(BaseTest):
@functional
def test_sqs_delete(self):
session_factory = self.r... | true | true |
1c2761030f6cf318f47d36c265928662ead6c429 | 65,399 | py | Python | tests/test_poster.py | rbellary-vi/netuitive-statsd | bd2c1fd6a05476d432e8a584708d2bcb09350553 | [
"Apache-2.0"
] | null | null | null | tests/test_poster.py | rbellary-vi/netuitive-statsd | bd2c1fd6a05476d432e8a584708d2bcb09350553 | [
"Apache-2.0"
] | 32 | 2016-05-09T13:05:13.000Z | 2021-02-09T12:44:47.000Z | tests/test_poster.py | rbellary-vi/netuitive-statsd | bd2c1fd6a05476d432e8a584708d2bcb09350553 | [
"Apache-2.0"
] | 2 | 2018-10-19T03:34:17.000Z | 2021-02-08T11:24:04.000Z | #!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
"""
test_netuitive
----------------------------------
Tests for `netuitivestatsd` module.
"""
import unittest
import mock
import json
import logging
import threading
import libs
logging.basicConfig()
logging.disable(logging.ERROR)
logger = logging.getLogger(__name__... | 48.515579 | 269 | 0.319103 |
import unittest
import mock
import json
import logging
import threading
import libs
logging.basicConfig()
logging.disable(logging.ERROR)
logger = logging.getLogger(__name__)
class MockResponse(object):
def __init__(self,
resp_data='',
headers={'content-type': 'text/plain; ... | true | true |
1c2761cba6bee22880d5b3c47e133d9d1eb2e1c6 | 9,848 | py | Python | datasets/datasets.py | Xiaziheng89/Spatial-Location-Constraint-Prototype-Loss-for-Open-Set-Recognition | 47ebf4b844bc2b0ba98761bd47a0bb4b7963e174 | [
"MIT"
] | 5 | 2021-11-09T09:12:19.000Z | 2021-12-11T12:34:30.000Z | datasets/datasets.py | Xiaziheng89/Spatial-Location-Constraint-Prototype-Loss-for-Open-Set-Recognition | 47ebf4b844bc2b0ba98761bd47a0bb4b7963e174 | [
"MIT"
] | 2 | 2021-12-10T13:12:26.000Z | 2022-01-10T10:10:23.000Z | datasets/datasets.py | Xiaziheng89/Adversarial-Motorial-Prototype-Framework-for-Open-Set-Recognition | 022b7e5a81360a8b448072999ecf2988b34055cc | [
"MIT"
] | null | null | null | import os
import torch
import torchvision
from torch.utils.data import DataLoader
import torchvision.transforms as transforms
from torchvision.datasets import MNIST, KMNIST
from PIL import Image
class MNISTRGB(MNIST):
"""MNIST Dataset.
"""
def __getitem__(self, index):
img, target = self.data[inde... | 33.958621 | 123 | 0.6316 | import os
import torch
import torchvision
from torch.utils.data import DataLoader
import torchvision.transforms as transforms
from torchvision.datasets import MNIST, KMNIST
from PIL import Image
class MNISTRGB(MNIST):
def __getitem__(self, index):
img, target = self.data[index], int(self.targets[index])
... | true | true |
1c2761cff4485263b19ecde21c8a226c5cdbfee4 | 2,823 | py | Python | src/openpersonen/api/data_classes/ingeschreven_personen.py | maykinmedia/open-personen | ddcf083ccd4eb864c5305bcd8bc75c6c64108272 | [
"RSA-MD"
] | 2 | 2020-08-26T11:24:43.000Z | 2021-07-28T09:46:40.000Z | src/openpersonen/api/data_classes/ingeschreven_personen.py | maykinmedia/open-personen | ddcf083ccd4eb864c5305bcd8bc75c6c64108272 | [
"RSA-MD"
] | 153 | 2020-08-26T10:45:35.000Z | 2021-12-10T17:33:16.000Z | src/openpersonen/api/data_classes/ingeschreven_personen.py | maykinmedia/open-personen | ddcf083ccd4eb864c5305bcd8bc75c6c64108272 | [
"RSA-MD"
] | null | null | null | from dataclasses import dataclass
from typing import List, Optional
from openpersonen.api.enum import GeslachtsaanduidingChoices
from openpersonen.backends import backend
from .datum import Datum
from .gezags_verhouding import GezagsVerhouding
from .in_onderzoek import IngeschrevenPersoonInOnderzoek
from .kiesrecht i... | 34.851852 | 118 | 0.752745 | from dataclasses import dataclass
from typing import List, Optional
from openpersonen.api.enum import GeslachtsaanduidingChoices
from openpersonen.backends import backend
from .datum import Datum
from .gezags_verhouding import GezagsVerhouding
from .in_onderzoek import IngeschrevenPersoonInOnderzoek
from .kiesrecht i... | true | true |
1c2762bbacccc0ff7921c922c12c3ce6fc55df7d | 22,166 | py | Python | baseline.py | aitoralmeida/hatepic_baseline | af3c70c220e4d576b503d99b23a544dbfb74cf3a | [
"Apache-2.0"
] | 1 | 2018-10-03T14:08:06.000Z | 2018-10-03T14:08:06.000Z | baseline.py | aitoralmeida/hatepic_baseline | af3c70c220e4d576b503d99b23a544dbfb74cf3a | [
"Apache-2.0"
] | null | null | null | baseline.py | aitoralmeida/hatepic_baseline | af3c70c220e4d576b503d99b23a544dbfb74cf3a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Oct 2 10:06:05 2018
@author: aitor
"""
from random import shuffle
import sys
import os
import keras.applications.inception_resnet_v2 as inceptionresnetv2
import keras.applications.inception_v3 as inceptionv3
import keras.applications.mobilenet as mobilenet
import keras.app... | 33.332331 | 105 | 0.59298 |
"""
Created on Tue Oct 2 10:06:05 2018
@author: aitor
"""
from random import shuffle
import sys
import os
import keras.applications.inception_resnet_v2 as inceptionresnetv2
import keras.applications.inception_v3 as inceptionv3
import keras.applications.mobilenet as mobilenet
import keras.applications.resnet50 as r... | false | true |
1c2763925d5b4148df0e07f08ab4064f57c599f5 | 1,562 | py | Python | app/core/tests/test_admin.py | mnislam01/recipe-app-api | f1ae91b4bb1cdd17effe10df3910fcf82c08352b | [
"MIT"
] | 1 | 2020-07-28T10:35:42.000Z | 2020-07-28T10:35:42.000Z | app/core/tests/test_admin.py | mnislam01/recipe-app-api | f1ae91b4bb1cdd17effe10df3910fcf82c08352b | [
"MIT"
] | null | null | null | app/core/tests/test_admin.py | mnislam01/recipe-app-api | f1ae91b4bb1cdd17effe10df3910fcf82c08352b | [
"MIT"
] | null | null | null | from django.test import TestCase, Client
from django.contrib.auth import get_user_model
from django.urls import reverse
class AdminTest(TestCase):
def setUp(self):
self.client = Client()
self.admin_user = get_user_model().objects.create_superuser(
email="na... | 31.877551 | 76 | 0.538412 | from django.test import TestCase, Client
from django.contrib.auth import get_user_model
from django.urls import reverse
class AdminTest(TestCase):
def setUp(self):
self.client = Client()
self.admin_user = get_user_model().objects.create_superuser(
email="na... | true | true |
1c27650f16589cfc40524846085e89e0fff55761 | 326 | py | Python | Algorithms/Jewels and Stones.py | KushRabadia/Leetcode | f6af5bf0b9ef8daf9870570b52012297128aa9e1 | [
"MIT"
] | null | null | null | Algorithms/Jewels and Stones.py | KushRabadia/Leetcode | f6af5bf0b9ef8daf9870570b52012297128aa9e1 | [
"MIT"
] | null | null | null | Algorithms/Jewels and Stones.py | KushRabadia/Leetcode | f6af5bf0b9ef8daf9870570b52012297128aa9e1 | [
"MIT"
] | null | null | null | class Solution(object):
def numJewelsInStones(self, jewels, stones):
"""
:type jewels: str
:type stones: str
:rtype: int
"""
count = 0
for i in range(len(stones)):
if stones[i] in jewels:
count += 1
return ... | 21.733333 | 48 | 0.457055 | class Solution(object):
def numJewelsInStones(self, jewels, stones):
count = 0
for i in range(len(stones)):
if stones[i] in jewels:
count += 1
return count
| true | true |
1c276533900baa5d37e2496a7d63e112bcfeb5e0 | 6,651 | py | Python | eod/plugins/yolov5/models/components.py | Helicopt/EOD | b5db36f4ce267bf64d093b8174bde2c4097b4718 | [
"Apache-2.0"
] | 1 | 2021-11-24T09:32:27.000Z | 2021-11-24T09:32:27.000Z | eod/plugins/yolov5/models/components.py | jinfagang/EOD | a45b74430070d82d9248a10fb5e1116bb7ababe1 | [
"Apache-2.0"
] | null | null | null | eod/plugins/yolov5/models/components.py | jinfagang/EOD | a45b74430070d82d9248a10fb5e1116bb7ababe1 | [
"Apache-2.0"
] | null | null | null | # Standard Library
# Import from third library
import torch
import torch.nn as nn
from eod.models.utils.normalize import build_norm_layer
from eod.models.utils.act_fn import build_act_fn
class ConvBnAct(nn.Module):
# CBH/CBL
def __init__(self,
in_planes,
out_planes,
... | 36.543956 | 120 | 0.550594 |
import torch
import torch.nn as nn
from eod.models.utils.normalize import build_norm_layer
from eod.models.utils.act_fn import build_act_fn
class ConvBnAct(nn.Module):
def __init__(self,
in_planes,
out_planes,
kernel_size=1,
stride=1,
... | true | true |
1c2765e6b39246991bdd570af99f0b0dfbf5b84a | 12,077 | py | Python | apps/reports/custom/pathfinder.py | commtrack/commtrack-old-to-del | cc9c22754ac192a45483cef609bdcf09aa990340 | [
"BSD-3-Clause"
] | 1 | 2017-05-19T07:23:00.000Z | 2017-05-19T07:23:00.000Z | apps/reports/custom/pathfinder.py | commtrack/commtrack-old-to-del | cc9c22754ac192a45483cef609bdcf09aa990340 | [
"BSD-3-Clause"
] | null | null | null | apps/reports/custom/pathfinder.py | commtrack/commtrack-old-to-del | cc9c22754ac192a45483cef609bdcf09aa990340 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
from django.template.loader import render_to_string
from datetime import datetime, timedelta
from apps.reports.models import Case
from apps.hq.utils import get_dates
import logging
'''Report file for custom Pathfinder reports'''
# see mvp.py for an explanation of how ... | 42.375439 | 106 | 0.557672 |
from django.template.loader import render_to_string
from datetime import datetime, timedelta
from apps.reports.models import Case
from apps.hq.utils import get_dates
import logging
def government(request):
context = {}
case_name = "Pathfinder CHBCP"
startdate, enddate = get_dates(request, 30)
maxr... | true | true |
1c2765f986608dce1bef686a7285277fc46e1dcb | 6,040 | py | Python | lrs/managers/AgentProfileManager.py | learningturf/lt_lrs_docker | acb80cf0a18f3815213d15d39d90a949c7675a27 | [
"Apache-2.0"
] | null | null | null | lrs/managers/AgentProfileManager.py | learningturf/lt_lrs_docker | acb80cf0a18f3815213d15d39d90a949c7675a27 | [
"Apache-2.0"
] | null | null | null | lrs/managers/AgentProfileManager.py | learningturf/lt_lrs_docker | acb80cf0a18f3815213d15d39d90a949c7675a27 | [
"Apache-2.0"
] | null | null | null | import json
import datetime
from django.core.files.base import ContentFile
from django.core.exceptions import ValidationError
from django.utils.timezone import utc
from ..models import AgentProfile
from ..exceptions import IDNotFoundError, ParamError
from ..utils import etag
class AgentProfileManager():
def __in... | 43.768116 | 125 | 0.589404 | import json
import datetime
from django.core.files.base import ContentFile
from django.core.exceptions import ValidationError
from django.utils.timezone import utc
from ..models import AgentProfile
from ..exceptions import IDNotFoundError, ParamError
from ..utils import etag
class AgentProfileManager():
def __in... | true | true |
1c2766481e1b5fee9ea41b889076c5cdaafe3c7e | 10,538 | py | Python | deploy-guide/source/conf.py | RedKrieg/openstack-ansible | d7eadab325e19667246e16fc69b1042dac6f9ed8 | [
"Apache-2.0"
] | null | null | null | deploy-guide/source/conf.py | RedKrieg/openstack-ansible | d7eadab325e19667246e16fc69b1042dac6f9ed8 | [
"Apache-2.0"
] | null | null | null | deploy-guide/source/conf.py | RedKrieg/openstack-ansible | d7eadab325e19667246e16fc69b1042dac6f9ed8 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software... | 32.325153 | 117 | 0.717309 |
import os
import sys
import subprocess
import pbr.version
import openstackdocstheme
target_name = 'openstack-ansible'
description = 'OpenStack-Ansible deploys OpenStack environments using Ansible.'
previous_series_name = 'rocky'
current_series_name = 'stein'
author = 'OpenStack-Ansible Con... | true | true |
1c27671f6e05d4784511e091816bf74d1a32eb44 | 6,169 | py | Python | platon/_utils/module_testing/parity_module.py | shinnng/platon.py | 3197fac3839896290210da04dd0d45f0bdc731ce | [
"MIT"
] | null | null | null | platon/_utils/module_testing/parity_module.py | shinnng/platon.py | 3197fac3839896290210da04dd0d45f0bdc731ce | [
"MIT"
] | null | null | null | platon/_utils/module_testing/parity_module.py | shinnng/platon.py | 3197fac3839896290210da04dd0d45f0bdc731ce | [
"MIT"
] | null | null | null | import pytest
from typing import (
TYPE_CHECKING,
Dict,
)
from platon_typing import (
Bech32Address,
HexStr,
)
from platon_utils import (
add_0x_prefix,
)
from platon._utils.formatters import (
hex_to_integer,
)
from platon.exceptions import (
InvalidParityMode,
)
from platon.types import ... | 36.720238 | 242 | 0.668342 | import pytest
from typing import (
TYPE_CHECKING,
Dict,
)
from platon_typing import (
Bech32Address,
HexStr,
)
from platon_utils import (
add_0x_prefix,
)
from platon._utils.formatters import (
hex_to_integer,
)
from platon.exceptions import (
InvalidParityMode,
)
from platon.types import ... | true | true |
1c2768687b6d11c61d1dd7f7dcea79fa71bc2d8f | 14,483 | py | Python | Thesis@3.9.1/Lib/site-packages/setuptools/_distutils/unixccompiler.py | nverbois/TFE21-232 | 7113837b5263b5c508bfc6903cb6982b48aa7ee4 | [
"MIT"
] | null | null | null | Thesis@3.9.1/Lib/site-packages/setuptools/_distutils/unixccompiler.py | nverbois/TFE21-232 | 7113837b5263b5c508bfc6903cb6982b48aa7ee4 | [
"MIT"
] | null | null | null | Thesis@3.9.1/Lib/site-packages/setuptools/_distutils/unixccompiler.py | nverbois/TFE21-232 | 7113837b5263b5c508bfc6903cb6982b48aa7ee4 | [
"MIT"
] | null | null | null | """distutils.unixccompiler
Contains the UnixCCompiler class, a subclass of CCompiler that handles
the "typical" Unix-style command-line C compiler:
* macros defined with -Dname[=value]
* macros undefined with -Uname
* include search directories specified with -Idir
* libraries specified with -lllib
* library... | 42.597059 | 87 | 0.596147 |
import os, sys, re
from distutils import sysconfig
from distutils.dep_util import newer
from distutils.ccompiler import CCompiler, gen_preprocess_options, gen_lib_options
from distutils.errors import DistutilsExecError, CompileError, LibError, LinkError
from distutils import log
if sys.platform == "darwin":
impo... | true | true |
1c27689e6cf9050d6c72429bbaa6575f99c52860 | 2,585 | py | Python | autumn/models/sm_sir/mixing_matrix/mixing_adjusters/location_adjuster.py | emmamcbryde/AuTuMN-1 | b1e7de15ac6ef6bed95a80efab17f0780ec9ff6f | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | autumn/models/sm_sir/mixing_matrix/mixing_adjusters/location_adjuster.py | emmamcbryde/AuTuMN-1 | b1e7de15ac6ef6bed95a80efab17f0780ec9ff6f | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | autumn/models/sm_sir/mixing_matrix/mixing_adjusters/location_adjuster.py | emmamcbryde/AuTuMN-1 | b1e7de15ac6ef6bed95a80efab17f0780ec9ff6f | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | from typing import Callable, Dict
import numpy as np
from .base_adjuster import BaseMixingAdjuster
from autumn.models.sm_sir.constants import LOCATIONS
class LocationMixingAdjuster(BaseMixingAdjuster):
"""
Applies location based mixing adjustments (micro and macro) to a mixing matrix.
The functions thems... | 42.377049 | 109 | 0.716054 | from typing import Callable, Dict
import numpy as np
from .base_adjuster import BaseMixingAdjuster
from autumn.models.sm_sir.constants import LOCATIONS
class LocationMixingAdjuster(BaseMixingAdjuster):
def __init__(
self, base_matrices: Dict[str, np.ndarray], mobility_funcs: Dict[str, Callable[[float], ... | true | true |
1c27698a6e439d2234da255490110baf257f329c | 2,672 | py | Python | lego/apps/companies/constants.py | ollfkaih/lego | b15aacaf09efe90e7f984d25b0e7bddbe12647e8 | [
"MIT"
] | 45 | 2017-10-24T12:09:06.000Z | 2021-11-03T21:21:03.000Z | lego/apps/companies/constants.py | ollfkaih/lego | b15aacaf09efe90e7f984d25b0e7bddbe12647e8 | [
"MIT"
] | 980 | 2017-10-24T12:29:07.000Z | 2022-03-31T04:04:31.000Z | lego/apps/companies/constants.py | wahello/lego | a0b02f3abc997fe96326e9c9c05b49847170041b | [
"MIT"
] | 23 | 2018-04-11T16:34:22.000Z | 2021-11-23T12:28:30.000Z | SPRING = "spring"
AUTUMN = "autumn"
SEMESTER = ((SPRING, SPRING), (AUTUMN, AUTUMN))
COMPANY_PRESENTATION = "company_presentation"
COURSE = "course"
LUNCH_PRESENTATION = "lunch_presentation"
BEDEX = "bedex"
DIGITAL_PRESENTATION = "digital_presentation"
OTHER = "other"
SPONSOR = "sponsor"
START_UP = "start_up"
COMPANY... | 28.425532 | 71 | 0.752246 | SPRING = "spring"
AUTUMN = "autumn"
SEMESTER = ((SPRING, SPRING), (AUTUMN, AUTUMN))
COMPANY_PRESENTATION = "company_presentation"
COURSE = "course"
LUNCH_PRESENTATION = "lunch_presentation"
BEDEX = "bedex"
DIGITAL_PRESENTATION = "digital_presentation"
OTHER = "other"
SPONSOR = "sponsor"
START_UP = "start_up"
COMPANY... | true | true |
1c2769a141d950ecc0bd47b9888e78ba5bbe8bbb | 19,563 | py | Python | keras-retinanet/keras_retinanet/bin/train.py | SimonasJocys/retina_net | c2bd3851d3de50c7b624e983187ed28429552ab4 | [
"MIT"
] | 75 | 2018-11-06T07:44:45.000Z | 2021-09-03T03:27:27.000Z | keras-retinanet/keras_retinanet/bin/train.py | SimonasJocys/retina_net | c2bd3851d3de50c7b624e983187ed28429552ab4 | [
"MIT"
] | 3 | 2019-03-01T15:18:01.000Z | 2020-05-25T14:34:55.000Z | keras-retinanet/keras_retinanet/bin/train.py | SimonasJocys/retina_net | c2bd3851d3de50c7b624e983187ed28429552ab4 | [
"MIT"
] | 39 | 2018-11-06T13:10:54.000Z | 2021-12-08T03:48:42.000Z | #!/usr/bin/env python
"""
Copyright 2017-2018 Fizyr (https://fizyr.com)
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 applicabl... | 39.92449 | 187 | 0.663293 |
import argparse
import os
import sys
import warnings
import keras
import keras.preprocessing.image
import tensorflow as tf
if __name__ == "__main__" and __package__ is None:
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..'))
import keras_retinanet.bin
__package__ = "keras_retina... | true | true |
1c276a45b283092983fb66ea0b0aa7df07a611f7 | 5,475 | py | Python | var/spack/repos/builtin/packages/py-datalad/package.py | varioustoxins/spack | cab0e4cb240f34891a6d753f3393e512f9a99e9a | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/py-datalad/package.py | varioustoxins/spack | cab0e4cb240f34891a6d753f3393e512f9a99e9a | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 6 | 2022-01-08T08:41:11.000Z | 2022-03-14T19:28:07.000Z | var/spack/repos/builtin/packages/py-datalad/package.py | foeroyingur/spack | 5300cbbb2e569190015c72d0970d25425ea38647 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyDatalad(PythonPackage):
"""data distribution geared toward scientific datasets.
Dat... | 45.247934 | 96 | 0.63726 |
from spack import *
class PyDatalad(PythonPackage):
homepage = "https://datalad.org/"
pypi = "datalad/datalad-0.14.6.tar.gz"
version('0.15.3', sha256='44f8c5b3960c6d9848aeecd868c82330c49689a21e975597df5b112dc2e5c9f0')
version('0.15.2', sha256='1a878cf521270f089ee1f50339e71cfd7eed41e708d895a... | true | true |
1c276a52e773640b24dc7e3908effcc34b420355 | 1,085 | py | Python | app/matches/controllers.py | caulagi/shakuni | f027810bc72b55da302d6672cd64fdf7c92f1661 | [
"MIT"
] | null | null | null | app/matches/controllers.py | caulagi/shakuni | f027810bc72b55da302d6672cd64fdf7c92f1661 | [
"MIT"
] | null | null | null | app/matches/controllers.py | caulagi/shakuni | f027810bc72b55da302d6672cd64fdf7c92f1661 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Manage the team and match pages
:copyright: (c) 2014 by Pradip P Caulagi.
:license: MIT, see LICENSE for more details.
"""
import logging
from flask import render_template, g, abort, url_for, redirect, \
request, flash
from flask import Blueprint
from app.matches.models i... | 25.232558 | 68 | 0.647005 |
import logging
from flask import render_template, g, abort, url_for, redirect, \
request, flash
from flask import Blueprint
from app.matches.models import Player, Team
logger = logging.getLogger('shakuni-matches')
matches_blueprint = Blueprint('matches_blueprint', __name__)
def init(application):
@ma... | true | true |
1c276c877c736f82e1795f704907b65f603ad3b0 | 2,479 | py | Python | openiva/commons/generators.py | QuantumLiu/OpenIVA | 4c97a28f999965bab1f4e9e9fd0289df96669526 | [
"Apache-2.0"
] | 8 | 2021-12-08T06:46:27.000Z | 2022-01-15T15:36:31.000Z | openiva/commons/generators.py | QuantumLiu/OpenIVA | 4c97a28f999965bab1f4e9e9fd0289df96669526 | [
"Apache-2.0"
] | null | null | null | openiva/commons/generators.py | QuantumLiu/OpenIVA | 4c97a28f999965bab1f4e9e9fd0289df96669526 | [
"Apache-2.0"
] | 1 | 2022-03-03T02:15:08.000Z | 2022-03-03T02:15:08.000Z | import os
import traceback
from tqdm import tqdm
import cv2
import numpy as np
from .videocoding import decode_video_batch_local
from .io import imread
def read_images_local(pathes_imgs:list,batch_size=8,shuffle=False):
q_dict_out={'flag_start':True,'flag_end':False,'real_len':0}
samples_indecies=np.asarr... | 28.170455 | 86 | 0.629689 | import os
import traceback
from tqdm import tqdm
import cv2
import numpy as np
from .videocoding import decode_video_batch_local
from .io import imread
def read_images_local(pathes_imgs:list,batch_size=8,shuffle=False):
q_dict_out={'flag_start':True,'flag_end':False,'real_len':0}
samples_indecies=np.asarr... | true | true |
1c276d66a1bfa14442fe22ef2c28b8218e16349d | 3,376 | py | Python | lib/python2.7/site-packages/sphinx/__init__.py | Larsende/F5_Agility_2018_Security_in_AWS | 1bebcf9d441a3e3b7348757fcbc83844fbb0132e | [
"Apache-2.0"
] | null | null | null | lib/python2.7/site-packages/sphinx/__init__.py | Larsende/F5_Agility_2018_Security_in_AWS | 1bebcf9d441a3e3b7348757fcbc83844fbb0132e | [
"Apache-2.0"
] | 1 | 2018-08-03T21:08:26.000Z | 2018-08-03T21:08:26.000Z | lib/python2.7/site-packages/sphinx/__init__.py | Larsende/F5_Agility_2018_Security_in_AWS | 1bebcf9d441a3e3b7348757fcbc83844fbb0132e | [
"Apache-2.0"
] | 2 | 2018-07-19T16:53:00.000Z | 2018-08-02T21:59:44.000Z | # -*- coding: utf-8 -*-
"""
Sphinx
~~~~~~
The Sphinx documentation toolchain.
:copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
# Keep this file executable as-is in Python 3!
# (Otherwise getting the version out of it from setup.py is imp... | 32.461538 | 94 | 0.658175 |
from __future__ import absolute_import
import os
import sys
import warnings
from os import path
from .deprecation import RemovedInNextVersionWarning
from .deprecation import RemovedInSphinx20Warning
if 'PYTHONWARNINGS' not in os.environ:
warnings.filterwarnings('default',
categ... | true | true |
1c276d7ccd7e900e6141f5d4e30bacdbb2febaf9 | 914 | py | Python | mtg_dataminer/mtg_dataminer/pipelines.py | Trigition/MTG-DataScraper | 4b4c61bdb44c7882a7592a645c21d3c1f51d0d8d | [
"MIT"
] | null | null | null | mtg_dataminer/mtg_dataminer/pipelines.py | Trigition/MTG-DataScraper | 4b4c61bdb44c7882a7592a645c21d3c1f51d0d8d | [
"MIT"
] | null | null | null | mtg_dataminer/mtg_dataminer/pipelines.py | Trigition/MTG-DataScraper | 4b4c61bdb44c7882a7592a645c21d3c1f51d0d8d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
import scrapy
from scrapy.pipelines.images import ImagesPipeline
from scrapy.exceptions import DropItem
# See https://doc.scrap... | 33.851852 | 83 | 0.71116 |
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
import scrapy
from scrapy.pipelines.images import ImagesPipeline
from scrapy.exceptions import DropItem
# See https://doc.scrapy.org/en/latest/topics/media-pipeline.html for documentation
class MtgImagesPipeline(ImagesPipeline):
def get_media_r... | true | true |
1c276e88b46f049e8679ecccdda69bb506dd88eb | 454 | py | Python | stayclean-2014-october/relapse.py | foobarbazblarg/stayclean | 4cf78fd893edd7d493b7afdf9d1dc16416dc9d9d | [
"MIT"
] | 1 | 2020-01-13T13:03:48.000Z | 2020-01-13T13:03:48.000Z | stayclean-2014-october/relapse.py | foobarbazblarg/stayclean | 4cf78fd893edd7d493b7afdf9d1dc16416dc9d9d | [
"MIT"
] | 2 | 2021-04-06T18:40:31.000Z | 2021-06-02T03:46:59.000Z | stayclean-2014-october/relapse.py | foobarbazblarg/stayclean | 4cf78fd893edd7d493b7afdf9d1dc16416dc9d9d | [
"MIT"
] | null | null | null | #!/usr/bin/python
import sys
import participantCollection
names = sys.argv[1::]
participantCollection = participantCollection.ParticipantCollection()
for name in names:
if participantCollection.hasParticipantNamed(name):
participantCollection.participantNamed(name).isStillIn = False
print "just r... | 26.705882 | 76 | 0.735683 |
import sys
import participantCollection
names = sys.argv[1::]
participantCollection = participantCollection.ParticipantCollection()
for name in names:
if participantCollection.hasParticipantNamed(name):
participantCollection.participantNamed(name).isStillIn = False
print "just relapsed " + name
... | false | true |
1c2770a19611655c460e1357ae03a1ed4af02272 | 1,819 | py | Python | real_estate_api/services/views.py | rossi1/RES | 729196bfa45cc2b47acc93c49c07c7e8f0f6ea93 | [
"MIT"
] | null | null | null | real_estate_api/services/views.py | rossi1/RES | 729196bfa45cc2b47acc93c49c07c7e8f0f6ea93 | [
"MIT"
] | null | null | null | real_estate_api/services/views.py | rossi1/RES | 729196bfa45cc2b47acc93c49c07c7e8f0f6ea93 | [
"MIT"
] | null | null | null | from django.shortcuts import render
# Create your views here.
from rest_framework.generics import (CreateAPIView, RetrieveUpdateAPIView,
RetrieveDestroyAPIView, ListAPIView
)
from rest_framework.response import Response
from rest_framework import status
from rest_framework.authentication import SessionAuthentication
... | 28.873016 | 74 | 0.796592 | from django.shortcuts import render
from rest_framework.generics import (CreateAPIView, RetrieveUpdateAPIView,
RetrieveDestroyAPIView, ListAPIView
)
from rest_framework.response import Response
from rest_framework import status
from rest_framework.authentication import SessionAuthentication
from .models import Servi... | true | true |
1c277179bc55f4a819e2c7881e36dfa57458d816 | 63 | py | Python | aim/__version__.py | fetz236/aim | 11baf468f28db8c8608dba9ceeab08b97a9a8d92 | [
"Apache-2.0"
] | 1 | 2021-07-19T19:21:30.000Z | 2021-07-19T19:21:30.000Z | aim/__version__.py | DavitAbgaryan/aim | 8b905dbf4ab35d997f131ac9ae7f6e603f75c96f | [
"Apache-2.0"
] | null | null | null | aim/__version__.py | DavitAbgaryan/aim | 8b905dbf4ab35d997f131ac9ae7f6e603f75c96f | [
"Apache-2.0"
] | null | null | null | VERSION = (2, 7, 1)
__version__ = '.'.join(map(str, VERSION))
| 15.75 | 41 | 0.603175 | VERSION = (2, 7, 1)
__version__ = '.'.join(map(str, VERSION))
| true | true |
1c2772c9f1141c98bfd5f2b5dbdc44ae1dad91cb | 465 | py | Python | kryptobot/ta/talib_mesa_adaptive_moving_average.py | eristoddle/Kryptobot | d0c3050a1c924125810946530670c19b2de72d3f | [
"Apache-2.0"
] | 24 | 2018-05-29T13:44:36.000Z | 2022-03-12T20:41:45.000Z | kryptobot/ta/talib_mesa_adaptive_moving_average.py | eristoddle/Kryptobot | d0c3050a1c924125810946530670c19b2de72d3f | [
"Apache-2.0"
] | 23 | 2018-07-08T02:31:18.000Z | 2020-06-02T04:07:49.000Z | kryptobot/ta/talib_mesa_adaptive_moving_average.py | eristoddle/Kryptobot | d0c3050a1c924125810946530670c19b2de72d3f | [
"Apache-2.0"
] | 14 | 2018-08-10T15:44:27.000Z | 2021-06-14T07:14:52.000Z | from .generic_indicator import GenericIndicator
from talib import MAMA as indicator
class TalibMesaAdaptiveMovingAverage(GenericIndicator):
def __init__(self, market, interval, periods, params):
super().__init__(market, interval, periods, None, None, params)
def next_calculation(self, candle):
... | 31 | 71 | 0.683871 | from .generic_indicator import GenericIndicator
from talib import MAMA as indicator
class TalibMesaAdaptiveMovingAverage(GenericIndicator):
def __init__(self, market, interval, periods, params):
super().__init__(market, interval, periods, None, None, params)
def next_calculation(self, candle):
... | true | true |
1c2772f0b01c7562fa0945bc32f749a48689e9c1 | 482 | py | Python | index.py | PatriciaHeimfarth/Pine | b8bbe4c5f71e732313290d674c2a04f2e7dbe5ce | [
"MIT"
] | null | null | null | index.py | PatriciaHeimfarth/Pine | b8bbe4c5f71e732313290d674c2a04f2e7dbe5ce | [
"MIT"
] | null | null | null | index.py | PatriciaHeimfarth/Pine | b8bbe4c5f71e732313290d674c2a04f2e7dbe5ce | [
"MIT"
] | null | null | null | import pygame
import random
screen = pygame.display.set_mode((500, 500))
draw_on = False
radius = 10
try:
x = 0
while x < 250:
color = (random.randrange(256), random.randrange(
256), random.randrange(256))
pygame.draw.circle(screen, color, (random.randrange(
500), r... | 17.851852 | 63 | 0.612033 | import pygame
import random
screen = pygame.display.set_mode((500, 500))
draw_on = False
radius = 10
try:
x = 0
while x < 250:
color = (random.randrange(256), random.randrange(
256), random.randrange(256))
pygame.draw.circle(screen, color, (random.randrange(
500), r... | true | true |
1c277339bd3e5a85b8e04ba753e43802622105af | 432 | py | Python | todos_api/models.py | jaceee/simple-todo-api | 57735d6b7039a4200588275662cea8383b2779e3 | [
"Apache-2.0"
] | null | null | null | todos_api/models.py | jaceee/simple-todo-api | 57735d6b7039a4200588275662cea8383b2779e3 | [
"Apache-2.0"
] | null | null | null | todos_api/models.py | jaceee/simple-todo-api | 57735d6b7039a4200588275662cea8383b2779e3 | [
"Apache-2.0"
] | null | null | null | from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.db import models
class Todo(models.Model):
user = models.ForeignKey(
User,
on_delete=models.CASCADE,
related_name="todos",
related_query_name="todo",
)
title = models.CharField(m... | 27 | 51 | 0.712963 | from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.db import models
class Todo(models.Model):
user = models.ForeignKey(
User,
on_delete=models.CASCADE,
related_name="todos",
related_query_name="todo",
)
title = models.CharField(m... | true | true |
1c277438367f5245423d996c22e9a9075c69fbaa | 14,230 | py | Python | projects/g3h1-cp-fml-interpreter/src/fml_parser/parser.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | projects/g3h1-cp-fml-interpreter/src/fml_parser/parser.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | projects/g3h1-cp-fml-interpreter/src/fml_parser/parser.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | # Grammar
# =======
#
# Program -> { Statement SEMICOLON }
#
# Statement -> OriginStatement | ScaleStatement | RotStatement | ForStatement | ColorStatement | BgStatement
#
# OriginStatement -> ORIGIN IS L_BRACKET Expression COMMA Expression R_BRACKET
# ScaleStatement -> SCALE IS L_BRACKET Expression COMMA Expression R_... | 40.311615 | 119 | 0.592129 |
from .grammar import NonTerminals, Terminals
class Parser(object):
def __init__(self, token_stream):
self.token_stream = token_stream
self.grammar_tree = Parser.program(token_stream)
def get_grammar_tree(self):
return self.grammar_tree
@staticmethod
... | true | true |
1c2774d604cbac8e2bf36973bf238e796b18cfa6 | 2,261 | py | Python | coffea/lookup_tools/evaluator.py | bfis/coffea | e5e67d410e86faee1172fcc864774d7024d97653 | [
"BSD-3-Clause"
] | 77 | 2019-06-09T14:23:33.000Z | 2022-03-22T21:34:01.000Z | coffea/lookup_tools/evaluator.py | bfis/coffea | e5e67d410e86faee1172fcc864774d7024d97653 | [
"BSD-3-Clause"
] | 353 | 2019-06-05T23:54:39.000Z | 2022-03-31T21:21:47.000Z | coffea/lookup_tools/evaluator.py | bfis/coffea | e5e67d410e86faee1172fcc864774d7024d97653 | [
"BSD-3-Clause"
] | 71 | 2019-06-07T02:04:11.000Z | 2022-03-05T21:03:45.000Z | from .dense_lookup import dense_lookup
from .dense_evaluated_lookup import dense_evaluated_lookup
from .jme_standard_function import jme_standard_function
from .jersf_lookup import jersf_lookup
from .jec_uncertainty_lookup import jec_uncertainty_lookup
from .rochester_lookup import rochester_lookup
lookup_types = {
... | 33.746269 | 87 | 0.693941 | from .dense_lookup import dense_lookup
from .dense_evaluated_lookup import dense_evaluated_lookup
from .jme_standard_function import jme_standard_function
from .jersf_lookup import jersf_lookup
from .jec_uncertainty_lookup import jec_uncertainty_lookup
from .rochester_lookup import rochester_lookup
lookup_types = {
... | true | true |
1c2775697d4310b0e7e50b737b6f4c453bddec47 | 356 | py | Python | setup.py | IntheGrass/citeomatic_learning | b0fee3c2c9b6462e1878eb5aa3060bee8c86f923 | [
"Apache-2.0"
] | 162 | 2018-02-26T18:13:55.000Z | 2022-02-25T05:14:06.000Z | setup.py | zhoufn/citeomatic | aa0f5add68000232db299e340d114bd03586752f | [
"Apache-2.0"
] | 9 | 2019-03-14T16:16:31.000Z | 2021-03-15T19:50:21.000Z | setup.py | zhoufn/citeomatic | aa0f5add68000232db299e340d114bd03586752f | [
"Apache-2.0"
] | 24 | 2018-06-30T10:37:01.000Z | 2022-02-15T08:34:25.000Z | #!/usr/bin/python
import setuptools
setuptools.setup(
name='citeomatic',
version='0.01',
url='http://github.com/allenai/s2-research',
packages=setuptools.find_packages(),
install_requires=[
],
tests_require=[
],
zip_safe=False,
test_suite='py.test',
entry_points='',
pyro... | 19.777778 | 48 | 0.648876 |
import setuptools
setuptools.setup(
name='citeomatic',
version='0.01',
url='http://github.com/allenai/s2-research',
packages=setuptools.find_packages(),
install_requires=[
],
tests_require=[
],
zip_safe=False,
test_suite='py.test',
entry_points='',
pyrobuf_modules=['cit... | true | true |
1c277698529eeaec08c26fc53d619bda732f6c37 | 372 | py | Python | crashes/migrations/0029_alter_categorycount_unique_together.py | grigoryk/sentry-analyzer | 8a48706297ea4bc8033c8c9d3223b3e59cd1cb6d | [
"Apache-2.0"
] | 2 | 2021-07-23T19:51:39.000Z | 2021-08-07T01:50:19.000Z | crashes/migrations/0029_alter_categorycount_unique_together.py | grigoryk/sentry-analyzer | 8a48706297ea4bc8033c8c9d3223b3e59cd1cb6d | [
"Apache-2.0"
] | 6 | 2021-03-30T13:02:30.000Z | 2021-07-19T17:01:53.000Z | crashes/migrations/0029_alter_categorycount_unique_together.py | grigoryk/sentry-analyzer | 8a48706297ea4bc8033c8c9d3223b3e59cd1cb6d | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.2.5 on 2021-08-12 20:01
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('crashes', '0028_processeventtag'),
]
operations = [
migrations.AlterUniqueTogether(
name='categorycount',
unique_together={(... | 20.666667 | 64 | 0.607527 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('crashes', '0028_processeventtag'),
]
operations = [
migrations.AlterUniqueTogether(
name='categorycount',
unique_together={('keyed_tag', 'category', 'date')},
),
... | true | true |
1c27772e09ce2c5eecab41d15f4d59dd72f813ae | 22,906 | py | Python | google/ads/googleads/v8/services/services/customer_asset_service/client.py | wxxlouisa/google-ads-python | f24137966f6bfcb765a9b1fae79f2d23041825fe | [
"Apache-2.0"
] | 285 | 2018-10-05T16:47:58.000Z | 2022-03-31T00:58:39.000Z | google/ads/googleads/v8/services/services/customer_asset_service/client.py | wxxlouisa/google-ads-python | f24137966f6bfcb765a9b1fae79f2d23041825fe | [
"Apache-2.0"
] | 425 | 2018-09-10T13:32:41.000Z | 2022-03-31T14:50:05.000Z | google/ads/googleads/v8/services/services/customer_asset_service/client.py | wxxlouisa/google-ads-python | f24137966f6bfcb765a9b1fae79f2d23041825fe | [
"Apache-2.0"
] | 369 | 2018-11-28T07:01:00.000Z | 2022-03-28T09:53:22.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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... | 41.421338 | 136 | 0.631843 |
from collections import OrderedDict
from distutils import util
import os
import re
from typing import Dict, Optional, Sequence, Tuple, Type, Union
from google.api_core import client_options as client_options_lib
from google.api_core import exceptions as core_exceptions
from google.api_core import ga... | true | true |
1c2778646ddba3d8bd0df514ec5f7ef8e86e33d4 | 1,961 | py | Python | app/models.py | xdd-xoo/SPIDER | 2e27dae6b63272634ad256aead623a367c9c0c1e | [
"MIT"
] | null | null | null | app/models.py | xdd-xoo/SPIDER | 2e27dae6b63272634ad256aead623a367c9c0c1e | [
"MIT"
] | null | null | null | app/models.py | xdd-xoo/SPIDER | 2e27dae6b63272634ad256aead623a367c9c0c1e | [
"MIT"
] | null | null | null | from . import db
from werkzeug.security import generate_password_hash, check_password_hash
from datetime import datetime
class Role(db.Model):
__tablename__ = 'roles'
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(64), unique=True)
users = db.relationship('User', backref='role'... | 35.654545 | 100 | 0.700153 | from . import db
from werkzeug.security import generate_password_hash, check_password_hash
from datetime import datetime
class Role(db.Model):
__tablename__ = 'roles'
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(64), unique=True)
users = db.relationship('User', backref='role'... | true | true |
1c277933a69d5b17793016e69c55ede3c252cc98 | 5,685 | py | Python | examples/plot_covid_r0.py | sdpython/covidsim | 765d43ac29831f1a630ef5e187cff10f3ddc5cf1 | [
"MIT"
] | null | null | null | examples/plot_covid_r0.py | sdpython/covidsim | 765d43ac29831f1a630ef5e187cff10f3ddc5cf1 | [
"MIT"
] | null | null | null | examples/plot_covid_r0.py | sdpython/covidsim | 765d43ac29831f1a630ef5e187cff10f3ddc5cf1 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Représentation du R0 par départements
=====================================
Cet exemple reprend des données de tests par gouvernement
pour calculer le coefficient R0 de l'épidémie. La méthode
de Cori est utilisée avec la formule proposée dans :epkg:`covidtracker` :
.. math::
R = \\frac{\\sum_... | 29.609375 | 78 | 0.608443 |
import warnings
from pandas import Timedelta, DataFrame
from geopandas import GeoDataFrame
from matplotlib.cbook.deprecation import MatplotlibDeprecationWarning
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
from aftercovid.data import (
data_covid_france_departments_tests... | true | true |
1c277945601fb806317e9ad971cc94d124c60211 | 18,853 | py | Python | generate_samples/model.py | smaeland/ML-2HDM | 20ca00847c82fcd6a28a6e1c65c43e0aba1a3d65 | [
"BSD-3-Clause"
] | null | null | null | generate_samples/model.py | smaeland/ML-2HDM | 20ca00847c82fcd6a28a6e1c65c43e0aba1a3d65 | [
"BSD-3-Clause"
] | null | null | null | generate_samples/model.py | smaeland/ML-2HDM | 20ca00847c82fcd6a28a6e1c65c43e0aba1a3d65 | [
"BSD-3-Clause"
] | null | null | null | # pylint: disable=C0303, C0103
## Class for a 2HDM model, contains parameters and computes xsec / BR
import os
import subprocess
import argparse
import h5py
import numpy as np
from glob import glob
from lhatool import LHA, Block, Entry
from dispatcher import Dispatcher
class Model(object):
""" All properties of... | 36.750487 | 123 | 0.476635 |
py as np
from glob import glob
from lhatool import LHA, Block, Entry
from dispatcher import Dispatcher
class Model(object):
""" All properties of a model and methods to run Pythia, 2HDMC, SusHi """
def __init__(self, param_dict, gen_settings_dict,
lumi, massrange,
... | false | true |
1c27798285ccce4c69465f9af3468165dc3642f2 | 9,727 | py | Python | python/oskar/vis_block.py | happyseayou/OSKAR | 3fb995ed39deb6b11da12524e8e30f0ca8f9c39b | [
"BSD-3-Clause"
] | 46 | 2015-12-15T14:24:16.000Z | 2022-01-24T16:54:49.000Z | python/oskar/vis_block.py | happyseayou/OSKAR | 3fb995ed39deb6b11da12524e8e30f0ca8f9c39b | [
"BSD-3-Clause"
] | 37 | 2016-08-04T17:53:03.000Z | 2022-03-10T10:22:01.000Z | python/oskar/vis_block.py | happyseayou/OSKAR | 3fb995ed39deb6b11da12524e8e30f0ca8f9c39b | [
"BSD-3-Clause"
] | 32 | 2016-05-09T10:30:11.000Z | 2022-01-26T07:55:27.000Z | # -*- coding: utf-8 -*-
#
# Copyright (c) 2016-2020, The University of Oxford
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright... | 41.746781 | 83 | 0.699085 |
from __future__ import absolute_import, division, print_function
try:
from . import _vis_block_lib
except ImportError:
_vis_block_lib = None
class VisBlock(object):
def __init__(self):
if _vis_block_lib is None:
raise RuntimeError("OSKAR library not found... | true | true |
1c2779cec09ba6d3598f48311f8c59a7c595edc1 | 10,011 | py | Python | tensorflow/tensorboard/backend/server_test.py | smrutiranjans/tensorflow | d8e8b872eae63188c75046d5bb068e03a81b3f85 | [
"Apache-2.0"
] | 7 | 2016-04-24T19:06:10.000Z | 2018-10-03T16:33:51.000Z | tensorflow/tensorboard/backend/server_test.py | smrutiranjans/tensorflow | d8e8b872eae63188c75046d5bb068e03a81b3f85 | [
"Apache-2.0"
] | null | null | null | tensorflow/tensorboard/backend/server_test.py | smrutiranjans/tensorflow | d8e8b872eae63188c75046d5bb068e03a81b3f85 | [
"Apache-2.0"
] | 3 | 2017-05-24T06:58:14.000Z | 2020-02-15T14:21:00.000Z | # Copyright 2015 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... | 37.920455 | 80 | 0.640595 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import base64
import gzip
import json
import os
import shutil
import threading
import zlib
from six import BytesIO
from six.moves import http_client
from six.moves import xrange
import tensorf... | true | true |
1c2779eb557712aaa77b54ffb8572f5b98ebda5a | 99 | py | Python | vendor/tree-sitter-python/test/highlight/parameters.py | Mu-L/difftastic | f91357b72936c65a56d74f1221bec3878a996575 | [
"MIT"
] | null | null | null | vendor/tree-sitter-python/test/highlight/parameters.py | Mu-L/difftastic | f91357b72936c65a56d74f1221bec3878a996575 | [
"MIT"
] | null | null | null | vendor/tree-sitter-python/test/highlight/parameters.py | Mu-L/difftastic | f91357b72936c65a56d74f1221bec3878a996575 | [
"MIT"
] | null | null | null | def g(h, i, /, j, *, k=100, **kwarg):
# ^ operator
# ^ operator
pass
| 19.8 | 37 | 0.363636 | def g(h, i, /, j, *, k=100, **kwarg):
pass
| true | true |
1c277a3f5d82b807ab49a626e5fd70a1ffd9681c | 3,146 | py | Python | videoaugment/transforms/general.py | iliasprc/video-augment | bd95f415a22f0abc4f85d7836857cd33b211c02e | [
"MIT"
] | 3 | 2021-02-19T15:11:25.000Z | 2021-02-21T11:38:36.000Z | videoaugment/transforms/general.py | iliasprc/videoaugment | bd95f415a22f0abc4f85d7836857cd33b211c02e | [
"MIT"
] | null | null | null | videoaugment/transforms/general.py | iliasprc/videoaugment | bd95f415a22f0abc4f85d7836857cd33b211c02e | [
"MIT"
] | null | null | null |
import PIL
import PIL.Image
import torch
import numpy as np
import torchvision.transforms.functional as TF
from einops import rearrange
class RearrangeTensor:
def __call__(self, input_tensor):
return rearrange(input_tensor, 'h w c -> c h w')
class PILToNumpy:
def __call__(self, image):
"""... | 20.973333 | 96 | 0.595677 |
import PIL
import PIL.Image
import torch
import numpy as np
import torchvision.transforms.functional as TF
from einops import rearrange
class RearrangeTensor:
def __call__(self, input_tensor):
return rearrange(input_tensor, 'h w c -> c h w')
class PILToNumpy:
def __call__(self, image):
ret... | true | true |
1c277a8a79a2c4bd780e1410428895e3b2dfd83f | 5,749 | py | Python | cinder/api/middleware/auth.py | helenwalsh/cinder | 307fccea4cc9c6496334b0fe137206cb48499bd5 | [
"Apache-2.0"
] | 1 | 2019-02-17T17:49:41.000Z | 2019-02-17T17:49:41.000Z | cinder/api/middleware/auth.py | BelieveInFuture/cinder | fff95fa6a68a054488ee087b6e31f4f5e28209dc | [
"Apache-2.0"
] | null | null | null | cinder/api/middleware/auth.py | BelieveInFuture/cinder | fff95fa6a68a054488ee087b6e31f4f5e28209dc | [
"Apache-2.0"
] | 3 | 2020-06-16T07:29:48.000Z | 2020-06-21T10:22:57.000Z | # Copyright 2010 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 35.708075 | 79 | 0.657332 |
import os
from oslo_config import cfg
from oslo_log import log as logging
from oslo_middleware import request_id
from oslo_serialization import jsonutils
from six.moves import http_client
import webob.dec
import webob.exc
from cinder.api.openstack import wsgi
from cinder import context
from cinder.i18... | true | true |
1c277ad2dc6ee90cf3a4ee58af8b89450eb3b2d3 | 2,176 | py | Python | examples/tangent_pca_h2.py | tristancabel/geomstats | eeba7b7a652d45fc0053e35219c03627f2e8406f | [
"MIT"
] | 1 | 2020-12-23T10:29:15.000Z | 2020-12-23T10:29:15.000Z | examples/tangent_pca_h2.py | tristancabel/geomstats | eeba7b7a652d45fc0053e35219c03627f2e8406f | [
"MIT"
] | null | null | null | examples/tangent_pca_h2.py | tristancabel/geomstats | eeba7b7a652d45fc0053e35219c03627f2e8406f | [
"MIT"
] | null | null | null | """Perform tangent PCA at the mean on H2."""
import logging
import matplotlib.pyplot as plt
import numpy as np
import geomstats.visualization as visualization
from geomstats.geometry.hyperboloid import Hyperboloid
from geomstats.learning.frechet_mean import FrechetMean
from geomstats.learning.pca import TangentPCA
... | 30.222222 | 77 | 0.713695 |
import logging
import matplotlib.pyplot as plt
import numpy as np
import geomstats.visualization as visualization
from geomstats.geometry.hyperboloid import Hyperboloid
from geomstats.learning.frechet_mean import FrechetMean
from geomstats.learning.pca import TangentPCA
def main():
fig = plt.figure(figsize=(15... | true | true |
1c277b2f9270b82403a2134187814708ae18877c | 19,112 | py | Python | tensorflow_federated/python/learning/templates/finalizers_test.py | zhihansh/federated-oss | 38cfcb05702ff7297db76d3ccb5f5afef53ca09b | [
"Apache-2.0"
] | null | null | null | tensorflow_federated/python/learning/templates/finalizers_test.py | zhihansh/federated-oss | 38cfcb05702ff7297db76d3ccb5f5afef53ca09b | [
"Apache-2.0"
] | null | null | null | tensorflow_federated/python/learning/templates/finalizers_test.py | zhihansh/federated-oss | 38cfcb05702ff7297db76d3ccb5f5afef53ca09b | [
"Apache-2.0"
] | null | null | null | # Copyright 2021, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 42.756152 | 80 | 0.715938 |
import collections
from absl.testing import parameterized
import tensorflow as tf
from tensorflow_federated.python.core.backends.native import execution_contexts
from tensorflow_federated.python.core.api import computations
from tensorflow_federated.python.core.api import test_case
from tensorflow_feder... | true | true |
1c277d249394f9a930dccb98a71bb7aa30e858d5 | 1,023 | py | Python | parser/team19/BDTytus/TablaSimbolos/Simbolo.py | webdev188/tytus | 847071edb17b218f51bb969d335a8ec093d13f94 | [
"MIT"
] | 35 | 2020-12-07T03:11:43.000Z | 2021-04-15T17:38:16.000Z | parser/team19/BDTytus/TablaSimbolos/Simbolo.py | webdev188/tytus | 847071edb17b218f51bb969d335a8ec093d13f94 | [
"MIT"
] | 47 | 2020-12-09T01:29:09.000Z | 2021-01-13T05:37:50.000Z | parser/team19/BDTytus/TablaSimbolos/Simbolo.py | webdev188/tytus | 847071edb17b218f51bb969d335a8ec093d13f94 | [
"MIT"
] | 556 | 2020-12-07T03:13:31.000Z | 2021-06-17T17:41:10.000Z | class Simbolo:
def __init__(self, column_name, data_type, size_type, table_name, pos_line, pos_colum, sql_instruction):
self.column_name = column_name
self.data_type = data_type
self.size_type = size_type
self.table_name = table_name
self.pos_line = pos_line
self.pos_... | 39.346154 | 157 | 0.521017 | class Simbolo:
def __init__(self, column_name, data_type, size_type, table_name, pos_line, pos_colum, sql_instruction):
self.column_name = column_name
self.data_type = data_type
self.size_type = size_type
self.table_name = table_name
self.pos_line = pos_line
self.pos_... | true | true |
1c277d78fc6ced2225c4e011aa0b8d85539ce34c | 3,700 | py | Python | pysteps/utils/fft.py | leabeusch/pysteps | 5f162d4b1155e4cfd894c9635eed3f0e823adedd | [
"BSD-3-Clause"
] | 285 | 2018-07-11T10:42:43.000Z | 2022-03-23T13:44:54.000Z | pysteps/utils/fft.py | leabeusch/pysteps | 5f162d4b1155e4cfd894c9635eed3f0e823adedd | [
"BSD-3-Clause"
] | 246 | 2018-07-16T06:17:12.000Z | 2022-03-22T15:45:08.000Z | pysteps/utils/fft.py | leabeusch/pysteps | 5f162d4b1155e4cfd894c9635eed3f0e823adedd | [
"BSD-3-Clause"
] | 97 | 2018-07-12T12:05:45.000Z | 2022-03-31T14:56:31.000Z | # -*- coding: utf-8 -*-
"""
pysteps.utils.fft
=================
Interface module for different FFT methods.
.. autosummary::
:toctree: ../generated/
get_numpy
get_scipy
get_pyfftw
"""
from pysteps.exceptions import MissingOptionalDependency
from types import SimpleNamespace
def get_numpy(shape, ff... | 26.241135 | 79 | 0.599189 |
from pysteps.exceptions import MissingOptionalDependency
from types import SimpleNamespace
def get_numpy(shape, fftn_shape=None, **kwargs):
import numpy.fft as numpy_fft
f = {
"fft2": numpy_fft.fft2,
"ifft2": numpy_fft.ifft2,
"rfft2": numpy_fft.rfft2,
"irfft2": lambda X: num... | true | true |
1c277e6eb153076d9eb9e585bd9c0cab84a38845 | 696 | py | Python | python/turtle_star.py | AvaneeshG/dump-a-projects | 33b834d909313f4fb411dca634e173b1e86c2eef | [
"MIT"
] | null | null | null | python/turtle_star.py | AvaneeshG/dump-a-projects | 33b834d909313f4fb411dca634e173b1e86c2eef | [
"MIT"
] | null | null | null | python/turtle_star.py | AvaneeshG/dump-a-projects | 33b834d909313f4fb411dca634e173b1e86c2eef | [
"MIT"
] | null | null | null | from turtle import *
import time
screen = Screen()
screen.bgcolor("wheat")
turtle = Turtle()
turtle.pencolor("green")
def drawValue():
length = 100
turtle.forward(length)
turtle.backward(length)
turtle.right(30)
for x in range(1, 12 + 1):
drawValue();
def drawValue2():
length = 40
... | 17.4 | 27 | 0.630747 | from turtle import *
import time
screen = Screen()
screen.bgcolor("wheat")
turtle = Turtle()
turtle.pencolor("green")
def drawValue():
length = 100
turtle.forward(length)
turtle.backward(length)
turtle.right(30)
for x in range(1, 12 + 1):
drawValue();
def drawValue2():
length = 40
... | true | true |
1c277fc6b7a2818bd7d9ff12516c0d97fd862950 | 30,725 | py | Python | tensorflow_tts/trainers/base_trainer.py | cclauss/TensorFlowTTS | cac7e27e9d2bf2144f6fef409675d16dd48bc158 | [
"Apache-2.0"
] | 70 | 2020-09-08T06:50:39.000Z | 2022-03-31T08:18:03.000Z | tensorflow_tts/trainers/base_trainer.py | cclauss/TensorFlowTTS | cac7e27e9d2bf2144f6fef409675d16dd48bc158 | [
"Apache-2.0"
] | 4 | 2020-10-14T13:15:16.000Z | 2021-03-24T08:13:07.000Z | tensorflow_tts/trainers/base_trainer.py | cclauss/TensorFlowTTS | cac7e27e9d2bf2144f6fef409675d16dd48bc158 | [
"Apache-2.0"
] | 22 | 2020-09-18T12:14:37.000Z | 2022-03-12T02:58:07.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Minh Nguyen (@dathudeptrai)
#
# 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 ... | 36.01993 | 113 | 0.632644 |
import abc
import logging
import os
import tensorflow as tf
from tqdm import tqdm
class BasedTrainer(metaclass=abc.ABCMeta):
def __init__(self, steps, epochs, config):
self.steps = steps
self.epochs = epochs
self.config = config
self.finish_train = False
se... | true | true |
1c27800eb2e70c35d4ee115147ad99d58e66053d | 19,063 | py | Python | swift/common/middleware/dlo.py | ISCAS-VDI/swift-base | a5018b055b61cc0d273e549d32877608fcbf27fc | [
"Apache-2.0"
] | null | null | null | swift/common/middleware/dlo.py | ISCAS-VDI/swift-base | a5018b055b61cc0d273e549d32877608fcbf27fc | [
"Apache-2.0"
] | null | null | null | swift/common/middleware/dlo.py | ISCAS-VDI/swift-base | a5018b055b61cc0d273e549d32877608fcbf27fc | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | 42.934685 | 79 | 0.6286 |
import json
import os
import six
from six.moves.configparser import ConfigParser, NoSectionError, NoOptionError
from six.moves.urllib.parse import unquote
from hashlib import md5
from swift.common import constraints
from swift.common.exceptions import ListingIterError, SegmentError
from swift.common.h... | true | true |
1c27804523aa5aa1269028e251379d029e4d9bab | 2,273 | py | Python | furniture/demo_gym.py | KejiaChen/assembly | dbaa3eeb40709c4a2033b6a603a68c17e60a0477 | [
"MIT"
] | 364 | 2019-11-20T16:28:39.000Z | 2022-03-28T23:00:19.000Z | furniture/demo_gym.py | KejiaChen/assembly | dbaa3eeb40709c4a2033b6a603a68c17e60a0477 | [
"MIT"
] | 22 | 2019-11-24T08:27:22.000Z | 2022-03-31T23:30:25.000Z | furniture/demo_gym.py | KejiaChen/assembly | dbaa3eeb40709c4a2033b6a603a68c17e60a0477 | [
"MIT"
] | 52 | 2019-11-21T01:01:01.000Z | 2022-03-02T11:52:53.000Z | """
How to use the IKEA furniture assembly environment with gym interface.
For parallel execution, set `--num_envs` flag to larger than 1.
"""
import time
import gym
import imageio
from env import make_vec_env
def main(config):
"""
Makes a gym environment with name @env_id and runs one episode.
If @con... | 27.385542 | 84 | 0.637044 |
import time
import gym
import imageio
from env import make_vec_env
def main(config):
num_env = config.num_env
env_id = config.env_id
if num_env == 1:
env = gym.make(env_id, **config.__dict__)
observation = env.reset()
done = False
st = time.time()
... | true | true |
1c2780c1ca6d89a068885e8ba06b527c5774e304 | 4,377 | py | Python | src/oci/devops/models/deploy_pipeline_artifact.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 249 | 2017-09-11T22:06:05.000Z | 2022-03-04T17:09:29.000Z | src/oci/devops/models/deploy_pipeline_artifact.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 228 | 2017-09-11T23:07:26.000Z | 2022-03-23T10:58:50.000Z | src/oci/devops/models/deploy_pipeline_artifact.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 224 | 2017-09-27T07:32:43.000Z | 2022-03-25T16:55:42.000Z | # coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 33.930233 | 245 | 0.687229 |
from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel
from oci.decorators import init_model_state_from_kwargs
@init_model_state_from_kwargs
class DeployPipelineArtifact(object):
def __init__(self, **kwargs):
self.swagger_types = {
'deploy_artifact... | true | true |
1c2781515954923409de7b79dc5589680e47406d | 8,637 | py | Python | tempest/stress/driver.py | midokura/tempest | b0ec1d280f057d5d9c2eda081bcbda7e381ecb3b | [
"Apache-2.0"
] | null | null | null | tempest/stress/driver.py | midokura/tempest | b0ec1d280f057d5d9c2eda081bcbda7e381ecb3b | [
"Apache-2.0"
] | null | null | null | tempest/stress/driver.py | midokura/tempest | b0ec1d280f057d5d9c2eda081bcbda7e381ecb3b | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 Quanta Research Cambridge, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 35.253061 | 78 | 0.586662 |
import multiprocessing
import os
import signal
import time
from six import moves
from tempest import clients
from tempest.common import cred_provider
from tempest.common import ssh
from tempest.common.utils import data_utils
from tempest import config
from tempest import exceptions
from tempest.openstac... | true | true |
1c2781acb452bef3ffef06c7bd5460116b61ff64 | 50,749 | py | Python | mslib/msui/mpl_pathinteractor.py | shivamshan/MSS | 12879e64b1088b1db94b1db0d0919a31e662cd20 | [
"Apache-2.0"
] | null | null | null | mslib/msui/mpl_pathinteractor.py | shivamshan/MSS | 12879e64b1088b1db94b1db0d0919a31e662cd20 | [
"Apache-2.0"
] | null | null | null | mslib/msui/mpl_pathinteractor.py | shivamshan/MSS | 12879e64b1088b1db94b1db0d0919a31e662cd20 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
mslib.msui.mpl_pathinteractor
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Interactive editing of Path objects on a Matplotlib canvas.
This module provides the following classes:
a) WaypointsPath and subclasses PathV, PathH and PathH-GC:
Derivatives of matplotlib.Path, provide a... | 41.292921 | 112 | 0.628525 |
import logging
import math
import numpy as np
import matplotlib.path as mpath
import matplotlib.patches as mpatches
from PyQt5 import QtCore, QtWidgets
from mslib.utils.coordinate import get_distance, find_location, latlon_points
from mslib.utils.units import units
from mslib.utils.thermolib import pressure2flightle... | true | true |
1c278282f4fdf13d5497eebcb872ed88f344f34e | 3,809 | py | Python | src/resources/user.py | BuildForSDG/Team-151-Backend | 623a8fa3c89e6974b346214c5c53dbed22bfbf10 | [
"MIT"
] | null | null | null | src/resources/user.py | BuildForSDG/Team-151-Backend | 623a8fa3c89e6974b346214c5c53dbed22bfbf10 | [
"MIT"
] | 1 | 2020-05-28T13:22:49.000Z | 2020-05-28T13:22:49.000Z | src/resources/user.py | BuildForSDG/Team-151-Backend | 623a8fa3c89e6974b346214c5c53dbed22bfbf10 | [
"MIT"
] | 2 | 2020-06-03T18:22:34.000Z | 2020-06-23T08:50:12.000Z | import bcrypt
from flask import jsonify
from flask_jwt_extended import *
from flask_restful import Resource, reqparse
from src.models.user import UserModel
class UserRegister(Resource):
"""
This resource allows users to register by sending a
POST request with their username and password.
"""
pars... | 34.315315 | 92 | 0.573641 | import bcrypt
from flask import jsonify
from flask_jwt_extended import *
from flask_restful import Resource, reqparse
from src.models.user import UserModel
class UserRegister(Resource):
parser = reqparse.RequestParser()
parser.add_argument('username',
type=str,
... | true | true |
1c27828928fd848f4a603f5f1dde51fec1301cc1 | 4,917 | py | Python | sprites/characters/tank.py | Ayush8120/PocketTanks | 9498b441e4fbac007879d8963da6edf3913d02e3 | [
"MIT"
] | null | null | null | sprites/characters/tank.py | Ayush8120/PocketTanks | 9498b441e4fbac007879d8963da6edf3913d02e3 | [
"MIT"
] | 1 | 2022-02-11T21:31:03.000Z | 2022-02-12T00:56:54.000Z | sprites/characters/tank.py | Ayush8120/PocketTanks | 9498b441e4fbac007879d8963da6edf3913d02e3 | [
"MIT"
] | 2 | 2019-04-25T22:24:52.000Z | 2022-02-11T21:22:27.000Z | import pygame
from sprites import Y, X
from sprites.characters import Character
TANK_WIDTH = 31
TANK_HEIGHT = 13
TURRET_WIDTH = 13
TURRET_HEIGHT = 9
CANNON_WIDTH = 3 # When the cannon is pointing to 90 degrees
CANNON_HEIGHT = 21 # When cannon is pointing to 90 degrees
LINE_WIDTH = 3
class CannonCharacter(Chara... | 30.540373 | 111 | 0.550539 | import pygame
from sprites import Y, X
from sprites.characters import Character
TANK_WIDTH = 31
TANK_HEIGHT = 13
TURRET_WIDTH = 13
TURRET_HEIGHT = 9
CANNON_WIDTH = 3
CANNON_HEIGHT = 21
LINE_WIDTH = 3
class CannonCharacter(Character):
def __init__(self, vertex, color):
Character.__init__(self, ver... | true | true |
1c27838c7630001818aeae5d451d0ec19687d3de | 2,969 | py | Python | telemetry/examples/browser_tests/simple_browser_test.py | ravitejavalluri/catapult | 246a39a82c2213d913a96fff020a263838dc76e6 | [
"BSD-3-Clause"
] | null | null | null | telemetry/examples/browser_tests/simple_browser_test.py | ravitejavalluri/catapult | 246a39a82c2213d913a96fff020a263838dc76e6 | [
"BSD-3-Clause"
] | null | null | null | telemetry/examples/browser_tests/simple_browser_test.py | ravitejavalluri/catapult | 246a39a82c2213d913a96fff020a263838dc76e6 | [
"BSD-3-Clause"
] | 1 | 2020-07-24T05:13:01.000Z | 2020-07-24T05:13:01.000Z | # Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
import os
from telemetry.testing import serially_executed_browser_test_case
def ConvertPathToTestName(url):
return url.replace('.', '_')
cl... | 39.065789 | 74 | 0.746042 |
import sys
import os
from telemetry.testing import serially_executed_browser_test_case
def ConvertPathToTestName(url):
return url.replace('.', '_')
class SimpleBrowserTest(
serially_executed_browser_test_case.SeriallyExecutedBrowserTestCase):
@classmethod
def GenerateTestCases_JavascriptTest(cls, op... | true | true |
1c27843aed06a80b355bb19d2f2952a85decbd13 | 994 | py | Python | py/0905.sort-array-by-parity.py | ck2w/leetcode | 2d411530b690a2e51b0ae518bf3efaad2edc1083 | [
"MIT"
] | null | null | null | py/0905.sort-array-by-parity.py | ck2w/leetcode | 2d411530b690a2e51b0ae518bf3efaad2edc1083 | [
"MIT"
] | null | null | null | py/0905.sort-array-by-parity.py | ck2w/leetcode | 2d411530b690a2e51b0ae518bf3efaad2edc1083 | [
"MIT"
] | null | null | null | #
# @lc app=leetcode id=905 lang=python3
#
# [905] Sort Array By Parity
#
# https://leetcode.com/problems/sort-array-by-parity/description/
#
# algorithms
# Easy (74.80%)
# Likes: 2446
# Dislikes: 109
# Total Accepted: 412.7K
# Total Submissions: 551.8K
# Testcase Example: '[3,1,2,4]'
#
# Given an integer array ... | 17.75 | 77 | 0.590543 |
class Solution:
def sortArrayByParity(self, nums: List[int]) -> List[int]:
return ([x for x in A if x % 2 == 0] +
[x for x in A if x % 2 == 1])
| true | true |
1c2784f26bf298a17a170078377d724cd4ddf163 | 2,607 | py | Python | acapy_client/api/revocation/patch_revocation_registry_rev_reg_id.py | dbluhm/acapy-client | d92ef607ba2ff1152ec15429f2edb20976991424 | [
"Apache-2.0"
] | null | null | null | acapy_client/api/revocation/patch_revocation_registry_rev_reg_id.py | dbluhm/acapy-client | d92ef607ba2ff1152ec15429f2edb20976991424 | [
"Apache-2.0"
] | null | null | null | acapy_client/api/revocation/patch_revocation_registry_rev_reg_id.py | dbluhm/acapy-client | d92ef607ba2ff1152ec15429f2edb20976991424 | [
"Apache-2.0"
] | null | null | null | from typing import Any, Dict, Optional
import httpx
from ...client import Client
from ...models.rev_reg_result import RevRegResult
from ...models.rev_reg_update_tails_file_uri import RevRegUpdateTailsFileUri
from ...types import Response
def _get_kwargs(
*,
client: Client,
rev_reg_id: str,
json_body... | 22.282051 | 94 | 0.652091 | from typing import Any, Dict, Optional
import httpx
from ...client import Client
from ...models.rev_reg_result import RevRegResult
from ...models.rev_reg_update_tails_file_uri import RevRegUpdateTailsFileUri
from ...types import Response
def _get_kwargs(
*,
client: Client,
rev_reg_id: str,
json_body... | true | true |
1c2785812da74d4f6a824ac332f94f19cafc048f | 1,980 | py | Python | benchmark/startPyquil2950.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startPyquil2950.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startPyquil2950.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=4
# total number=45
import pyquil
from pyquil.api import local_forest_runtime, QVMConnection
from pyquil import Program, get_qc
from pyquil.gates import *
import numpy as np
conn = QVMConnection()
def make_circuit()-> Program:
prog = Program() # circuit begin
prog += H(3) # number=16
prog... | 25.714286 | 64 | 0.563636 |
import pyquil
from pyquil.api import local_forest_runtime, QVMConnection
from pyquil import Program, get_qc
from pyquil.gates import *
import numpy as np
conn = QVMConnection()
def make_circuit()-> Program:
prog = Program()
prog += H(3)
prog += CZ(0,3)
prog += RX(-0.5686282702997527,3)
pro... | true | true |
1c278671841dd48aed2c1af00d0781e996a1afbd | 2,259 | py | Python | live.py | wtong98/bayz | f06e0a60141ba1985f5d3d87441cd18daee3c933 | [
"MIT"
] | null | null | null | live.py | wtong98/bayz | f06e0a60141ba1985f5d3d87441cd18daee3c933 | [
"MIT"
] | null | null | null | live.py | wtong98/bayz | f06e0a60141ba1985f5d3d87441cd18daee3c933 | [
"MIT"
] | null | null | null | r"""
/\
| |
+----|-|---------------------------------------+----------------
/ | | | +----+----+----+----+ | +----+--
/ |----|/--------------|----|----|----|----|-----|--------|----|--
/ | /| | | | | | | | |
|... | 35.296875 | 70 | 0.188579 |
from bayz.music import Band
from bayz.server import BayzServer
server = BayzServer(port=42700)
server.start()
b = Band(pre_gen=3)
b.connect(server)
b.commit() | true | true |
1c2786a2c26006b5181989140e056df18ec4397b | 13,154 | py | Python | api/python/attest/attest_pb2.py | peterfang/eve | 9f4b5a4b2cfdf19032dc5af2bd8843eebaf092e2 | [
"Apache-2.0"
] | null | null | null | api/python/attest/attest_pb2.py | peterfang/eve | 9f4b5a4b2cfdf19032dc5af2bd8843eebaf092e2 | [
"Apache-2.0"
] | null | null | null | api/python/attest/attest_pb2.py | peterfang/eve | 9f4b5a4b2cfdf19032dc5af2bd8843eebaf092e2 | [
"Apache-2.0"
] | null | null | null | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: attest/attest.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message... | 35.077333 | 1,353 | 0.757488 |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf... | true | true |
1c27870337223a8d1ce49a2eb18a4450eaad7066 | 3,749 | py | Python | processing_components/calibration/calibration_control.py | mfarrera/algorithm-reference-library | 7331812aa7cc3501a15d3392cecf6ea65b43f91e | [
"Apache-2.0"
] | null | null | null | processing_components/calibration/calibration_control.py | mfarrera/algorithm-reference-library | 7331812aa7cc3501a15d3392cecf6ea65b43f91e | [
"Apache-2.0"
] | null | null | null | processing_components/calibration/calibration_control.py | mfarrera/algorithm-reference-library | 7331812aa7cc3501a15d3392cecf6ea65b43f91e | [
"Apache-2.0"
] | null | null | null | """Manages the calibration context. This take a string and returns a dictionary containing:
* Predict function
* Invert function
* image_iterator function
* vis_iterator function
"""
import logging
from data_models.memory_data_models import Visibility
from ..calibration.operations import create_gaintable_from_b... | 39.463158 | 116 | 0.647373 |
import logging
from data_models.memory_data_models import Visibility
from ..calibration.operations import create_gaintable_from_blockvisibility, apply_gaintable, qa_gaintable
from ..calibration.calibration import solve_gaintable
from ..visibility.coalesce import convert_visibility_to_blockvisibility, convert_blockvi... | true | true |
1c27873d319c0a1b75c07675260264978b08c68a | 4,999 | py | Python | scripts/make_one_game_vis.py | dkStephanos/pnrRebuild | 2fceef0f601347b14f510ae3cd75d5e1166cf071 | [
"MIT"
] | null | null | null | scripts/make_one_game_vis.py | dkStephanos/pnrRebuild | 2fceef0f601347b14f510ae3cd75d5e1166cf071 | [
"MIT"
] | 7 | 2020-09-25T22:41:33.000Z | 2022-02-09T23:39:36.000Z | scripts/make_one_game_vis.py | dkStephanos/pnrRebuild | 2fceef0f601347b14f510ae3cd75d5e1166cf071 | [
"MIT"
] | null | null | null | """make_one_game_vis.py
Usage:
make_one_game_vis.py --annotate --gameid <gameid> <index> <dir-prefix> <pnr-prefix> <time-frame-radius>
make_one_game_vis.py --from_raw --gameid <gameid> <index> <dir-prefix> <pnr-prefix> <time-frame-radius> <raw_file>
Arguments:
<index> not a very good way of doing things, ... | 36.757353 | 144 | 0.618324 | """make_one_game_vis.py
Usage:
make_one_game_vis.py --annotate --gameid <gameid> <index> <dir-prefix> <pnr-prefix> <time-frame-radius>
make_one_game_vis.py --from_raw --gameid <gameid> <index> <dir-prefix> <pnr-prefix> <time-frame-radius> <raw_file>
Arguments:
<index> not a very good way of doing things, ... | false | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.