hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f703453f1a75155cf6aefd9737dfceaf1d6cbd6a | 13,173 | py | Python | meerk40t/device/moshi/moshiblob.py | aniziorodrigues/meerk40t | ca1180b690a2f25748fe04cb7fdbf270520deab9 | [
"MIT"
] | null | null | null | meerk40t/device/moshi/moshiblob.py | aniziorodrigues/meerk40t | ca1180b690a2f25748fe04cb7fdbf270520deab9 | [
"MIT"
] | null | null | null | meerk40t/device/moshi/moshiblob.py | aniziorodrigues/meerk40t | ca1180b690a2f25748fe04cb7fdbf270520deab9 | [
"MIT"
] | null | null | null | swizzle_table = [
[
b"\x00",
b"\x01",
b"\x40",
b"\x03",
b"\x10",
b"\x21",
b"\x50",
b"\x23",
b"\x04",
b"\x09",
b"\x44",
b"\x0b",
b"\x14",
b"\x29",
b"\x54",
b"\x2b",
],
[
b"\... | 22.556507 | 118 | 0.43407 | swizzle_table = [
[
b"\x00",
b"\x01",
b"\x40",
b"\x03",
b"\x10",
b"\x21",
b"\x50",
b"\x23",
b"\x04",
b"\x09",
b"\x44",
b"\x0b",
b"\x14",
b"\x29",
b"\x54",
b"\x2b",
],
[
b"\... | true | true |
f7034553785fcf61079064947729e6c97bd2edd5 | 18,406 | py | Python | backend/projects/views.py | MParvin/falco | 18665a89829bb4c9b5e28b98499cca378301ccf6 | [
"MIT"
] | 796 | 2019-10-19T19:58:12.000Z | 2022-03-22T14:02:37.000Z | backend/projects/views.py | MParvin/falco | 18665a89829bb4c9b5e28b98499cca378301ccf6 | [
"MIT"
] | 224 | 2019-10-19T17:45:12.000Z | 2022-03-24T20:46:29.000Z | backend/projects/views.py | MParvin/falco | 18665a89829bb4c9b5e28b98499cca378301ccf6 | [
"MIT"
] | 33 | 2019-10-22T21:17:09.000Z | 2021-12-23T06:08:26.000Z | from core.models import User
from django.http import HttpResponse, JsonResponse
from django.shortcuts import get_object_or_404
from drf_yasg import openapi
from drf_yasg.utils import swagger_auto_schema
from rest_framework import permissions, status
from rest_framework.decorators import api_view, permission_classes
fro... | 34.597744 | 105 | 0.674237 | from core.models import User
from django.http import HttpResponse, JsonResponse
from django.shortcuts import get_object_or_404
from drf_yasg import openapi
from drf_yasg.utils import swagger_auto_schema
from rest_framework import permissions, status
from rest_framework.decorators import api_view, permission_classes
fro... | true | true |
f7034669c5fd6b935341eb03811699d28d8c71fd | 8,280 | py | Python | praw/objector.py | nwithan8/praw | 579a6685332aed9c310e34fffbf7a3ebeccd1c1d | [
"BSD-2-Clause"
] | null | null | null | praw/objector.py | nwithan8/praw | 579a6685332aed9c310e34fffbf7a3ebeccd1c1d | [
"BSD-2-Clause"
] | null | null | null | praw/objector.py | nwithan8/praw | 579a6685332aed9c310e34fffbf7a3ebeccd1c1d | [
"BSD-2-Clause"
] | null | null | null | """Provides the Objector class."""
from json import loads
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union
from .exceptions import ClientException, RedditAPIException
from .models.reddit.base import RedditBase
from .util import snake_case_keys
if TYPE_CHECKING: # pragma: no cover
from ... impo... | 41.818182 | 88 | 0.563285 |
from json import loads
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union
from .exceptions import ClientException, RedditAPIException
from .models.reddit.base import RedditBase
from .util import snake_case_keys
if TYPE_CHECKING:
from ... import praw
class Objector:
@classmethod
def p... | true | true |
f70346a442266f05839df1291c42a74b655fecd0 | 109 | py | Python | altair/vega/v2/schema/__init__.py | zjffdu/altair | cd34b03ce011f16616f7c6c59a3c60436b679302 | [
"BSD-3-Clause"
] | 1 | 2021-03-10T00:36:53.000Z | 2021-03-10T00:36:53.000Z | altair/vega/v2/schema/__init__.py | zjffdu/altair | cd34b03ce011f16616f7c6c59a3c60436b679302 | [
"BSD-3-Clause"
] | null | null | null | altair/vega/v2/schema/__init__.py | zjffdu/altair | cd34b03ce011f16616f7c6c59a3c60436b679302 | [
"BSD-3-Clause"
] | 1 | 2017-08-23T17:52:59.000Z | 2017-08-23T17:52:59.000Z | from .core import *
SCHEMA_VERSION = 'v2.6.5'
SCHEMA_URL = 'https://vega.github.io/schema/vega/v2.6.5.json'
| 21.8 | 61 | 0.706422 | from .core import *
SCHEMA_VERSION = 'v2.6.5'
SCHEMA_URL = 'https://vega.github.io/schema/vega/v2.6.5.json'
| true | true |
f70347a71417cd66381de736a77b57d65bdf9ef1 | 1,982 | py | Python | ai_inspector/io_utils.py | Giskard-AI/ai-inspector | 91ccad002b5c705df8f0d0f0f633e1086591528a | [
"Apache-2.0"
] | 12 | 2021-09-24T15:23:16.000Z | 2022-03-27T20:17:33.000Z | ai_inspector/io_utils.py | Giskard-AI/ai-inspector | 91ccad002b5c705df8f0d0f0f633e1086591528a | [
"Apache-2.0"
] | 7 | 2021-09-24T10:30:45.000Z | 2022-03-28T16:14:42.000Z | ai_inspector/io_utils.py | Giskard-AI/ai-inspector | 91ccad002b5c705df8f0d0f0f633e1086591528a | [
"Apache-2.0"
] | 1 | 2022-03-04T14:42:29.000Z | 2022-03-04T14:42:29.000Z | """Various input/output utility functions"""
from typing import Any, Optional
import os
import re
from io import BytesIO
import cloudpickle
import pandas as pd
from zstandard import ZstdCompressor, ZstdDecompressor
COMPRESSION_MAX_OUTPUT_SIZE = 10 ** 9 # 1GB
def pickle_dumps(variable: object) -> bytes:
pickl... | 30.492308 | 99 | 0.676085 |
from typing import Any, Optional
import os
import re
from io import BytesIO
import cloudpickle
import pandas as pd
from zstandard import ZstdCompressor, ZstdDecompressor
COMPRESSION_MAX_OUTPUT_SIZE = 10 ** 9
def pickle_dumps(variable: object) -> bytes:
pickle: bytes = cloudpickle.dumps(variable)
return ... | true | true |
f703489e32317c8fd5bf42962ae54884a961d1d3 | 5,450 | py | Python | spacy/tests/conftest.py | himkt/spaCy | 3f2e3cbd2784ebd2c15aafd5f02830a9369ada84 | [
"MIT"
] | null | null | null | spacy/tests/conftest.py | himkt/spaCy | 3f2e3cbd2784ebd2c15aafd5f02830a9369ada84 | [
"MIT"
] | null | null | null | spacy/tests/conftest.py | himkt/spaCy | 3f2e3cbd2784ebd2c15aafd5f02830a9369ada84 | [
"MIT"
] | 1 | 2019-09-30T00:57:01.000Z | 2019-09-30T00:57:01.000Z | # coding: utf-8
from __future__ import unicode_literals
from io import StringIO, BytesIO
from pathlib import Path
import pytest
from .util import load_test_model
from ..tokens import Doc
from ..strings import StringStore
from .. import util
# These languages are used for generic tokenizer tests – only add a languag... | 25.707547 | 94 | 0.696881 |
from __future__ import unicode_literals
from io import StringIO, BytesIO
from pathlib import Path
import pytest
from .util import load_test_model
from ..tokens import Doc
from ..strings import StringStore
from .. import util
_languages = ['bn', 'da', 'de', 'en', 'es', 'fi', 'fr', 'ga', 'he', 'hu', 'id',
... | true | true |
f7034933752d9c12e8bad83bf1178250a44ed9a7 | 810 | py | Python | loss/__init__.py | lartpang/OpticalFlowBasedVOS | cd4856644b77dd963133797c543aeafb4f402217 | [
"MIT"
] | 6 | 2020-11-19T04:20:52.000Z | 2021-09-24T02:40:11.000Z | loss/__init__.py | lartpang/OpticalFlowBasedVOS | cd4856644b77dd963133797c543aeafb4f402217 | [
"MIT"
] | null | null | null | loss/__init__.py | lartpang/OpticalFlowBasedVOS | cd4856644b77dd963133797c543aeafb4f402217 | [
"MIT"
] | 2 | 2020-11-22T02:02:18.000Z | 2021-11-14T08:56:15.000Z | from loss.BCELoss import cal_bce_loss
from loss.HEL import cal_hel_loss
from loss.IOULoss import cal_iou_loss, cal_weighted_iou_loss
from loss.L12Loss import cal_mae_loss, cal_mse_loss
from loss.SSIM import cal_ssim_loss
supported_loss = dict(
bce=cal_bce_loss,
hel=cal_hel_loss,
iou=cal_iou_loss,
weigh... | 30 | 68 | 0.719753 | from loss.BCELoss import cal_bce_loss
from loss.HEL import cal_hel_loss
from loss.IOULoss import cal_iou_loss, cal_weighted_iou_loss
from loss.L12Loss import cal_mae_loss, cal_mse_loss
from loss.SSIM import cal_ssim_loss
supported_loss = dict(
bce=cal_bce_loss,
hel=cal_hel_loss,
iou=cal_iou_loss,
weigh... | true | true |
f7034a4570f202c8e19ef1cdd9a7c331fc3d1523 | 644 | py | Python | bnu/team_201002/b.py | yofn/pyacm | e573f8fdeea77513711f00c42f128795cbba65a6 | [
"Apache-2.0"
] | null | null | null | bnu/team_201002/b.py | yofn/pyacm | e573f8fdeea77513711f00c42f128795cbba65a6 | [
"Apache-2.0"
] | null | null | null | bnu/team_201002/b.py | yofn/pyacm | e573f8fdeea77513711f00c42f128795cbba65a6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
#https://codeforces.com/group/H9K9zY8tcT/contest/297258/problem/B
#heap?
from queue import PriorityQueue
n = int(input())
g = {}
c = {str(i):0 for i in range(1,n+1)} #children count
for i in range(1,n+1):
k = str(i)
g[k] = input().split() # l[0]=weight; l[1]=no use; l[2:] parents;... | 20.774194 | 69 | 0.495342 |
from queue import PriorityQueue
n = int(input())
g = {}
c = {str(i):0 for i in range(1,n+1)}
for i in range(1,n+1):
k = str(i)
g[k] = input().split()
for p in g[k][2:]:
c[p] += 1
q = PriorityQueue()
[q.put((int(g[k][0]),k)) for k in c if c[k]==0]
m = 0
i = n-1
while not q.empty():
w... | true | true |
f7034b599f605a346b03f2b00d09af42a2e9041c | 191 | py | Python | brats_3D_viewer/forms.py | MartinMa28/BraTS-2018-Demo | f2508a56be51fe3a1ec6c4efc345c300891fba93 | [
"MIT"
] | null | null | null | brats_3D_viewer/forms.py | MartinMa28/BraTS-2018-Demo | f2508a56be51fe3a1ec6c4efc345c300891fba93 | [
"MIT"
] | 5 | 2021-03-18T22:22:18.000Z | 2021-09-22T18:18:27.000Z | brats_3D_viewer/forms.py | MartinMa28/BraTS-2018-Demo | f2508a56be51fe3a1ec6c4efc345c300891fba93 | [
"MIT"
] | null | null | null | from django.forms import ModelForm
from .models import MRIScan
class MRIScanForm(ModelForm):
class Meta:
model = MRIScan
fields = ['case_id', 't1', 't1ce', 't2', 'flair'] | 27.285714 | 57 | 0.65445 | from django.forms import ModelForm
from .models import MRIScan
class MRIScanForm(ModelForm):
class Meta:
model = MRIScan
fields = ['case_id', 't1', 't1ce', 't2', 'flair'] | true | true |
f7034c0fb535b297167117fcf8d9e848802a3ac6 | 1,368 | py | Python | task_set/tasks/fixed/fixed_text_rnn_classification_test.py | egonrian/google-research | 8177adbe9ca0d7e5a9463b54581fe6dd27be0974 | [
"Apache-2.0"
] | 7 | 2020-03-15T12:14:07.000Z | 2021-12-01T07:01:09.000Z | task_set/tasks/fixed/fixed_text_rnn_classification_test.py | JustinDurham/google-research | 9049acf9246c1b75170f0c6757e62a8f619a9db6 | [
"Apache-2.0"
] | 25 | 2020-07-25T08:53:09.000Z | 2022-03-12T00:43:02.000Z | task_set/tasks/fixed/fixed_text_rnn_classification_test.py | JustinDurham/google-research | 9049acf9246c1b75170f0c6757e62a8f619a9db6 | [
"Apache-2.0"
] | 4 | 2021-02-08T10:25:45.000Z | 2021-04-17T14:46:26.000Z | # coding=utf-8
# Copyright 2020 The Google Research 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 applicab... | 36 | 95 | 0.794591 |
from absl.testing import parameterized
from task_set import registry
from task_set.tasks import family_test_utils
from task_set.tasks.fixed import fixed_text_rnn_classification
import tensorflow.compat.v1 as tf
class FixedTextRNNClassificationTest(family_test_utils.SingleTaskTestCase):
def test_r... | true | true |
f7034c7732426e51ff6c5d5e1bc007df9ad1278f | 2,954 | py | Python | Air Canvas (only)/Different Canvas Codes/detect1.py | shanky1947/Air-Draw | ab370f96384414ba5c4e369f5465cd8e28b4f3f0 | [
"Apache-2.0"
] | null | null | null | Air Canvas (only)/Different Canvas Codes/detect1.py | shanky1947/Air-Draw | ab370f96384414ba5c4e369f5465cd8e28b4f3f0 | [
"Apache-2.0"
] | null | null | null | Air Canvas (only)/Different Canvas Codes/detect1.py | shanky1947/Air-Draw | ab370f96384414ba5c4e369f5465cd8e28b4f3f0 | [
"Apache-2.0"
] | null | null | null | # get hsv values using trackbar
import cv2
import numpy as np
import time
# A required callback method that goes into the trackbar function.
def nothing(x):
pass
# Initializing the webcam feed.
cap = cv2.VideoCapture(0)
cap.set(3,1280)
cap.set(4,720)
# Create a window named trackbars.
cv2.namedWindow("Trackbars"... | 32.822222 | 74 | 0.655044 |
import cv2
import numpy as np
import time
def nothing(x):
pass
cap = cv2.VideoCapture(0)
cap.set(3,1280)
cap.set(4,720)
cv2.namedWindow("Trackbars")
cv2.createTrackbar("L - H", "Trackbars", 0, 179, nothing)
cv2.createTrackbar("L - S", "Trackbars", 0, 255, nothing)
cv2.createTrackbar("L - V", "Trackbars"... | true | true |
f7034de21b1549f3d551d2ff41f194de21b6c390 | 12,342 | py | Python | etl/parsers/etw/Microsoft_Windows_Direct3D10_1.py | IMULMUL/etl-parser | 76b7c046866ce0469cd129ee3f7bb3799b34e271 | [
"Apache-2.0"
] | 104 | 2020-03-04T14:31:31.000Z | 2022-03-28T02:59:36.000Z | etl/parsers/etw/Microsoft_Windows_Direct3D10_1.py | IMULMUL/etl-parser | 76b7c046866ce0469cd129ee3f7bb3799b34e271 | [
"Apache-2.0"
] | 7 | 2020-04-20T09:18:39.000Z | 2022-03-19T17:06:19.000Z | etl/parsers/etw/Microsoft_Windows_Direct3D10_1.py | IMULMUL/etl-parser | 76b7c046866ce0469cd129ee3f7bb3799b34e271 | [
"Apache-2.0"
] | 16 | 2020-03-05T18:55:59.000Z | 2022-03-01T10:19:28.000Z | # -*- coding: utf-8 -*-
"""
Microsoft-Windows-Direct3D10_1
GUID : 9b7e4c8f-342c-4106-a19f-4f2704f689f0
"""
from construct import Int8sl, Int8ul, Int16ul, Int16sl, Int32sl, Int32ul, Int64sl, Int64ul, Bytes, Double, Float32l, Struct
from etl.utils import WString, CString, SystemTime, Guid
from etl.dtyp import Sid
from et... | 31.324873 | 123 | 0.59893 |
from construct import Int8sl, Int8ul, Int16ul, Int16sl, Int32sl, Int32ul, Int64sl, Int64ul, Bytes, Double, Float32l, Struct
from etl.utils import WString, CString, SystemTime, Guid
from etl.dtyp import Sid
from etl.parsers.etw.core import Etw, declare, guid
@declare(guid=guid("9b7e4c8f-342c-4106-a19f-4f2704f689f0"),... | true | true |
f7034fac37342e4fdf12c3f5cf813e8c085a1bd0 | 661 | py | Python | jassen/project/blog/migrations/0002_auto_20180424_0154.py | cabilangan112/intern-blog-plus | 444b01835967fd5a57cde28823cd5718ff5d6ae4 | [
"MIT"
] | null | null | null | jassen/project/blog/migrations/0002_auto_20180424_0154.py | cabilangan112/intern-blog-plus | 444b01835967fd5a57cde28823cd5718ff5d6ae4 | [
"MIT"
] | null | null | null | jassen/project/blog/migrations/0002_auto_20180424_0154.py | cabilangan112/intern-blog-plus | 444b01835967fd5a57cde28823cd5718ff5d6ae4 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.4 on 2018-04-24 01:54
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='post',
old_name='sub_Title',
... | 22.793103 | 62 | 0.543116 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='post',
old_name='sub_Title',
new_name='sub_title',
),
migr... | true | true |
f7035180b6f7bf910aba924e67a73260d56aec53 | 1,508 | py | Python | tests/sentry/interfaces/test_template.py | ChadKillingsworth/sentry | ffcb9007a95a83ee267935fe605f8ee8f03a85a5 | [
"BSD-3-Clause"
] | null | null | null | tests/sentry/interfaces/test_template.py | ChadKillingsworth/sentry | ffcb9007a95a83ee267935fe605f8ee8f03a85a5 | [
"BSD-3-Clause"
] | null | null | null | tests/sentry/interfaces/test_template.py | ChadKillingsworth/sentry | ffcb9007a95a83ee267935fe605f8ee8f03a85a5 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import mock
from exam import fixture
from sentry.interfaces.template import Template
from sentry.models import Event
from sentry.testutils import TestCase
class TemplateTest(TestCase):
@fixture
def interface(self):
return Template.to_p... | 33.511111 | 85 | 0.69496 |
from __future__ import absolute_import
import mock
from exam import fixture
from sentry.interfaces.template import Template
from sentry.models import Event
from sentry.testutils import TestCase
class TemplateTest(TestCase):
@fixture
def interface(self):
return Template.to_python(dict(
... | true | true |
f70351c925858ba94b95ff42be6da2e8a34b5975 | 118 | py | Python | dpaste/contribute.py | mozilla-it/dpaste-1 | bfb5015b542dfd074a65588c29038dcb5bfeecea | [
"MIT"
] | null | null | null | dpaste/contribute.py | mozilla-it/dpaste-1 | bfb5015b542dfd074a65588c29038dcb5bfeecea | [
"MIT"
] | 3 | 2021-07-20T21:57:32.000Z | 2021-07-30T15:51:49.000Z | dpaste/contribute.py | mozilla-it/pastebin | bfb5015b542dfd074a65588c29038dcb5bfeecea | [
"MIT"
] | null | null | null | from django.shortcuts import render
def contrib_file(request):
return render(request, "dpaste/contribute.html")
| 19.666667 | 52 | 0.779661 | from django.shortcuts import render
def contrib_file(request):
return render(request, "dpaste/contribute.html")
| true | true |
f7035214ae296532a472484c63d4fbdfda9f742d | 7,045 | py | Python | src/ClientEdit.py | wendellbrito/ICS | fee28c21ac21d11a89b25efa158e1baaa9a5c54d | [
"MIT"
] | 2 | 2020-09-12T13:14:01.000Z | 2020-09-22T12:34:31.000Z | src/ClientEdit.py | wendellbrito/ICS | fee28c21ac21d11a89b25efa158e1baaa9a5c54d | [
"MIT"
] | 2 | 2020-10-10T20:07:29.000Z | 2022-03-19T23:51:42.000Z | src/ClientEdit.py | wendellbrito/ICS | fee28c21ac21d11a89b25efa158e1baaa9a5c54d | [
"MIT"
] | null | null | null | from tkinter import messagebox
from ClientInsert import *
class ClientEdit(ClientInsert):
def __init__(self, db, id_cliente, master):
super().__init__(db, master)
self.title('Editar Cliente')
self.__id_cliente = id_cliente
self.__list = master
table_cliente = db.s... | 36.128205 | 91 | 0.538964 | from tkinter import messagebox
from ClientInsert import *
class ClientEdit(ClientInsert):
def __init__(self, db, id_cliente, master):
super().__init__(db, master)
self.title('Editar Cliente')
self.__id_cliente = id_cliente
self.__list = master
table_cliente = db.s... | true | true |
f703531b591af3d5317bed220eaa477c0403e4d5 | 2,576 | py | Python | stock_predictions/web/template.py | abakhru/stock_prediction | bfb4483ac888bc67e2a8928fdf037d23acbf48f9 | [
"MIT"
] | 1 | 2020-07-14T09:05:56.000Z | 2020-07-14T09:05:56.000Z | stock_predictions/web/template.py | abakhru/stock_prediction | bfb4483ac888bc67e2a8928fdf037d23acbf48f9 | [
"MIT"
] | null | null | null | stock_predictions/web/template.py | abakhru/stock_prediction | bfb4483ac888bc67e2a8928fdf037d23acbf48f9 | [
"MIT"
] | null | null | null | template = """<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Title of the document</title>
<script type="text/javascript" src="https://s3.tradingview.com/tv.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/milligram/1.3.0/milligram.min.css">
<style>
.tradingvi... | 24.533333 | 195 | 0.572593 | template = """<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Title of the document</title>
<script type="text/javascript" src="https://s3.tradingview.com/tv.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/milligram/1.3.0/milligram.min.css">
<style>
.tradingvi... | true | true |
f7035407860da263626ea5a54711bf08f2144cde | 2,342 | py | Python | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/update.py | viewdy/phantomjs | eddb0db1d253fd0c546060a4555554c8ee08c13c | [
"BSD-3-Clause"
] | 1 | 2015-05-27T13:52:20.000Z | 2015-05-27T13:52:20.000Z | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/update.py | mrampersad/phantomjs | dca6f77a36699eb4e1c46f7600cca618f01b0ac3 | [
"BSD-3-Clause"
] | null | null | null | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/update.py | mrampersad/phantomjs | dca6f77a36699eb4e1c46f7600cca618f01b0ac3 | [
"BSD-3-Clause"
] | 1 | 2017-03-19T13:03:23.000Z | 2017-03-19T13:03:23.000Z | # Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and th... | 42.581818 | 137 | 0.751921 |
import logging
from webkitpy.tool.steps.abstractstep import AbstractStep
from webkitpy.tool.steps.options import Options
_log = logging.getLogger(__name__)
class Update(AbstractStep):
@classmethod
def options(cls):
return AbstractStep.options() + [
Options.non... | true | true |
f70354f7311915d757b4bd5757b16caa8a12167e | 255 | py | Python | labs/Topic05-data_structures/lab5_02_summer_months.py | danielmccallion/pands-problems | 738c45072f22b2511a5d8fefba8fce2482a1a8cb | [
"MIT"
] | null | null | null | labs/Topic05-data_structures/lab5_02_summer_months.py | danielmccallion/pands-problems | 738c45072f22b2511a5d8fefba8fce2482a1a8cb | [
"MIT"
] | null | null | null | labs/Topic05-data_structures/lab5_02_summer_months.py | danielmccallion/pands-problems | 738c45072f22b2511a5d8fefba8fce2482a1a8cb | [
"MIT"
] | null | null | null | # Daniel Mc Callion
# This program prints the summer months
months = ("January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December")
summer = months[4:7]
for month in summer:
print(month)
| 12.142857 | 39 | 0.654902 |
months = ("January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December")
summer = months[4:7]
for month in summer:
print(month)
| true | true |
f7035500220f9f8a16c236d0967d581dfd9a08f8 | 1,277 | py | Python | jupiter_orm/jupiter_orm/Field.py | dianbaer/fast | 362bd0ca9f6039ea70cd665438dd8731e4c144a5 | [
"MIT"
] | 226 | 2017-10-26T12:05:26.000Z | 2021-12-06T15:14:54.000Z | jupiter_orm/jupiter_orm/Field.py | dianbaer/fast | 362bd0ca9f6039ea70cd665438dd8731e4c144a5 | [
"MIT"
] | null | null | null | jupiter_orm/jupiter_orm/Field.py | dianbaer/fast | 362bd0ca9f6039ea70cd665438dd8731e4c144a5 | [
"MIT"
] | 73 | 2017-10-27T12:38:59.000Z | 2019-12-23T07:29:48.000Z | class FieldC():
def __init__(self, name, column_type, primary_key, default):
self.name = name
self.column_type = column_type
self.primary_key = primary_key
self.default = default
def __str__(self):
return '<%s, %s:%s>' % (self.__class__.__name__, self.column_type... | 31.925 | 88 | 0.657009 | class FieldC():
def __init__(self, name, column_type, primary_key, default):
self.name = name
self.column_type = column_type
self.primary_key = primary_key
self.default = default
def __str__(self):
return '<%s, %s:%s>' % (self.__class__.__name__, self.column_type... | true | true |
f7035501b1ba8b994d2ab016cc823cd9eb4351cf | 1,937 | py | Python | api/tests/test_user.py | josayko/SoftDeskAPI | a168abb09b09c5cb5f8f4957d028ebde02f3d128 | [
"MIT"
] | null | null | null | api/tests/test_user.py | josayko/SoftDeskAPI | a168abb09b09c5cb5f8f4957d028ebde02f3d128 | [
"MIT"
] | null | null | null | api/tests/test_user.py | josayko/SoftDeskAPI | a168abb09b09c5cb5f8f4957d028ebde02f3d128 | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model
from django.test import TestCase
class UsersManagersTests(TestCase):
"""
Test user creation manager
"""
def test_create_user(self):
"""
Creates a new user with email as primary identifier instead of username
"""
User = get... | 37.980392 | 101 | 0.649974 | from django.contrib.auth import get_user_model
from django.test import TestCase
class UsersManagersTests(TestCase):
def test_create_user(self):
User = get_user_model()
user = User.objects.create_user(email="normal@user.com", password="foo")
self.assertEqual(user.email, "normal@user.com")
... | true | true |
f7035541b25714f015c602c461c950ce0dc803b9 | 4,098 | py | Python | src/transfer_rna_identification.py | simoncchu/xRNAGlass | 603f4a7909e307f510365172ab9a8f912e80591d | [
"MIT"
] | null | null | null | src/transfer_rna_identification.py | simoncchu/xRNAGlass | 603f4a7909e307f510365172ab9a8f912e80591d | [
"MIT"
] | null | null | null | src/transfer_rna_identification.py | simoncchu/xRNAGlass | 603f4a7909e307f510365172ab9a8f912e80591d | [
"MIT"
] | null | null | null | import pysam
from optparse import OptionParser
from x_gene_annotation import *
class mRNA_Transfer():
def call_transfer_mut(self, sf_rna, sf_dna_up, sf_dna_bottom, sf_candidate):
m_rna_vars = self.load_variants(sf_rna)
m_DNA_RNA_ovlp_vars = self.get_overlap_variants(sf_dna_bottom, m_rna_vars)
... | 39.786408 | 88 | 0.60859 | import pysam
from optparse import OptionParser
from x_gene_annotation import *
class mRNA_Transfer():
def call_transfer_mut(self, sf_rna, sf_dna_up, sf_dna_bottom, sf_candidate):
m_rna_vars = self.load_variants(sf_rna)
m_DNA_RNA_ovlp_vars = self.get_overlap_variants(sf_dna_bottom, m_rna_vars)
... | true | true |
f703555c16bc4c3f133e0bfe1c68b46fa0864538 | 2,049 | py | Python | nipype/interfaces/niftyfit/tests/test_asl.py | abelalez/nipype | 878271bd906768f11c4cabd04e5d1895551ce8a7 | [
"Apache-2.0"
] | 8 | 2019-05-29T09:38:30.000Z | 2021-01-20T03:36:59.000Z | nipype/interfaces/niftyfit/tests/test_asl.py | abelalez/nipype | 878271bd906768f11c4cabd04e5d1895551ce8a7 | [
"Apache-2.0"
] | 12 | 2021-03-09T03:01:16.000Z | 2022-03-11T23:59:36.000Z | nipype/interfaces/niftyfit/tests/test_asl.py | abelalez/nipype | 878271bd906768f11c4cabd04e5d1895551ce8a7 | [
"Apache-2.0"
] | 2 | 2017-09-23T16:22:00.000Z | 2019-08-01T14:18:52.000Z | # -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
import pytest
from ....testing import example_data
from ...niftyreg import get_custom_path
from ..asl import FitAsl
from ...niftyreg.tests.test_regutils import no_nifty_tool
@py... | 29.271429 | 76 | 0.652513 |
import pytest
from ....testing import example_data
from ...niftyreg import get_custom_path
from ..asl import FitAsl
from ...niftyreg.tests.test_regutils import no_nifty_tool
@pytest.mark.skipif(
no_nifty_tool(cmd='fit_asl'), reason="niftyfit is not installed")
def test_fit_asl():
fit_asl = FitAsl()... | true | true |
f70355a4ebb7124ef003a7bb016d5179dd150016 | 3,341 | py | Python | tflite-onnx/onnx_tflite/tflite/DimensionMetadata.py | jwj04ok/ONNX_Convertor | 067a17e16dfc8aa80e36f44c4523959daf7359f5 | [
"MIT"
] | 193 | 2017-12-20T16:46:20.000Z | 2022-03-29T07:40:54.000Z | tinyengine/tflite/DimensionMetadata.py | liuyy3364/mcunet | f53f9e20e8e912bdb111b4c32da75e71e9a59597 | [
"Apache-2.0"
] | 141 | 2017-12-21T08:00:20.000Z | 2021-06-15T14:53:03.000Z | tinyengine/tflite/DimensionMetadata.py | liuyy3364/mcunet | f53f9e20e8e912bdb111b4c32da75e71e9a59597 | [
"Apache-2.0"
] | 55 | 2017-12-22T18:40:13.000Z | 2022-01-17T05:43:51.000Z | # automatically generated by the FlatBuffers compiler, do not modify
# namespace: tflite
import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()
class DimensionMetadata(object):
__slots__ = ['_tab']
@classmethod
def GetRootAsDimensionMetadata(cls, buf, offset):
n = fla... | 40.253012 | 167 | 0.70877 |
import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()
class DimensionMetadata(object):
__slots__ = ['_tab']
@classmethod
def GetRootAsDimensionMetadata(cls, buf, offset):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x = DimensionMetad... | true | true |
f70356c78dbf90e925826ccdd072b16ddefaaec6 | 529 | py | Python | openslides/agenda/personal_info.py | DerPate/OpenSlides | 2733a47d315fec9b8f3cb746fd5f3739be225d65 | [
"MIT"
] | 1 | 2015-03-22T02:07:23.000Z | 2015-03-22T02:07:23.000Z | openslides/agenda/personal_info.py | frauenknecht/OpenSlides | 6521d6b095bca33dc0c5f09f59067551800ea1e3 | [
"MIT"
] | null | null | null | openslides/agenda/personal_info.py | frauenknecht/OpenSlides | 6521d6b095bca33dc0c5f09f59067551800ea1e3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy
from openslides.utils.personal_info import PersonalInfo
from .models import Item
class AgendaPersonalInfo(PersonalInfo):
"""
Class for personal info block for the agenda app.
"""
headline = ugettext_lazy('I am on the list of... | 25.190476 | 83 | 0.705104 |
from django.utils.translation import ugettext_lazy
from openslides.utils.personal_info import PersonalInfo
from .models import Item
class AgendaPersonalInfo(PersonalInfo):
headline = ugettext_lazy('I am on the list of speakers of the following items')
default_weight = 10
def get_queryset(self):
... | true | true |
f703583cefb84f5df202bae943b7c97370e8d38a | 1,104 | py | Python | exercises/test_06_01.py | jp2321/dl4cv_dev | c8d7dd74d4b591681101770ff2c3603637974e72 | [
"MIT"
] | 1 | 2022-03-28T12:37:04.000Z | 2022-03-28T12:37:04.000Z | exercises/test_06_01.py | jp2321/dl4cv_dev | c8d7dd74d4b591681101770ff2c3603637974e72 | [
"MIT"
] | null | null | null | exercises/test_06_01.py | jp2321/dl4cv_dev | c8d7dd74d4b591681101770ff2c3603637974e72 | [
"MIT"
] | 1 | 2020-04-25T04:40:34.000Z | 2020-04-25T04:40:34.000Z | def test():
from tensorflow.keras import datasets
assert model.get_layer("class_prediction").get_config()["units"]==43, "Check the number of output classes"
assert model.get_layer("class_prediction").get_config()["activation"]=="softmax", "Check your activation function"
assert model.output[0].name== '... | 69 | 118 | 0.719203 | def test():
from tensorflow.keras import datasets
assert model.get_layer("class_prediction").get_config()["units"]==43, "Check the number of output classes"
assert model.get_layer("class_prediction").get_config()["activation"]=="softmax", "Check your activation function"
assert model.output[0].name== '... | true | true |
f7035a76ad270c53ba05886eaab94d613aec6fa7 | 699 | py | Python | backend/authentication/serializers.py | Zoki92/Calories-Counter | 4b10c5661869c5a0645e59abb434ca26fd497f37 | [
"MIT"
] | null | null | null | backend/authentication/serializers.py | Zoki92/Calories-Counter | 4b10c5661869c5a0645e59abb434ca26fd497f37 | [
"MIT"
] | 6 | 2021-03-10T17:12:50.000Z | 2022-03-02T08:30:05.000Z | backend/authentication/serializers.py | Zoki92/Calories-Counter | 4b10c5661869c5a0645e59abb434ca26fd497f37 | [
"MIT"
] | null | null | null | from rest_framework import serializers
from django.contrib.auth import get_user_model
from .models import CustomUser
User = get_user_model()
class TokenSerializer(serializers.Serializer):
"""
This serializer serializes the token data
"""
access = serializers.CharField(max_length=255)
refresh = se... | 24.103448 | 53 | 0.695279 | from rest_framework import serializers
from django.contrib.auth import get_user_model
from .models import CustomUser
User = get_user_model()
class TokenSerializer(serializers.Serializer):
access = serializers.CharField(max_length=255)
refresh = serializers.CharField(max_length=255)
class UserSerializer(ser... | true | true |
f7035accd560e6660402bbd8023959cb49a7b842 | 2,512 | py | Python | setup.py | ccthien/jaeger-client-python | 51d9027c3e0b87f6721dd14e7bc2b3303ce682c2 | [
"Apache-2.0"
] | 2 | 2020-05-24T11:39:13.000Z | 2021-02-17T19:52:41.000Z | setup.py | ccthien/jaeger-client-python | 51d9027c3e0b87f6721dd14e7bc2b3303ce682c2 | [
"Apache-2.0"
] | 4 | 2020-12-03T16:06:36.000Z | 2020-12-06T02:15:42.000Z | setup.py | ccthien/jaeger-client-python | 51d9027c3e0b87f6721dd14e7bc2b3303ce682c2 | [
"Apache-2.0"
] | 3 | 2018-10-23T23:04:20.000Z | 2019-03-15T15:50:17.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
from setuptools import setup, find_packages
version = None
with open('jaeger_client/__init__.py', 'r') as f:
for line in f:
m = re.match(r'^__version__\s*=\s*(["\'])([^"\']+)\1', line)
if m:
version = m.group(2)
break
... | 33.493333 | 118 | 0.574841 |
import re
from setuptools import setup, find_packages
version = None
with open('jaeger_client/__init__.py', 'r') as f:
for line in f:
m = re.match(r'^__version__\s*=\s*(["\'])([^"\']+)\1', line)
if m:
version = m.group(2)
break
assert version is not None, \
'Could no... | true | true |
f7035af3b56b3d69f5dea99514b6a6f709912518 | 118,762 | py | Python | nova/virt/libvirt/config.py | Pushparajkvp/nova | c80d0be3f4ff34d2a5b4ee60379cc8481dc7a0b7 | [
"Apache-2.0"
] | 1 | 2021-06-10T17:08:14.000Z | 2021-06-10T17:08:14.000Z | nova/virt/libvirt/config.py | Pushparajkvp/nova | c80d0be3f4ff34d2a5b4ee60379cc8481dc7a0b7 | [
"Apache-2.0"
] | null | null | null | nova/virt/libvirt/config.py | Pushparajkvp/nova | c80d0be3f4ff34d2a5b4ee60379cc8481dc7a0b7 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2012-2013 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 34.584158 | 79 | 0.569517 |
import time
from collections import OrderedDict
from lxml import etree
from oslo_utils import strutils
from oslo_utils import units
from nova import exception
from nova.i18n import _
from nova.pci import utils as pci_utils
from nova.virt import hardware
NOVA_NS = "http://openstack.org/xmlns/libvirt/... | true | true |
f7035baa2430208a8619aaa2de77421f4f732be8 | 4,889 | py | Python | king_phisher/server/plugins.py | padfoot999/king-phisher | d09ca94900c32bc5b292685e0ec84b9ad093301f | [
"BSD-3-Clause"
] | 1 | 2016-10-20T14:58:09.000Z | 2016-10-20T14:58:09.000Z | king_phisher/server/plugins.py | padfoot999/king-phisher | d09ca94900c32bc5b292685e0ec84b9ad093301f | [
"BSD-3-Clause"
] | null | null | null | king_phisher/server/plugins.py | padfoot999/king-phisher | d09ca94900c32bc5b292685e0ec84b9ad093301f | [
"BSD-3-Clause"
] | 1 | 2019-12-17T21:33:24.000Z | 2019-12-17T21:33:24.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# king_phisher/server/plugins.py
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, t... | 38.801587 | 143 | 0.746574 |
import os
from king_phisher import errors
from king_phisher import find
from king_phisher import plugins
class ServerPlugin(plugins.PluginBase):
_logging_prefix = 'KingPhisher.Plugins.Server.'
def __init__(self, root_config):
self.root_config = root_config
self.server = None
su... | true | true |
f7035bae9ef133b15cd82ef673ee423ea88deb57 | 1,155 | py | Python | plasma/child_chain/create_initial_make_orders.py | kevjue/plasma-mvp | 510934766a8d9b28969658216566a74b2d450384 | [
"Apache-2.0"
] | 1 | 2018-07-24T14:19:15.000Z | 2018-07-24T14:19:15.000Z | plasma/child_chain/create_initial_make_orders.py | kevjue/plasma-dex | 510934766a8d9b28969658216566a74b2d450384 | [
"Apache-2.0"
] | null | null | null | plasma/child_chain/create_initial_make_orders.py | kevjue/plasma-dex | 510934766a8d9b28969658216566a74b2d450384 | [
"Apache-2.0"
] | null | null | null | import click
import sys
from web3 import Web3
from plasma.client.client import Client
from plasma.utils import utils
@click.command()
@click.option('--token_address', help="The ethereum address of the pdex token smart contract", required=True)
@click.option('--root_chain_address', help="The ethereum address of the ro... | 42.777778 | 150 | 0.758442 | import click
import sys
from web3 import Web3
from plasma.client.client import Client
from plasma.utils import utils
@click.command()
@click.option('--token_address', help="The ethereum address of the pdex token smart contract", required=True)
@click.option('--root_chain_address', help="The ethereum address of the ro... | true | true |
f7035c581a4ed9b8309dd60d8abb56daf29c23f9 | 1,763 | py | Python | integreat_cms/cms/models/feedback/search_result_feedback.py | Carlosbogo/integreat-cms | 066f188b138e105e72f5420bc36d25709f25402d | [
"Apache-2.0"
] | 1 | 2022-01-16T01:15:21.000Z | 2022-01-16T01:15:21.000Z | integreat_cms/cms/models/feedback/search_result_feedback.py | Carlosbogo/integreat-cms | 066f188b138e105e72f5420bc36d25709f25402d | [
"Apache-2.0"
] | null | null | null | integreat_cms/cms/models/feedback/search_result_feedback.py | Carlosbogo/integreat-cms | 066f188b138e105e72f5420bc36d25709f25402d | [
"Apache-2.0"
] | null | null | null | from django.db import models
from django.utils.translation import ugettext_lazy as _
from .feedback import Feedback
class SearchResultFeedback(Feedback):
"""
Database model representing feedback about search results (e.g. empty results).
"""
search_query = models.CharField(max_length=1000, verbose_n... | 31.482143 | 131 | 0.653432 | from django.db import models
from django.utils.translation import ugettext_lazy as _
from .feedback import Feedback
class SearchResultFeedback(Feedback):
search_query = models.CharField(max_length=1000, verbose_name=_("search term"))
@property
def object_name(self):
return _("Search results for... | true | true |
f7035c68a7fc1602faabfc647ce3667f17f3a9f2 | 8,429 | py | Python | src/pca/todoJunto.py | 123972/PCA-nutricion | aff3c51a71c887c3fa367dbf9d599be5915c80cc | [
"MIT"
] | null | null | null | src/pca/todoJunto.py | 123972/PCA-nutricion | aff3c51a71c887c3fa367dbf9d599be5915c80cc | [
"MIT"
] | 2 | 2021-05-11T16:00:55.000Z | 2021-08-23T20:45:22.000Z | src/pca/todoJunto.py | 123972/PCA-nutricion | aff3c51a71c887c3fa367dbf9d599be5915c80cc | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
import codecs
import sys
import sklearn as sk
import pandas as pd
import numpy as np
import math
from sklearn import preprocessing
from sklearn.decomposition import PCA
from src.pca.algoritmo_QR import eigenvectores_eigenvalores_QR_vf
from src.pca.metodo_potencia_deflation imp... | 35.267782 | 161 | 0.696643 |
import codecs
import sys
import sklearn as sk
import pandas as pd
import numpy as np
import math
from sklearn import preprocessing
from sklearn.decomposition import PCA
from src.pca.algoritmo_QR import eigenvectores_eigenvalores_QR_vf
from src.pca.metodo_potencia_deflation import power_iteration
from src.pca.met... | true | true |
f7035c8f97025b538d6a14199b2f82b3876c816c | 12,847 | py | Python | pythonProject/resturant_management/resturant.py | slowy07/pythonApps | 22f9766291dbccd8185035745950c5ee4ebd6a3e | [
"MIT"
] | 10 | 2020-10-09T11:05:18.000Z | 2022-02-13T03:22:10.000Z | pythonProject/resturant_management/resturant.py | khairanabila/pythonApps | f90b8823f939b98f7bf1dea7ed35fe6e22e2f730 | [
"MIT"
] | null | null | null | pythonProject/resturant_management/resturant.py | khairanabila/pythonApps | f90b8823f939b98f7bf1dea7ed35fe6e22e2f730 | [
"MIT"
] | 6 | 2020-11-26T12:49:43.000Z | 2022-03-06T06:46:43.000Z | from tkinter import*
import random
import time
root = Tk()
root.geometry("1600x700+0+0")
root.title("Restaurant Management System")
Tops = Frame(root,bg="white",width = 1600,height=50,relief=SUNKEN)
Tops.pack(side=TOP)
f1 = Frame(root,width = 900,height=700,relief=SUNKEN)
f1.pack(side=LEFT)
f2 = Frame(root ,width =... | 45.077193 | 142 | 0.639838 | from tkinter import*
import random
import time
root = Tk()
root.geometry("1600x700+0+0")
root.title("Restaurant Management System")
Tops = Frame(root,bg="white",width = 1600,height=50,relief=SUNKEN)
Tops.pack(side=TOP)
f1 = Frame(root,width = 900,height=700,relief=SUNKEN)
f1.pack(side=LEFT)
f2 = Frame(root ,width =... | true | true |
f7035dd21c738a30b253fd556306a70e7a3eae5a | 8,589 | py | Python | graph_objs/layout/scene/xaxis/title/_font.py | wwwidonja/changed_plotly | 1bda35a438539a97c84a3ab3952e95e8848467bd | [
"MIT"
] | null | null | null | graph_objs/layout/scene/xaxis/title/_font.py | wwwidonja/changed_plotly | 1bda35a438539a97c84a3ab3952e95e8848467bd | [
"MIT"
] | null | null | null | graph_objs/layout/scene/xaxis/title/_font.py | wwwidonja/changed_plotly | 1bda35a438539a97c84a3ab3952e95e8848467bd | [
"MIT"
] | null | null | null | from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType
import copy as _copy
class Font(_BaseLayoutHierarchyType):
# class properties
# --------------------
_parent_path_str = "layout.scene.xaxis.title"
_path_str = "layout.scene.xaxis.title.font"
_valid_props = {"colo... | 37.50655 | 84 | 0.567703 | from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType
import copy as _copy
class Font(_BaseLayoutHierarchyType):
_parent_path_str = "layout.scene.xaxis.title"
_path_str = "layout.scene.xaxis.title.font"
_valid_props = {"color", "family", "size"}
@pr... | true | true |
f7035e5aadcd002fafb902e2e88b8bdb13c19cee | 2,823 | py | Python | qualifier/deploy/cohorte-home/repo/jsonrpclib/utils.py | isandlaTech/cohorte-devtools | 9ba9021369188d2f0ad5c845ef242fd5a7097b57 | [
"Apache-2.0"
] | 1 | 2017-03-04T14:37:15.000Z | 2017-03-04T14:37:15.000Z | qualifier/deploy/cohorte-home/repo/jsonrpclib/utils.py | isandlaTech/cohorte-devtools | 9ba9021369188d2f0ad5c845ef242fd5a7097b57 | [
"Apache-2.0"
] | 4 | 2017-08-21T08:17:14.000Z | 2018-03-02T13:51:43.000Z | qualifier/deploy/cohorte-home/repo/jsonrpclib/utils.py | isandlaTech/cohorte-devtools | 9ba9021369188d2f0ad5c845ef242fd5a7097b57 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -- Content-Encoding: UTF-8 --
"""
Utility methods, for compatibility between Python version
:author: Thomas Calmant
:copyright: Copyright 2015, isandlaTech
:license: Apache License 2.0
:version: 0.2.6
..
Copyright 2015 isandlaTech
Licensed under the Apache License, Version 2.0 (the "Lice... | 22.404762 | 80 | 0.561814 |
__version_info__ = (0, 2, 6)
__version__ = ".".join(str(x) for x in __version_info__)
__docformat__ = "restructuredtext en"
import sys
if sys.version_info[0] < 3:
import types
try:
STRING_TYPES = (
types.StringType,
types.UnicodeType
)
except Nam... | true | true |
f7035edc99f19ee433a47167a215f08d1d270643 | 10,949 | py | Python | openstack_dashboard/test/api_tests/nova_rest_tests.py | Hodorable/0602 | 3b1e4cb7458e4f456bfebc52fc2902205c36cc15 | [
"Apache-2.0"
] | 1 | 2017-12-07T05:21:58.000Z | 2017-12-07T05:21:58.000Z | openstack_dashboard/test/api_tests/nova_rest_tests.py | Hodorable/0602 | 3b1e4cb7458e4f456bfebc52fc2902205c36cc15 | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/test/api_tests/nova_rest_tests.py | Hodorable/0602 | 3b1e4cb7458e4f456bfebc52fc2902205c36cc15 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014, Rackspace, US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | 40.106227 | 77 | 0.608823 |
import mock
from django.conf import settings
from openstack_dashboard.api.rest import nova
from openstack_dashboard.test import helpers as test
class NovaRestTestCase(test.TestCase):
@mock.patch.object(nova.api, 'nova')
def test_keypair_get(self, nc):
request = self.mock_... | true | true |
f7035f37e23c97b58921b48200d5a78a5a0db7b7 | 1,270 | py | Python | GatewayPlacement.py | vindem/eeplacement | 11d6da56156ba29d8b2eaea657ed3df37110f666 | [
"MIT"
] | null | null | null | GatewayPlacement.py | vindem/eeplacement | 11d6da56156ba29d8b2eaea657ed3df37110f666 | [
"MIT"
] | null | null | null | GatewayPlacement.py | vindem/eeplacement | 11d6da56156ba29d8b2eaea657ed3df37110f666 | [
"MIT"
] | null | null | null | import IoTSensor
import LORAGateway
class GatewayPlacement:
def __init__(self, sensor_list):
self._sensor_list = sensor_list
self._gateway_list = []
def add_gateway(self, gateway):
self._gateway_list.append(gateway)
def remove_gateway(self, gateway):
self._gateway_list.re... | 28.863636 | 102 | 0.638583 | import IoTSensor
import LORAGateway
class GatewayPlacement:
def __init__(self, sensor_list):
self._sensor_list = sensor_list
self._gateway_list = []
def add_gateway(self, gateway):
self._gateway_list.append(gateway)
def remove_gateway(self, gateway):
self._gateway_list.re... | true | true |
f7035f4a31b4a9cb5b6bc7dac024872f9c49f775 | 7,873 | py | Python | tcfl/target_ext_tunnel.py | sriiora/tcf | e607ce04f97dbb4910d94428c0600a6a7145a825 | [
"Apache-2.0"
] | null | null | null | tcfl/target_ext_tunnel.py | sriiora/tcf | e607ce04f97dbb4910d94428c0600a6a7145a825 | [
"Apache-2.0"
] | null | null | null | tcfl/target_ext_tunnel.py | sriiora/tcf | e607ce04f97dbb4910d94428c0600a6a7145a825 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/python3
#
# Copyright (c) 2017 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
"""
Create and remove network tunnels to the target via the server
--------------------------------------------------------------
"""
from . import tc
from . import ttb_client
class tunnel(tc.target_extension_c):
... | 40.374359 | 79 | 0.579322 |
from . import tc
from . import ttb_client
class tunnel(tc.target_extension_c):
def __init__(self, target):
self.target = target
self.ip_addr = None
def _ip_addr_get(self, ip_addr):
if ip_addr:
return ip_addr
if self.ip_addr:
... | true | true |
f7035f91612f64318ed215c8124c2133a57e85cd | 1,574 | py | Python | 11-Numpy Basic Statistics.py | mnabavi84/dcamp-intro-python | 218b67106061d45cfa18a1b1d46487900f9aa539 | [
"MIT"
] | null | null | null | 11-Numpy Basic Statistics.py | mnabavi84/dcamp-intro-python | 218b67106061d45cfa18a1b1d46487900f9aa539 | [
"MIT"
] | null | null | null | 11-Numpy Basic Statistics.py | mnabavi84/dcamp-intro-python | 218b67106061d45cfa18a1b1d46487900f9aa539 | [
"MIT"
] | null | null | null | # np_baseball is available
# Import numpy
import numpy as np
# Create np_height_in from np_baseball
np_height_in = np_baseball[:,0]
# Print out the mean of np_height_in
print(np.mean(np_height_in))
# Print out the median of np_height_in
print(np.median(np_height_in))
# np_baseball is available
#... | 27.137931 | 74 | 0.719187 |
import numpy as np
np_height_in = np_baseball[:,0]
print(np.mean(np_height_in))
print(np.median(np_height_in))
import numpy as np
avg = np.mean(np_baseball[:,0])
print("Average: " + str(avg))
med = np.median(np_baseball[:,0])
print("Median: " + str(med))
stddev = np.std(np_basebal... | true | true |
f7035fb6f14b4a4c5b91bd1b9f6eb9aa52b46bd1 | 8,853 | py | Python | InvenTree/InvenTree/urls.py | carlos-riquelme/InvenTree | 724dd2a9c82e4c10e14bd6aba8f48553b183fef9 | [
"MIT"
] | 5 | 2020-08-14T06:18:57.000Z | 2022-01-11T01:22:56.000Z | InvenTree/InvenTree/urls.py | carlos-riquelme/InvenTree | 724dd2a9c82e4c10e14bd6aba8f48553b183fef9 | [
"MIT"
] | 27 | 2021-04-12T22:05:39.000Z | 2022-03-13T20:33:54.000Z | InvenTree/InvenTree/urls.py | carlos-riquelme/InvenTree | 724dd2a9c82e4c10e14bd6aba8f48553b183fef9 | [
"MIT"
] | 1 | 2021-12-22T12:22:21.000Z | 2021-12-22T12:22:21.000Z | """
Top-level URL lookup for InvenTree application.
Passes URL lookup downstream to each app as required.
"""
from django.conf.urls import url, include
from django.urls import path
from django.contrib import admin
from company.urls import company_urls
from company.urls import manufacturer_part_urls
from company.url... | 43.185366 | 162 | 0.726872 |
from django.conf.urls import url, include
from django.urls import path
from django.contrib import admin
from company.urls import company_urls
from company.urls import manufacturer_part_urls
from company.urls import supplier_part_urls
from common.urls import common_urls
from part.urls import part_urls
from stock.url... | true | true |
f7035fc0d709e7e2bbf5842adca7c69a98bf0b3f | 3,450 | py | Python | experiments/mnist_simple/class_imbalance.py | kili-technology/active-learning | 72dce7d91b988264dd7fa1a972d9af45e9648c4c | [
"Apache-2.0"
] | 3 | 2020-09-11T07:30:54.000Z | 2021-04-17T07:45:05.000Z | experiments/mnist_simple/class_imbalance.py | kili-technology/active-learning | 72dce7d91b988264dd7fa1a972d9af45e9648c4c | [
"Apache-2.0"
] | null | null | null | experiments/mnist_simple/class_imbalance.py | kili-technology/active-learning | 72dce7d91b988264dd7fa1a972d9af45e9648c4c | [
"Apache-2.0"
] | null | null | null | import os
import logging
import pickle
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import al
from al.dataset import mnist
from al.model.model_zoo.simple_cnn import ConvModel
from al.model.mnist import MnistLearner
from al.dataset.mnist import MnistDataset
from al.train... | 32.242991 | 83 | 0.642319 | import os
import logging
import pickle
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import al
from al.dataset import mnist
from al.model.model_zoo.simple_cnn import ConvModel
from al.model.mnist import MnistLearner
from al.dataset.mnist import MnistDataset
from al.train... | true | true |
f70361664e2ce8762ac750784a5e6dca9c3eba02 | 148,257 | py | Python | distributed/worker.py | hercules261188/distributed | e5eb40c597dba0358221500fda49d653b7cf1f3a | [
"BSD-3-Clause"
] | null | null | null | distributed/worker.py | hercules261188/distributed | e5eb40c597dba0358221500fda49d653b7cf1f3a | [
"BSD-3-Clause"
] | 1 | 2019-04-25T14:13:48.000Z | 2019-04-25T16:54:54.000Z | distributed/worker.py | hercules261188/distributed | e5eb40c597dba0358221500fda49d653b7cf1f3a | [
"BSD-3-Clause"
] | 2 | 2019-04-24T17:06:29.000Z | 2020-09-02T10:48:07.000Z | from __future__ import annotations
import asyncio
import bisect
import builtins
import concurrent.futures
import errno
import heapq
import logging
import os
import random
import sys
import threading
import warnings
import weakref
from collections import defaultdict, deque, namedtuple
from collections.abc import Hashab... | 35.476669 | 115 | 0.542983 | from __future__ import annotations
import asyncio
import bisect
import builtins
import concurrent.futures
import errno
import heapq
import logging
import os
import random
import sys
import threading
import warnings
import weakref
from collections import defaultdict, deque, namedtuple
from collections.abc import Hashab... | true | true |
f70361fd762b86d8ee7498605605e80662106df7 | 1,692 | py | Python | samples/generated_samples/vmmigration_v1_generated_vm_migration_create_utilization_report_async.py | renovate-bot/python-vmmigration | 80a2cf46a21f516899da818a7aec0f2a67222047 | [
"Apache-2.0"
] | null | null | null | samples/generated_samples/vmmigration_v1_generated_vm_migration_create_utilization_report_async.py | renovate-bot/python-vmmigration | 80a2cf46a21f516899da818a7aec0f2a67222047 | [
"Apache-2.0"
] | 10 | 2021-11-18T10:47:48.000Z | 2022-03-07T15:48:54.000Z | samples/generated_samples/vmmigration_v1_generated_vm_migration_create_utilization_report_async.py | renovate-bot/python-vmmigration | 80a2cf46a21f516899da818a7aec0f2a67222047 | [
"Apache-2.0"
] | 1 | 2022-01-29T08:15:02.000Z | 2022-01-29T08:15:02.000Z | # -*- coding: utf-8 -*-
# Copyright 2022 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... | 33.176471 | 85 | 0.767139 |
from google.cloud import vmmigration_v1
async def sample_create_utilization_report():
client = vmmigration_v1.VmMigrationAsyncClient()
request = vmmigration_v1.CreateUtilizationReportRequest(
parent="parent_value",
utilization_report_id="utilization_report_... | true | true |
f7036210c9a2fc427322f417e11fddc8b19b2186 | 12,556 | py | Python | gtsfm/common/gtsfm_data.py | yuancaimaiyi/gtsfm | cc5781c35af23498d45cd96a1818e4786c5cca80 | [
"Apache-2.0"
] | null | null | null | gtsfm/common/gtsfm_data.py | yuancaimaiyi/gtsfm | cc5781c35af23498d45cd96a1818e4786c5cca80 | [
"Apache-2.0"
] | null | null | null | gtsfm/common/gtsfm_data.py | yuancaimaiyi/gtsfm | cc5781c35af23498d45cd96a1818e4786c5cca80 | [
"Apache-2.0"
] | 1 | 2021-09-23T13:08:49.000Z | 2021-09-23T13:08:49.000Z | """Class to hold the tracks and cameras of a 3D scene.
This can be the output of either data association or of bundle adjustment.
Authors: Ayush Baid, John Lambert, Xiaolong Wu
"""
import itertools
from typing import Any, Dict, List, Optional, Tuple
import numpy as np
from gtsam import PinholeCameraCal3Bundler, Pose3... | 36.08046 | 116 | 0.634358 | import itertools
from typing import Any, Dict, List, Optional, Tuple
import numpy as np
from gtsam import PinholeCameraCal3Bundler, Pose3, SfmTrack
import gtsfm.utils.graph as graph_utils
import gtsfm.utils.logger as logger_utils
import gtsfm.utils.reprojection as reproj_utils
logger = logger_utils.get_logger()
EQU... | true | true |
f70362c2929c6b6316a7720a7d8f1029c8e72172 | 514 | py | Python | garrafas.py | WestenPy/Curso_em_video | 9f6a9775d27e1b86d54b381aba5da69b2ae21b27 | [
"MIT"
] | null | null | null | garrafas.py | WestenPy/Curso_em_video | 9f6a9775d27e1b86d54b381aba5da69b2ae21b27 | [
"MIT"
] | null | null | null | garrafas.py | WestenPy/Curso_em_video | 9f6a9775d27e1b86d54b381aba5da69b2ae21b27 | [
"MIT"
] | null | null | null |
'''n = 99
p = 'garrafas'
while n > 0:
if n == 1:
p = 'garrafa'
print(f'{n} {p} de cerveja no muro!')
print(f'{n} {p} no muro!')
print('Se uma garrafa cair no chão')
print('Quantas restarão?')
n -= 1
print('Fim da canção!')'''
p = 'garrafas'
for c in range(99, 0, -1):
if c == 1:
... | 17.724138 | 41 | 0.523346 |
p = 'garrafas'
for c in range(99, 0, -1):
if c == 1:
p = 'garrafa'
print(f'{c} {p} de cerveja no muro!')
print(f'{c} {p} no muro!')
print('Se uma garrafa cair no chão')
print('Quantas restarão?')
print('Fim da canção!')
| true | true |
f703638a4adc495ba1f71364ea8f35a506615362 | 681 | py | Python | wagtailcommerce/orders/migrations/0015_order_cart.py | theplusagency/wagtail-commerce | 6047170f29199ccaf2778534976ab0970c2877e7 | [
"BSD-3-Clause"
] | 3 | 2019-04-12T15:38:43.000Z | 2019-09-22T10:23:20.000Z | wagtailcommerce/orders/migrations/0015_order_cart.py | wagtailcommerce/wagtailcommerce | 308ed8348483806c16062d09a7e69ec44d9a2e73 | [
"BSD-3-Clause"
] | null | null | null | wagtailcommerce/orders/migrations/0015_order_cart.py | wagtailcommerce/wagtailcommerce | 308ed8348483806c16062d09a7e69ec44d9a2e73 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2018-02-17 21:34
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('wagtailcommerce_carts', '0004_cart_coupon'),
('wagt... | 29.608696 | 182 | 0.674009 |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('wagtailcommerce_carts', '0004_cart_coupon'),
('wagtailcommerce_orders', '0014_auto_20180130_1050'),
]
operations ... | true | true |
f70366774f99f64ea4a2e9819e5d6781e9782677 | 4,249 | py | Python | prosodic_daa/sample/pyhlm_sample_murakami.py | EmergentSystemLabStudent/Prosodic-DAA | 068af5db337ed977c059e788353414d3aa9a8ac8 | [
"MIT"
] | null | null | null | prosodic_daa/sample/pyhlm_sample_murakami.py | EmergentSystemLabStudent/Prosodic-DAA | 068af5db337ed977c059e788353414d3aa9a8ac8 | [
"MIT"
] | null | null | null | prosodic_daa/sample/pyhlm_sample_murakami.py | EmergentSystemLabStudent/Prosodic-DAA | 068af5db337ed977c059e788353414d3aa9a8ac8 | [
"MIT"
] | null | null | null | import os
import numpy as np
from pyhlm.model import WeakLimitHDPHLM, WeakLimitHDPHLMPython
from pyhlm.internals.hlm_states import WeakLimitHDPHLMStates
from pyhlm.word_model import LetterHSMM, LetterHSMMPython
import pyhsmm
import warnings
from tqdm import trange
warnings.filterwarnings('ignore')
import time
#%%
def ... | 31.014599 | 133 | 0.701106 | import os
import numpy as np
from pyhlm.model import WeakLimitHDPHLM, WeakLimitHDPHLMPython
from pyhlm.internals.hlm_states import WeakLimitHDPHLMStates
from pyhlm.word_model import LetterHSMM, LetterHSMMPython
import pyhsmm
import warnings
from tqdm import trange
warnings.filterwarnings('ignore')
import time
def loa... | true | true |
f70367a6041c8fa21742be5df4b0ac208ee79ceb | 1,324 | py | Python | src/client/__init__.py | rokups/Launchpad | 661388f65a59de3842368b6315e121ecf8ccf1bf | [
"MIT"
] | 7 | 2018-01-21T04:42:54.000Z | 2021-07-09T04:53:28.000Z | src/client/__init__.py | rokups/Launchpad | 661388f65a59de3842368b6315e121ecf8ccf1bf | [
"MIT"
] | 1 | 2017-08-05T13:01:02.000Z | 2017-08-05T13:01:02.000Z | src/client/__init__.py | rokups/Launchpad | 661388f65a59de3842368b6315e121ecf8ccf1bf | [
"MIT"
] | 1 | 2019-02-17T11:23:56.000Z | 2019-02-17T11:23:56.000Z | #
# MIT License
#
# Copyright 2017 Launchpad project contributors (see COPYRIGHT.md)
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the ... | 47.285714 | 115 | 0.780967 | true | true | |
f7036901558a058bb17bfb56404b309d8c4938f7 | 463 | py | Python | dashboard/views.py | mahanfarzaneh2000/DjangoEcommerce | f844f60fd4eac6c7513196037cd908df3ba01983 | [
"CC0-1.0"
] | 1 | 2020-11-01T11:35:12.000Z | 2020-11-01T11:35:12.000Z | dashboard/views.py | mahanfarzaneh2000/DjangoEcommerce | f844f60fd4eac6c7513196037cd908df3ba01983 | [
"CC0-1.0"
] | null | null | null | dashboard/views.py | mahanfarzaneh2000/DjangoEcommerce | f844f60fd4eac6c7513196037cd908df3ba01983 | [
"CC0-1.0"
] | null | null | null | from django.shortcuts import render
from django.views.generic import View
from django.core.exceptions import ObjectDoesNotExist
from django.contrib import messages
from cart.models import Order
class Dashboard(View):
def get(self,*args,**kwargs):
order_qs = Order.objects.filter(user=self.request.user,order... | 35.615385 | 75 | 0.725702 | from django.shortcuts import render
from django.views.generic import View
from django.core.exceptions import ObjectDoesNotExist
from django.contrib import messages
from cart.models import Order
class Dashboard(View):
def get(self,*args,**kwargs):
order_qs = Order.objects.filter(user=self.request.user,order... | true | true |
f7036a98810d92fc6296922c227dede332735048 | 6,263 | py | Python | people_admin/tests/test_views.py | morden35/openstates.org | 21f0a78a43f04f835b858fdaf4f755d99920e2d7 | [
"MIT"
] | 1 | 2022-01-17T11:54:28.000Z | 2022-01-17T11:54:28.000Z | people_admin/tests/test_views.py | washabstract/openstates.org | dc541ae5cd09dd3b3db623178bf32a03d0246f01 | [
"MIT"
] | null | null | null | people_admin/tests/test_views.py | washabstract/openstates.org | dc541ae5cd09dd3b3db623178bf32a03d0246f01 | [
"MIT"
] | null | null | null | import pytest
from testutils.factories import create_test_person
from django.contrib.auth.models import User, Permission
from openstates.data.models import Person, Organization
from people_admin.models import UnmatchedName, NameStatus, DeltaSet
from people_admin.views import MATCHER_PERM, EDIT_PERM, RETIRE_PERM
import ... | 35.384181 | 88 | 0.669647 | import pytest
from testutils.factories import create_test_person
from django.contrib.auth.models import User, Permission
from openstates.data.models import Person, Organization
from people_admin.models import UnmatchedName, NameStatus, DeltaSet
from people_admin.views import MATCHER_PERM, EDIT_PERM, RETIRE_PERM
import ... | true | true |
f7036aa4f3fc1fce05496b25d2d43eb341c65925 | 9,659 | py | Python | imageops/imageops/server.py | EdgeGallery/toolchain | c7b6e99a754e45372155f54ead8a3860f72f78a4 | [
"Apache-2.0"
] | 18 | 2021-03-12T09:18:41.000Z | 2021-03-12T10:15:34.000Z | imageops/imageops/server.py | EdgeGallery/toolchain | c7b6e99a754e45372155f54ead8a3860f72f78a4 | [
"Apache-2.0"
] | null | null | null | imageops/imageops/server.py | EdgeGallery/toolchain | c7b6e99a754e45372155f54ead8a3860f72f78a4 | [
"Apache-2.0"
] | null | null | null | """
# Copyright 2021 Huawei Technologies Co., Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 41.813853 | 99 | 0.575422 |
import os
from pathlib import Path
from imageops.utils import Utils
from imageops.logger import Logger
class Server(object):
logger = Logger(__name__).get_logger()
def __init__(self, request_id=None):
if not request_id:
msg = 'Lacking request_id.'
self.logger.error(msg)
... | true | true |
f7036ad171f84f32479e698abddcec505adae5dc | 2,307 | py | Python | examples/modal_beamforming_open_circular_array.py | trojanjay/sfa-numpy | bff5737ef429f31228d20a9e1d0ce7d46d3080d3 | [
"MIT"
] | 39 | 2017-09-22T10:30:22.000Z | 2022-03-29T15:56:22.000Z | examples/modal_beamforming_open_circular_array.py | trojanjay/sfa-numpy | bff5737ef429f31228d20a9e1d0ce7d46d3080d3 | [
"MIT"
] | 16 | 2017-11-14T13:02:44.000Z | 2021-04-01T09:53:47.000Z | examples/modal_beamforming_open_circular_array.py | trojanjay/sfa-numpy | bff5737ef429f31228d20a9e1d0ce7d46d3080d3 | [
"MIT"
] | 11 | 2017-12-08T23:54:45.000Z | 2021-01-06T21:06:47.000Z | """
Compute the plane wave decomposition for an incident broadband plane wave
on an open circular array using a modal beamformer of finite order.
"""
import numpy as np
import matplotlib.pyplot as plt
import micarray
from micarray.util import db
Nsf = 50 # order of the incident sound field
N = 30 # order of... | 40.473684 | 93 | 0.748591 |
import numpy as np
import matplotlib.pyplot as plt
import micarray
from micarray.util import db
Nsf = 50
N = 30
pw_angle = 1.23 * np.pi
pol_pwd = np.linspace(0, 2*np.pi, 180, endpoint=False)
k = np.linspace(0, 20, 100)
r = 1
pol, weights = micarray.modal.angular.grid_equal_polar_angle(N)
Bn = micarray... | true | true |
f7036b111cbc0c4e8d9ebaa6a764738d5e9e5c12 | 3,864 | py | Python | eulexistdb/manager.py | emory-libraries/eulexistdb | 7b74f4ec9e7486e493060d4012098613c2b9c85e | [
"Apache-2.0"
] | 9 | 2015-05-09T07:18:21.000Z | 2021-02-26T16:27:08.000Z | eulexistdb/manager.py | emory-libraries/eulexistdb | 7b74f4ec9e7486e493060d4012098613c2b9c85e | [
"Apache-2.0"
] | 14 | 2016-05-20T12:19:09.000Z | 2019-09-05T20:59:36.000Z | eulexistdb/manager.py | emory-libraries/eulexistdb | 7b74f4ec9e7486e493060d4012098613c2b9c85e | [
"Apache-2.0"
] | 3 | 2016-05-23T17:20:08.000Z | 2017-12-20T13:23:06.000Z | # file eulexistdb/manager.py
#
# Copyright 2010,2011 Emory University Libraries
#
# 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
#
... | 36.8 | 122 | 0.667443 |
from django.conf import settings
from eulexistdb.db import ExistDB
from eulexistdb.query import QuerySet
class Manager(object):
def __init__(self, xpath):
self.xpath = xpath
self.model = None
def get_query_set(self):
if hasattr(settings, '... | true | true |
f7036c5fbe4bafb0e1af4388a84aaf25e75f6c0c | 623 | py | Python | 14-flashcardsContador/1-versaoTerminal/0-versoesAntigas/flashcardsContador2/Soma.py | jonasht/Python | 2affe509ce9619f745ee645ff3a120485bf403bc | [
"MIT"
] | null | null | null | 14-flashcardsContador/1-versaoTerminal/0-versoesAntigas/flashcardsContador2/Soma.py | jonasht/Python | 2affe509ce9619f745ee645ff3a120485bf403bc | [
"MIT"
] | null | null | null | 14-flashcardsContador/1-versaoTerminal/0-versoesAntigas/flashcardsContador2/Soma.py | jonasht/Python | 2affe509ce9619f745ee645ff3a120485bf403bc | [
"MIT"
] | null | null | null | class Soma:
def __init__(self):
self.numeroDeCartas = list()
def set_numeroDeCartas(self, numero):
if numero == '':
numero = '1'
numero = numero[:]
self.numeroDeCartas.extend(numero)
def get_numeroDeCartas(self):
... | 23.074074 | 65 | 0.539326 | class Soma:
def __init__(self):
self.numeroDeCartas = list()
def set_numeroDeCartas(self, numero):
if numero == '':
numero = '1'
numero = numero[:]
self.numeroDeCartas.extend(numero)
def get_numeroDeCartas(self):
... | true | true |
f7036c87ca207cfcc12ce67719024edf8b098396 | 4,026 | py | Python | ralamb.py | uclyyu/over9000 | 42db9fa6ac5a9a2e177f1f9a9a660bee9cd5d587 | [
"Apache-2.0"
] | 411 | 2019-08-25T12:24:34.000Z | 2022-03-25T03:31:38.000Z | optimizers/ralamb.py | AryanRaj315/EAD2020 | 9e2e0aa4be9da941372a21ea627c38a3eb7be617 | [
"MIT"
] | 23 | 2019-08-26T13:14:45.000Z | 2021-07-04T19:00:15.000Z | optimizers/ralamb.py | AryanRaj315/EAD2020 | 9e2e0aa4be9da941372a21ea627c38a3eb7be617 | [
"MIT"
] | 60 | 2019-08-25T12:31:46.000Z | 2022-02-10T09:39:20.000Z | import torch, math
from torch.optim.optimizer import Optimizer
# RAdam + LARS
class Ralamb(Optimizer):
def __init__(self, params, lr=1e-3, betas=(0.9, 0.999), eps=1e-8, weight_decay=0):
defaults = dict(lr=lr, betas=betas, eps=eps, weight_decay=weight_decay)
self.buffer = [[None, None, None] for in... | 40.26 | 181 | 0.504223 | import torch, math
from torch.optim.optimizer import Optimizer
class Ralamb(Optimizer):
def __init__(self, params, lr=1e-3, betas=(0.9, 0.999), eps=1e-8, weight_decay=0):
defaults = dict(lr=lr, betas=betas, eps=eps, weight_decay=weight_decay)
self.buffer = [[None, None, None] for ind in range(10)... | true | true |
f7036cde771e158378a1bdef64092434538782a5 | 18,321 | py | Python | mlir/test/Bindings/Python/ir_operation.py | MochalovaAn/llvm | 528aa5ca4aa9df447dc3497ef19da3b124e88d7d | [
"Apache-2.0"
] | null | null | null | mlir/test/Bindings/Python/ir_operation.py | MochalovaAn/llvm | 528aa5ca4aa9df447dc3497ef19da3b124e88d7d | [
"Apache-2.0"
] | null | null | null | mlir/test/Bindings/Python/ir_operation.py | MochalovaAn/llvm | 528aa5ca4aa9df447dc3497ef19da3b124e88d7d | [
"Apache-2.0"
] | null | null | null | # RUN: %PYTHON %s | FileCheck %s
import gc
import io
import itertools
from mlir.ir import *
def run(f):
print("\nTEST:", f.__name__)
f()
gc.collect()
assert Context._get_live_count() == 0
# Verify iterator based traversal of the op/region/block hierarchy.
# CHECK-LABEL: TEST: testTraverseOpRegionBlockIterat... | 29.693679 | 129 | 0.645871 |
import gc
import io
import itertools
from mlir.ir import *
def run(f):
print("\nTEST:", f.__name__)
f()
gc.collect()
assert Context._get_live_count() == 0
def testTraverseOpRegionBlockIterators():
ctx = Context()
ctx.allow_unregistered_dialects = True
module = Module.parse(r"""
func @f1(%arg0: ... | true | true |
f7036da9f3477fb29d1f73794bda2fccb598b879 | 8,016 | py | Python | docs/conf.py | tdi/pyPEPA | db15073487331b66e8ab60a1d05cb158070e0d54 | [
"Apache-2.0"
] | 4 | 2015-05-12T09:30:45.000Z | 2021-11-30T23:09:51.000Z | docs/conf.py | tdi/pyPEPA | db15073487331b66e8ab60a1d05cb158070e0d54 | [
"Apache-2.0"
] | null | null | null | docs/conf.py | tdi/pyPEPA | db15073487331b66e8ab60a1d05cb158070e0d54 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# pypepa documentation build configuration file, created by
# sphinx-quickstart on Thu Jul 18 15:33:13 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autog... | 32.064 | 80 | 0.715694 |
import sys, os
extensions = ['sphinx.ext.mathjax', 'sphinx.ext.autodoc']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = 'pypepa'
copyright = '2013, Dariusz Dwornikowski'
# |version| and |release|, also used in various other places throughout... | true | true |
f7036df95921f8dea17f6d6274c42b3d1551879a | 153 | py | Python | StatsClass/urls.py | nelliesnoodles/my-first-blog | e552ea38891ebe005316487ae32a324659ad6367 | [
"MIT"
] | null | null | null | StatsClass/urls.py | nelliesnoodles/my-first-blog | e552ea38891ebe005316487ae32a324659ad6367 | [
"MIT"
] | 5 | 2019-12-13T17:37:55.000Z | 2021-06-10T20:59:32.000Z | StatsClass/urls.py | nelliesnoodles/My-Website | e552ea38891ebe005316487ae32a324659ad6367 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path('StatsClass', views.index),
path('BasicProbability', views.basic_prob),
]
| 19.125 | 47 | 0.712418 | from django.urls import path
from . import views
urlpatterns = [
path('StatsClass', views.index),
path('BasicProbability', views.basic_prob),
]
| true | true |
f7036e9ffbe44cdcb5926a139df525aedf532378 | 262 | py | Python | common/signature/__init__.py | lukius/mts | 96d3d8b28742a474aca67bfcb079577c878bbb4c | [
"MIT"
] | 2 | 2015-04-04T01:44:11.000Z | 2017-11-04T11:59:27.000Z | common/signature/__init__.py | lukius/mts | 96d3d8b28742a474aca67bfcb079577c878bbb4c | [
"MIT"
] | null | null | null | common/signature/__init__.py | lukius/mts | 96d3d8b28742a474aca67bfcb079577c878bbb4c | [
"MIT"
] | null | null | null | class DigitalSignatureScheme(object):
def get_public_key(self):
return self.public_key
def sign(self, messsage):
raise NotImplementedError
def verify(self, message, signature):
raise NotImplementedError
| 23.818182 | 41 | 0.648855 | class DigitalSignatureScheme(object):
def get_public_key(self):
return self.public_key
def sign(self, messsage):
raise NotImplementedError
def verify(self, message, signature):
raise NotImplementedError
| true | true |
f7036eb900de1e0cf354ec91df0aa273644cb847 | 10,409 | py | Python | t2c/segmentation.py | micbia/tools21cm | 72081e94e4d83511380baacce427d79d13da2fa5 | [
"MIT"
] | 1 | 2020-10-08T12:34:05.000Z | 2020-10-08T12:34:05.000Z | t2c/segmentation.py | micbia/tools21cm | 72081e94e4d83511380baacce427d79d13da2fa5 | [
"MIT"
] | null | null | null | t2c/segmentation.py | micbia/tools21cm | 72081e94e4d83511380baacce427d79d13da2fa5 | [
"MIT"
] | null | null | null | """
Created by Michele Bianco, 9 July 2021
"""
import numpy as np, pkg_resources
from tqdm import tqdm
import tensorflow as tf
from tensorflow.keras.models import load_model
from tensorflow.keras import backend as K
from tensorflow.python.ops import nn_ops
from tensorflow.python.framework import ops
from tensorflow.... | 40.819608 | 159 | 0.58142 |
import numpy as np, pkg_resources
from tqdm import tqdm
import tensorflow as tf
from tensorflow.keras.models import load_model
from tensorflow.keras import backend as K
from tensorflow.python.ops import nn_ops
from tensorflow.python.framework import ops
from tensorflow.python.ops import array_ops
from tensorflow.py... | true | true |
f7036f30e8f6a74391031fa260de951dacb90cb4 | 4,427 | py | Python | sunshine_conversations_client/model/user_truncated.py | Dima2022/sunshine-conversations-python | 8085a82dc320d97f09bb0174d11dd1865a65404a | [
"Apache-2.0"
] | 4 | 2020-09-27T14:28:25.000Z | 2022-02-02T13:51:29.000Z | sunshine_conversations_client/model/user_truncated.py | Dima2022/sunshine-conversations-python | 8085a82dc320d97f09bb0174d11dd1865a65404a | [
"Apache-2.0"
] | 3 | 2021-09-30T18:18:58.000Z | 2021-12-04T07:55:23.000Z | sunshine_conversations_client/model/user_truncated.py | Dima2022/sunshine-conversations-python | 8085a82dc320d97f09bb0174d11dd1865a65404a | [
"Apache-2.0"
] | 5 | 2020-11-07T02:08:18.000Z | 2021-12-07T17:10:23.000Z | # coding: utf-8
"""
Sunshine Conversations API
The version of the OpenAPI document: 9.4.5
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from sunshine_conversations_client.configuration import Configuration
from sunshine_conversations_client.undefine... | 27.66875 | 102 | 0.574656 |
import pprint
import re
import six
from sunshine_conversations_client.configuration import Configuration
from sunshine_conversations_client.undefined import Undefined
class UserTruncated(object):
openapi_types = {
'id': 'str',
'external_id': 'str'
}
attribute_map = {
'id... | true | true |
f7036f5c4bd73b8f7b2a333ac6993a89266119a0 | 1,581 | py | Python | preprocessing/main.py | jrobertojunior/face-parsing.PyTorch | d34f39c9ae9726ac8eaf39ecff824a14ec4e15b9 | [
"MIT"
] | null | null | null | preprocessing/main.py | jrobertojunior/face-parsing.PyTorch | d34f39c9ae9726ac8eaf39ecff824a14ec4e15b9 | [
"MIT"
] | null | null | null | preprocessing/main.py | jrobertojunior/face-parsing.PyTorch | d34f39c9ae9726ac8eaf39ecff824a14ec4e15b9 | [
"MIT"
] | null | null | null | import cv2 as cv
import numpy as np
import os
def preprocess(labels_path, sep_labels_path):
# list all files on labels_path
labels_filenames = os.listdir(labels_path)
count = 0
for label_filename in labels_filenames:
label_path = os.path.join(labels_path, label_filename)
print(f'segme... | 25.918033 | 80 | 0.563567 | import cv2 as cv
import numpy as np
import os
def preprocess(labels_path, sep_labels_path):
labels_filenames = os.listdir(labels_path)
count = 0
for label_filename in labels_filenames:
label_path = os.path.join(labels_path, label_filename)
print(f'segmenting {label_filename}')
... | true | true |
f7036f7636cc20ea4dc6d9b8460cfa888a315805 | 39,822 | py | Python | netqasm/sdk/epr_socket.py | QuTech-Delft/netqasm | 954162542c441d5663ecb9a8801eab94efd4ef2e | [
"MIT"
] | 6 | 2021-11-10T15:03:59.000Z | 2022-02-16T19:35:01.000Z | netqasm/sdk/epr_socket.py | QuTech-Delft/netqasm | 954162542c441d5663ecb9a8801eab94efd4ef2e | [
"MIT"
] | 13 | 2021-11-26T09:19:46.000Z | 2022-03-29T09:21:42.000Z | netqasm/sdk/epr_socket.py | QuTech-Delft/netqasm | 954162542c441d5663ecb9a8801eab94efd4ef2e | [
"MIT"
] | 4 | 2021-11-19T15:46:17.000Z | 2022-01-23T18:59:15.000Z | """EPR Socket interface."""
from __future__ import annotations
import abc
import logging
from contextlib import contextmanager
from typing import TYPE_CHECKING, Callable, ContextManager, List, Optional, Tuple, Union
from netqasm.logging.glob import get_netqasm_logger
from netqasm.qlink_compat import (
EPRRole,
... | 43.856828 | 92 | 0.641454 |
from __future__ import annotations
import abc
import logging
from contextlib import contextmanager
from typing import TYPE_CHECKING, Callable, ContextManager, List, Optional, Tuple, Union
from netqasm.logging.glob import get_netqasm_logger
from netqasm.qlink_compat import (
EPRRole,
EPRType,
LinkLayerOKT... | true | true |
f7036fe313c66a97f4197a25427a74fb4d122a60 | 14,595 | py | Python | google_cal_app/views.py | google-business-communications/bm-gCal-bot | fe67391f956ccfcfe80ad786c40847a154ca6a6e | [
"Apache-2.0"
] | 2 | 2021-02-26T16:32:53.000Z | 2021-03-04T16:12:10.000Z | google_cal_app/views.py | google-business-communications/bm-gCal-bot | fe67391f956ccfcfe80ad786c40847a154ca6a6e | [
"Apache-2.0"
] | null | null | null | google_cal_app/views.py | google-business-communications/bm-gCal-bot | fe67391f956ccfcfe80ad786c40847a154ca6a6e | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 32.578125 | 138 | 0.722576 |
import base64
import datetime
import hashlib
import json
import os
import uuid
from businessmessages import businessmessages_v1_client as bm_client
from businessmessages.businessmessages_v1_messages import (
BusinessmessagesConversationsMessagesCreateRequest,
BusinessMessagesMessage, BusinessMes... | true | true |
f70370a8e859605dfe04aa5778ef4129010bb78a | 7,577 | py | Python | distrax/_src/bijectors/tfp_compatible_bijector.py | kuperov/distrax | dd3363a64017c5eafb3241bb2a3884de50f21427 | [
"Apache-2.0"
] | 278 | 2021-04-13T09:06:23.000Z | 2022-03-29T11:01:20.000Z | distrax/_src/bijectors/tfp_compatible_bijector.py | kuperov/distrax | dd3363a64017c5eafb3241bb2a3884de50f21427 | [
"Apache-2.0"
] | 26 | 2021-04-13T18:19:37.000Z | 2022-03-25T15:00:15.000Z | distrax/_src/bijectors/tfp_compatible_bijector.py | kuperov/distrax | dd3363a64017c5eafb3241bb2a3884de50f21427 | [
"Apache-2.0"
] | 14 | 2021-04-13T17:05:33.000Z | 2022-03-13T13:01:04.000Z | # Copyright 2021 DeepMind Technologies Limited. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 42.329609 | 80 | 0.707668 |
from typing import Any, Optional
import chex
from distrax._src.bijectors import bijector
from distrax._src.utils import math
import jax
import jax.numpy as jnp
from tensorflow_probability.substrates import jax as tfp
tfb = tfp.bijectors
tfd = tfp.distributions
Array = chex.Array
Bijector = bijector.Bi... | true | true |
f70370b31a5fa70191a3015de5da4b12b92ec6dd | 3,338 | py | Python | example/loc3/rewards.py | Principe92/contextualbandits | 43cf5be10b3d39d74f9da5c5fe1cfae5bc2dd6f5 | [
"BSD-2-Clause"
] | null | null | null | example/loc3/rewards.py | Principe92/contextualbandits | 43cf5be10b3d39d74f9da5c5fe1cfae5bc2dd6f5 | [
"BSD-2-Clause"
] | null | null | null | example/loc3/rewards.py | Principe92/contextualbandits | 43cf5be10b3d39d74f9da5c5fe1cfae5bc2dd6f5 | [
"BSD-2-Clause"
] | null | null | null | import pandas
import numpy as np
import matplotlib.pyplot as plt
import scipy.stats as st
from pylab import rcParams
df = pandas.read_csv('rewards_loc3.csv')
ucb,ts,ovr,egr,egr2,agr,agr2,efr,ac,aac,sft = df['ucb'],df['ts'],df['ovr'],\
df['egr'],df['egr2'],df['agr'],df['agr2'],df['efr'],df['ac'],df['aac'],df['sft']
... | 46.361111 | 122 | 0.687837 | import pandas
import numpy as np
import matplotlib.pyplot as plt
import scipy.stats as st
from pylab import rcParams
df = pandas.read_csv('rewards_loc3.csv')
ucb,ts,ovr,egr,egr2,agr,agr2,efr,ac,aac,sft = df['ucb'],df['ts'],df['ovr'],\
df['egr'],df['egr2'],df['agr'],df['agr2'],df['efr'],df['ac'],df['aac'],df['sft']
... | true | true |
f70371f921691212a121904c194ef6c94e3d6329 | 21,898 | py | Python | test/db/test_db_sqlite.py | thenetcircle/dino | 1047c3458e91a1b4189e9f48f1393b3a68a935b3 | [
"Apache-2.0"
] | 150 | 2016-10-05T11:09:36.000Z | 2022-03-06T16:24:41.000Z | test/db/test_db_sqlite.py | thenetcircle/dino | 1047c3458e91a1b4189e9f48f1393b3a68a935b3 | [
"Apache-2.0"
] | 27 | 2017-03-02T03:37:02.000Z | 2022-02-10T04:59:54.000Z | test/db/test_db_sqlite.py | thenetcircle/dino | 1047c3458e91a1b4189e9f48f1393b3a68a935b3 | [
"Apache-2.0"
] | 21 | 2016-11-11T07:51:48.000Z | 2020-04-26T21:38:33.000Z | from datetime import datetime
from dino.config import UserKeys, RedisKeys, SessionKeys
from dino.db.rdbms.models import Channels
from dino.db.rdbms.models import Rooms
from test.base import BaseTest
from test.db import BaseDatabaseTest
class DatabaseSqliteTest(BaseDatabaseTest):
def setUp(self):
self.set... | 34.269171 | 119 | 0.776692 | from datetime import datetime
from dino.config import UserKeys, RedisKeys, SessionKeys
from dino.db.rdbms.models import Channels
from dino.db.rdbms.models import Rooms
from test.base import BaseTest
from test.db import BaseDatabaseTest
class DatabaseSqliteTest(BaseDatabaseTest):
def setUp(self):
self.set... | true | true |
f7037282b9d4bec22d75254382e9b4bf3d7a655e | 5,332 | py | Python | Add/add_heuristic_engine.py | Jesmine0902/TSP_CPLEX_2 | 8853d6837bd5408b8925eb5f45e21c79945a5904 | [
"MIT"
] | 1 | 2020-08-14T03:25:09.000Z | 2020-08-14T03:25:09.000Z | Add/add_heuristic_engine.py | Jesmine0902/TSP_CPLEX_2 | 8853d6837bd5408b8925eb5f45e21c79945a5904 | [
"MIT"
] | null | null | null | Add/add_heuristic_engine.py | Jesmine0902/TSP_CPLEX_2 | 8853d6837bd5408b8925eb5f45e21c79945a5904 | [
"MIT"
] | 1 | 2020-08-14T03:24:29.000Z | 2020-08-14T03:24:29.000Z | import pandas as pd
__author__ = 'slei'
class AddHeuristicTSP:
""" Finds the shortest path using a heuristic method """
def __init__(self, cities_df):
self.df = cities_df
self.edges = list((t.origin, t.destination) for t in df.itertuples())
self.distance = dict([((t.origin, t.destina... | 37.027778 | 117 | 0.589835 | import pandas as pd
__author__ = 'slei'
class AddHeuristicTSP:
def __init__(self, cities_df):
self.df = cities_df
self.edges = list((t.origin, t.destination) for t in df.itertuples())
self.distance = dict([((t.origin, t.destination), t.distance) for t in df.itertuples()])
self.ci... | true | true |
f70372ff51a0c2ba1144263ef3314dfe0f59ebb1 | 28,309 | py | Python | ots_eval/stability_evaluation/close.py | YellowOfTheEgg/ots-eval | 8ec08e60330d41f8f7ffd571dd6301cdedaefd99 | [
"BSD-3-Clause"
] | 3 | 2021-03-28T14:46:57.000Z | 2022-01-03T17:25:19.000Z | ots_eval/stability_evaluation/close.py | YellowOfTheEgg/ots-eval | 8ec08e60330d41f8f7ffd571dd6301cdedaefd99 | [
"BSD-3-Clause"
] | null | null | null | ots_eval/stability_evaluation/close.py | YellowOfTheEgg/ots-eval | 8ec08e60330d41f8f7ffd571dd6301cdedaefd99 | [
"BSD-3-Clause"
] | 1 | 2022-01-11T10:56:14.000Z | 2022-01-11T10:56:14.000Z | import numpy as np
from scipy.spatial.distance import euclidean
from typing import Union
import pandas
class CLOSE(object):
def __init__(self, data: pandas.DataFrame, measure: Union[str, callable] = 'mse', minPts: int = None, output: bool = False,
jaccard: bool = False, weighting: bool = False, ... | 44.511006 | 145 | 0.575753 | import numpy as np
from scipy.spatial.distance import euclidean
from typing import Union
import pandas
class CLOSE(object):
def __init__(self, data: pandas.DataFrame, measure: Union[str, callable] = 'mse', minPts: int = None, output: bool = False,
jaccard: bool = False, weighting: bool = False, ... | true | true |
f70373e85dd7d594ac8c8db40a01f648beb6171b | 7,943 | py | Python | Modules/Roles.py | Skk-nsmt/reina | 1b658bfcf4ff35a641c7fe9398652aa36b254d3a | [
"WTFPL"
] | null | null | null | Modules/Roles.py | Skk-nsmt/reina | 1b658bfcf4ff35a641c7fe9398652aa36b254d3a | [
"WTFPL"
] | 13 | 2020-12-22T04:35:03.000Z | 2021-07-07T07:05:53.000Z | Modules/Roles.py | Skk-nsmt/reina | 1b658bfcf4ff35a641c7fe9398652aa36b254d3a | [
"WTFPL"
] | 1 | 2022-02-28T21:40:51.000Z | 2022-02-28T21:40:51.000Z | import discord
from discord.ext import commands
from Modules import CONSTANT
from Modules.Checks import check_if_role_or_bot_spam
class Roles(commands.Cog):
def __init__(self, bot: commands.Bot):
self.bot = bot
@commands.command()
@check_if_role_or_bot_spam()
async def role(self, ctx: comman... | 43.883978 | 117 | 0.545134 | import discord
from discord.ext import commands
from Modules import CONSTANT
from Modules.Checks import check_if_role_or_bot_spam
class Roles(commands.Cog):
def __init__(self, bot: commands.Bot):
self.bot = bot
@commands.command()
@check_if_role_or_bot_spam()
async def role(self, ctx: comman... | true | true |
f7037425cd747334c2b88b75c4d4315203805b2e | 1,119 | py | Python | ptk_gestaorecurso_teste/recursos/forms.py | rodrigombsantana/ptk-gestaorecursos-teste | 4f6f1fbac8b5501cf54520bf7434e92e19d6dfc6 | [
"MIT"
] | null | null | null | ptk_gestaorecurso_teste/recursos/forms.py | rodrigombsantana/ptk-gestaorecursos-teste | 4f6f1fbac8b5501cf54520bf7434e92e19d6dfc6 | [
"MIT"
] | null | null | null | ptk_gestaorecurso_teste/recursos/forms.py | rodrigombsantana/ptk-gestaorecursos-teste | 4f6f1fbac8b5501cf54520bf7434e92e19d6dfc6 | [
"MIT"
] | null | null | null | from django.db import models
from django.forms import ModelForm
from django.forms import TextInput
from .models import agendamento
#import datetime
#class frm_agendamento(forms.ModelForm):
#
# data_agendamento = forms.DateField(label="Data",initial=datetime.date.today)
# horario_inicio = forms.TimeField(label="In... | 43.038462 | 119 | 0.679178 | from django.db import models
from django.forms import ModelForm
from django.forms import TextInput
from .models import agendamento
class frm_agendamento(ModelForm):
class Meta:
model = agendamento
exclude = ('criado_em','google_link')
widgets = {
'data_agendamento':... | true | true |
f703746e0316f7cff40f0b2d9a7c219de426744e | 26,744 | py | Python | tools/validators/ontology_validator/yamlformat/validator/entity_type_lib.py | a-o-u/digitalbuildings | 407075cbfbd3d81e6c2ce0c25cc160e3238d9225 | [
"Apache-2.0"
] | null | null | null | tools/validators/ontology_validator/yamlformat/validator/entity_type_lib.py | a-o-u/digitalbuildings | 407075cbfbd3d81e6c2ce0c25cc160e3238d9225 | [
"Apache-2.0"
] | null | null | null | tools/validators/ontology_validator/yamlformat/validator/entity_type_lib.py | a-o-u/digitalbuildings | 407075cbfbd3d81e6c2ce0c25cc160e3238d9225 | [
"Apache-2.0"
] | null | null | null | # 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, sof... | 36.091768 | 80 | 0.695408 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import re
import typing
from typing import Optional, Tuple
from yamlformat.validator import base_lib
from yamlformat.validator import config_folder_lib
from yamlformat.validator import field_lib
... | true | true |
f70374938ed4795d168e995524aeabe6d04b8859 | 33 | py | Python | cfail/check.py | Seanny123/coala-fail | c45e9986e2a46de93f73ad7d1edbc86a609bbe28 | [
"MIT"
] | null | null | null | cfail/check.py | Seanny123/coala-fail | c45e9986e2a46de93f73ad7d1edbc86a609bbe28 | [
"MIT"
] | null | null | null | cfail/check.py | Seanny123/coala-fail | c45e9986e2a46de93f73ad7d1edbc86a609bbe28 | [
"MIT"
] | null | null | null | # a = 2
print("check this file")
| 11 | 24 | 0.606061 |
print("check this file")
| true | true |
f70375438cbfcec1b0797a36cf6bd37f200b244f | 540 | py | Python | realtimeplt/outputs/__init__.py | Aryan05/realtimeplt | e04c09550fece33df03aaf6f340d0405d77d6443 | [
"MIT"
] | 3 | 2020-09-28T10:08:56.000Z | 2020-10-10T00:30:05.000Z | realtimeplt/outputs/__init__.py | Aryan05/realtimeplt | e04c09550fece33df03aaf6f340d0405d77d6443 | [
"MIT"
] | 1 | 2020-09-30T16:15:31.000Z | 2020-09-30T16:15:42.000Z | realtimeplt/outputs/__init__.py | Aryan05/realtimeplt | e04c09550fece33df03aaf6f340d0405d77d6443 | [
"MIT"
] | 1 | 2020-10-10T00:36:19.000Z | 2020-10-10T00:36:19.000Z | # technical
from .base_output import BaseOutput
# default
from .matplotlib_plot import MatplotlibPlot
from .extrema_printer import ExtremaPrinter
# with external dependencies
# import are respective __init__ methods
# hack-ish, but works (and I am not aware of a more proper way to do so)
from .bokeh_plot import Bo... | 24.545455 | 72 | 0.82963 |
from .base_output import BaseOutput
from .matplotlib_plot import MatplotlibPlot
from .extrema_printer import ExtremaPrinter
from .bokeh_plot import BokehPlot
from .neptune_logger import NeptuneLogger
from .tensorboard_logger import TensorboardLogger
from .tensorboard_tf_logger import TensorboardTFLogger
fr... | true | true |
f7037640bf3a851ac42c1c322ba7e2f5f9dc9b00 | 4,367 | py | Python | test/functional/wallet-hd.py | danigarcia3k/Sikacoin | 82ef600cfeed1d8f163df6071d8d080fb9dac6b0 | [
"MIT"
] | null | null | null | test/functional/wallet-hd.py | danigarcia3k/Sikacoin | 82ef600cfeed1d8f163df6071d8d080fb9dac6b0 | [
"MIT"
] | null | null | null | test/functional/wallet-hd.py | danigarcia3k/Sikacoin | 82ef600cfeed1d8f163df6071d8d080fb9dac6b0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2016 The Sikacoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test Hierarchical Deterministic wallet function."""
from test_framework.test_framework import SikacoinTest... | 41.198113 | 105 | 0.642317 |
from test_framework.test_framework import SikacoinTestFramework
from test_framework.util import (
assert_equal,
connect_nodes_bi,
)
import shutil
class WalletHDTest(SikacoinTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 2
self.extra_ar... | true | true |
f70377c8ead6d814b75810083ddb336ecbc41f22 | 8,307 | py | Python | commons/siam_mask/experiments/siammask_sharp/resnet.py | dajes/labelfficient | 5dd0566224fb04285e690bf8576eacc04a7c87cd | [
"MIT"
] | 4 | 2021-02-09T08:18:18.000Z | 2022-02-26T03:18:26.000Z | commons/siam_mask/experiments/siammask_sharp/resnet.py | dajes/labelfficient | 5dd0566224fb04285e690bf8576eacc04a7c87cd | [
"MIT"
] | 1 | 2022-02-26T03:15:34.000Z | 2022-02-26T03:20:27.000Z | commons/siam_mask/experiments/siammask_sharp/resnet.py | dajes/labelfficient | 5dd0566224fb04285e690bf8576eacc04a7c87cd | [
"MIT"
] | 2 | 2021-06-06T16:39:57.000Z | 2021-06-06T16:48:32.000Z | import torch.nn as nn
import torch
from torch.autograd import Variable
import math
import torch.utils.model_zoo as model_zoo
from commons.siam_mask.models.features import Features
__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101',
'resnet152']
model_urls = {
'resnet18': 'https://dow... | 31.706107 | 100 | 0.589142 | import torch.nn as nn
import torch
from torch.autograd import Variable
import math
import torch.utils.model_zoo as model_zoo
from commons.siam_mask.models.features import Features
__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101',
'resnet152']
model_urls = {
'resnet18': 'https://dow... | true | true |
f70378b1e6899af4a8706e20c4f8edf6329a186a | 2,796 | py | Python | tflib/distribute/distribute.py | AlexBlack2202/EigenGAN-Tensorflow | 9668738852abdcd7161b64b7e6a074c7ebfea055 | [
"MIT"
] | 302 | 2021-04-27T02:15:47.000Z | 2022-03-13T07:51:07.000Z | tflib/distribute/distribute.py | gokulsg/EigenGAN-Tensorflow | 86b21a47a824a2bb04a088c3e78b03d03a53735c | [
"MIT"
] | 7 | 2021-05-26T05:44:46.000Z | 2021-12-28T02:38:47.000Z | tflib/distribute/distribute.py | gokulsg/EigenGAN-Tensorflow | 86b21a47a824a2bb04a088c3e78b03d03a53735c | [
"MIT"
] | 34 | 2021-04-27T02:16:04.000Z | 2022-01-28T12:18:17.000Z | import tensorflow as tf
from tensorflow.python.client import device_lib
def get_available_gpus():
local_device_protos = device_lib.list_local_devices()
return [x.name for x in local_device_protos if x.device_type == 'GPU']
gpus = get_available_gpus
def split_nest(nest, num_or_size_splits, axis=0):
"""... | 33.285714 | 88 | 0.655222 | import tensorflow as tf
from tensorflow.python.client import device_lib
def get_available_gpus():
local_device_protos = device_lib.list_local_devices()
return [x.name for x in local_device_protos if x.device_type == 'GPU']
gpus = get_available_gpus
def split_nest(nest, num_or_size_splits, axis=0):
fla... | true | true |
f7037a2ff7ed82e1cd626b834ee5784390b3252e | 4,466 | py | Python | test.py | pyEtherCAT/Test-Source | 32e7f36873cf311580acc25ab76db589e209e479 | [
"MIT"
] | 9 | 2018-09-16T01:00:08.000Z | 2021-04-21T03:08:38.000Z | test.py | pyEtherCAT/Test-Source | 32e7f36873cf311580acc25ab76db589e209e479 | [
"MIT"
] | null | null | null | test.py | pyEtherCAT/Test-Source | 32e7f36873cf311580acc25ab76db589e209e479 | [
"MIT"
] | 5 | 2018-05-24T08:41:45.000Z | 2020-09-26T12:04:16.000Z | # import gevent.monkey
# gevent.monkey.patch_socket()
from pyEtherCAT import MasterEtherCAT
import time
import os
#============================================================================#
# C95用の簡易EtherCATパッケージです。
# 本来は細かいパケットに付いて理解を深めた上で仕組みを構築していきますが、
# 説明も実験も追いつかず、ひとまずGPIOで高速にON/OFF出来る部分だけを纏めました。
# 動作は Linux(R... | 34.620155 | 85 | 0.537841 |
from pyEtherCAT import MasterEtherCAT
import time
import os
def EtherCAT_Init(nic):
cat = MasterEtherCAT.MasterEtherCAT(nic)
return cat
def EtherCAT_SetUp(cat):
cat.EEPROM_SetUp(cat.ADP)
cat.EEPROM_Stasus(enable=0x00, command=0x04)
ADDR = 0x0120
data = 0x0002
cat.APWR(ID... | true | true |
f7037afae16524014eb92d458ac6b7aedaa8b9b9 | 1,107 | py | Python | porcupine/__init__.py | Akuli/editor | cf98c538e75a07d825f9066e25a3752fdf7c3c29 | [
"MIT"
] | 1 | 2021-07-28T10:09:26.000Z | 2021-07-28T10:09:26.000Z | porcupine/__init__.py | Akuli/editor | cf98c538e75a07d825f9066e25a3752fdf7c3c29 | [
"MIT"
] | null | null | null | porcupine/__init__.py | Akuli/editor | cf98c538e75a07d825f9066e25a3752fdf7c3c29 | [
"MIT"
] | null | null | null | """Porcupine is a simple editor.
You are probably reading this because you want to learn how Porcupine
works or write fun plugins for it. I recommend getting started with the
plugin API documentation:
https://akuli.github.io/porcupine/
"""
import sys
import appdirs
version_info = (0, 99, 2) # this is updated ... | 29.918919 | 83 | 0.775068 |
import sys
import appdirs
version_info = (0, 99, 2)
__version__ = "%d.%d.%d" % version_info
__author__ = "Akuli"
__copyright__ = "Copyright (c) 2017-2022 Akuli"
__license__ = "MIT"
if sys.platform in {"win32", "darwin"}:
dirs = appdirs.AppDirs("Porcupine", "Akuli")
else:
dirs = appdirs.AppDirs("porcu... | true | true |
f7037b3a3daadb1935f85a9a60ff3076e2dc7967 | 446 | py | Python | loglizer/models/__init__.py | paulinko/loglizer | d3910370fa6752ef77232bef79ddb504ef245a9d | [
"MIT"
] | null | null | null | loglizer/models/__init__.py | paulinko/loglizer | d3910370fa6752ef77232bef79ddb504ef245a9d | [
"MIT"
] | null | null | null | loglizer/models/__init__.py | paulinko/loglizer | d3910370fa6752ef77232bef79ddb504ef245a9d | [
"MIT"
] | null | null | null | from .PCA import PCA
from .InvariantsMiner import InvariantsMiner
from .LogClustering import LogClustering
from .LR import LR
from .SVM import SVM
from .DecisionTree import DecisionTree
from .IsolationForest import IsolationForest
from .DeepLog import DeepLog
from .Autoencoder import Autoencoder
from .AutoencoderLSTM i... | 37.166667 | 53 | 0.867713 | from .PCA import PCA
from .InvariantsMiner import InvariantsMiner
from .LogClustering import LogClustering
from .LR import LR
from .SVM import SVM
from .DecisionTree import DecisionTree
from .IsolationForest import IsolationForest
from .DeepLog import DeepLog
from .Autoencoder import Autoencoder
from .AutoencoderLSTM i... | true | true |
f7037c6d6ec327ebf3ef4a26aa0079107e008b3c | 1,165 | py | Python | semantic_aware_models/models/classification/abstract_classifier.py | ITAINNOVA/SAME | d46dda98753fcb3606e04c3db2d20c9e700140e8 | [
"OML"
] | null | null | null | semantic_aware_models/models/classification/abstract_classifier.py | ITAINNOVA/SAME | d46dda98753fcb3606e04c3db2d20c9e700140e8 | [
"OML"
] | null | null | null | semantic_aware_models/models/classification/abstract_classifier.py | ITAINNOVA/SAME | d46dda98753fcb3606e04c3db2d20c9e700140e8 | [
"OML"
] | 1 | 2020-03-19T12:41:54.000Z | 2020-03-19T12:41:54.000Z | import abc
class AbstractClassifier:
""" Abstract class with specific methods for classifier models (training, validation and test) """
def __init__(self):
pass
@abc.abstractmethod
def train(self, config, train_data):
"""
Classifier training.
:param config: Model con... | 27.738095 | 102 | 0.64206 | import abc
class AbstractClassifier:
def __init__(self):
pass
@abc.abstractmethod
def train(self, config, train_data):
pass
@abc.abstractmethod
def validation(self, config, val_data):
pass
@abc.abstractmethod
def test(self, config, test_data):
pass
| true | true |
f7037dd7dfb7d354c6a820cd68cc1823c6415a56 | 268 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v8_7/fix_purchase_receipt_status.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v8_7/fix_purchase_receipt_status.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v8_7/fix_purchase_receipt_status.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | import frappe
def execute():
# there is no more status called "Submitted", there was an old issue that used
# to set it as Submitted, fixed in this commit
frappe.db.sql("""
update
`tabPurchase Receipt`
set
status = 'To Bill'
where
status = 'Submitted'""") | 22.333333 | 79 | 0.697761 | import frappe
def execute():
frappe.db.sql("""
update
`tabPurchase Receipt`
set
status = 'To Bill'
where
status = 'Submitted'""") | true | true |
f7037e199865a1b95556700d0a7781ddb980ced3 | 67,271 | py | Python | tests/store/model_registry/test_sqlalchemy_store.py | abhiramr/mlflow | 2bbdc20f2d90d551fb7d40f982f2f799da9feca8 | [
"Apache-2.0"
] | null | null | null | tests/store/model_registry/test_sqlalchemy_store.py | abhiramr/mlflow | 2bbdc20f2d90d551fb7d40f982f2f799da9feca8 | [
"Apache-2.0"
] | null | null | null | tests/store/model_registry/test_sqlalchemy_store.py | abhiramr/mlflow | 2bbdc20f2d90d551fb7d40f982f2f799da9feca8 | [
"Apache-2.0"
] | null | null | null | import os
import unittest
import tempfile
from unittest import mock
import uuid
import mlflow
import mlflow.db
import mlflow.store.db.base_sql_model
from mlflow.entities.model_registry import (
RegisteredModel,
ModelVersion,
RegisteredModelTag,
ModelVersionTag,
)
from mlflow.exceptions import MlflowEx... | 46.944173 | 100 | 0.663154 | import os
import unittest
import tempfile
from unittest import mock
import uuid
import mlflow
import mlflow.db
import mlflow.store.db.base_sql_model
from mlflow.entities.model_registry import (
RegisteredModel,
ModelVersion,
RegisteredModelTag,
ModelVersionTag,
)
from mlflow.exceptions import MlflowEx... | true | true |
f7037f546b10ab4102b4b86bf61a04e560b49f85 | 13,327 | py | Python | digits/tools/test_parse_s3.py | Benedict93/DIGITS | 4be733f02ae79a2e75f5d07af396f38d356e1ff4 | [
"BSD-3-Clause"
] | 4,552 | 2015-03-17T17:24:11.000Z | 2022-03-27T04:07:58.000Z | digits/tools/test_parse_s3.py | Benedict93/DIGITS | 4be733f02ae79a2e75f5d07af396f38d356e1ff4 | [
"BSD-3-Clause"
] | 1,994 | 2015-03-17T21:46:44.000Z | 2022-03-19T18:20:29.000Z | digits/tools/test_parse_s3.py | Benedict93/DIGITS | 4be733f02ae79a2e75f5d07af396f38d356e1ff4 | [
"BSD-3-Clause"
] | 1,791 | 2015-03-17T17:51:05.000Z | 2022-03-08T13:44:40.000Z | # Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved.
import itertools
import os
import shutil
import tempfile
import mock
from nose.tools import raises, assert_raises
try:
from . import parse_s3
from digits.tools.mock_s3_walker import MockS3Walker
import_failed = False
except ImportError:... | 36.214674 | 115 | 0.619869 |
import itertools
import os
import shutil
import tempfile
import mock
from nose.tools import raises, assert_raises
try:
from . import parse_s3
from digits.tools.mock_s3_walker import MockS3Walker
import_failed = False
except ImportError:
import_failed = True
from digits import test_utils
test_util... | true | true |
f70380311cfd080c813d27a91a6974abd86c2888 | 12,424 | py | Python | broccoli/plugins.py | vulnersCom/broccoli | 273c9f60c72ca0de2fb1588f88b6da255f3e0322 | [
"MIT"
] | 3 | 2018-04-24T09:33:03.000Z | 2021-02-16T02:14:58.000Z | broccoli/plugins.py | vulnersCom/broccoli | 273c9f60c72ca0de2fb1588f88b6da255f3e0322 | [
"MIT"
] | null | null | null | broccoli/plugins.py | vulnersCom/broccoli | 273c9f60c72ca0de2fb1588f88b6da255f3e0322 | [
"MIT"
] | 1 | 2019-11-08T15:14:09.000Z | 2019-11-08T15:14:09.000Z | import re
import time
import typing
import logging
from calendar import monthrange
from datetime import datetime
from collections import Iterable
from heapq import heappush, heappop
from . import types # noqa
from . exceptions import BrokerError
from . interfaces import App, Plugin, Logger
from . utils import cached_p... | 34.898876 | 79 | 0.525998 | import re
import time
import typing
import logging
from calendar import monthrange
from datetime import datetime
from collections import Iterable
from heapq import heappush, heappop
from . import types
from . exceptions import BrokerError
from . interfaces import App, Plugin, Logger
from . utils import cached_propert... | true | true |
f703808ba89e85e0b17a1b390f31606eb6d19386 | 2,313 | py | Python | torch/distributed/elastic/rendezvous/registry.py | sigmunjr/pytorch | 526e12029274cf0257954616d5cd5260b1021f52 | [
"Intel"
] | 1 | 2021-05-11T11:53:47.000Z | 2021-05-11T11:53:47.000Z | torch/distributed/elastic/rendezvous/registry.py | sigmunjr/pytorch | 526e12029274cf0257954616d5cd5260b1021f52 | [
"Intel"
] | null | null | null | torch/distributed/elastic/rendezvous/registry.py | sigmunjr/pytorch | 526e12029274cf0257954616d5cd5260b1021f52 | [
"Intel"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
from .api import RendezvousHandler, RendezvousParameters
from .api import rendezvous_handler_registry as handler_... | 34.014706 | 92 | 0.793342 |
from .api import RendezvousHandler, RendezvousParameters
from .api import rendezvous_handler_registry as handler_registry
from .dynamic_rendezvous import create_handler
def _create_static_handler(params: RendezvousParameters) -> RendezvousHandler:
from . import static_tcp_rendezvous
return static_tcp_r... | true | true |
f70380c5f6f598fd66459071a4078c0cc10c2a22 | 6,058 | py | Python | redlure-console.py | redlure/redlure-console | e59dabaea240976bffe645148a0eb95d1075143d | [
"BSD-3-Clause"
] | 21 | 2020-08-09T04:28:46.000Z | 2022-02-23T10:29:50.000Z | redlure-console.py | redlure/redlure-console | e59dabaea240976bffe645148a0eb95d1075143d | [
"BSD-3-Clause"
] | 9 | 2021-03-31T15:43:17.000Z | 2022-03-26T16:40:18.000Z | redlure-console.py | redlure/redlure-console | e59dabaea240976bffe645148a0eb95d1075143d | [
"BSD-3-Clause"
] | 7 | 2020-08-14T20:48:42.000Z | 2022-03-16T22:02:36.000Z | #!/usr/bin/env python3
from app import app, db, functions
from app.functions import Color
import subprocess
import os
import shlex
import shutil
from config import Config
from datetime import datetime
from cryptography.fernet import InvalidToken
from app.cipher import CipherTest, Cipher, new_cipher_key, encrypt, decryp... | 35.017341 | 151 | 0.651535 |
from app import app, db, functions
from app.functions import Color
import subprocess
import os
import shlex
import shutil
from config import Config
from datetime import datetime
from cryptography.fernet import InvalidToken
from app.cipher import CipherTest, Cipher, new_cipher_key, encrypt, decrypt
from app.workspace i... | true | true |
f70380d80d551bbc351d9ece8199eacdade9c151 | 6,731 | py | Python | rwt_robot_monitor/test/test_rwt_robot_monitor_plotter.py | Affonso-Gui/visualization_rwt | 9c015164e95ec13492dac9bf433c082355168ce4 | [
"BSD-3-Clause"
] | 33 | 2015-05-27T00:07:15.000Z | 2022-02-05T21:55:14.000Z | rwt_robot_monitor/test/test_rwt_robot_monitor_plotter.py | Affonso-Gui/visualization_rwt | 9c015164e95ec13492dac9bf433c082355168ce4 | [
"BSD-3-Clause"
] | 41 | 2015-02-06T09:33:24.000Z | 2022-03-21T05:06:29.000Z | rwt_robot_monitor/test/test_rwt_robot_monitor_plotter.py | Affonso-Gui/visualization_rwt | 9c015164e95ec13492dac9bf433c082355168ce4 | [
"BSD-3-Clause"
] | 38 | 2016-01-27T05:34:34.000Z | 2022-03-21T05:03:48.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Software License Agreement (BSD License)
#
# Copyright (c) 2021, Kei Okada
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions... | 39.133721 | 119 | 0.679988 |
import argparse
import sys
import time
import rospy
import rostest
import unittest
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from seleniu... | true | true |
f70380dd5f4275cd1df2a70863a2cb9bd97885b2 | 2,135 | py | Python | tests/test_config.py | pete-twibill/alertlogic-sdk-python | 5449dc3db312ba42de43cd8c9d86a68732c4c319 | [
"MIT"
] | 4 | 2020-05-14T11:18:07.000Z | 2021-09-30T13:20:34.000Z | tests/test_config.py | pete-twibill/alertlogic-sdk-python | 5449dc3db312ba42de43cd8c9d86a68732c4c319 | [
"MIT"
] | 26 | 2020-05-18T14:58:12.000Z | 2021-11-29T16:57:04.000Z | tests/test_config.py | pete-twibill/alertlogic-sdk-python | 5449dc3db312ba42de43cd8c9d86a68732c4c319 | [
"MIT"
] | 23 | 2020-02-10T09:14:05.000Z | 2022-01-27T23:44:54.000Z | import unittest
from almdrlib.session import Session
import re
MOCK_AUTH = {
"authentication": {
"user": {
"id": "589B64BB-AE91-4FA9-A6D8-37AC6759BB5D",
"account_id": "2",
"created": {
"at": 1443713420,
"by": "693BA145-78C0-4C77-AC1A-53854... | 26.358025 | 89 | 0.533489 | import unittest
from almdrlib.session import Session
import re
MOCK_AUTH = {
"authentication": {
"user": {
"id": "589B64BB-AE91-4FA9-A6D8-37AC6759BB5D",
"account_id": "2",
"created": {
"at": 1443713420,
"by": "693BA145-78C0-4C77-AC1A-53854... | true | true |
f70381bc71cd4b54071ed982ffd4ba5b95af32fa | 1,866 | py | Python | synapse/__init__.py | schildbach/synapse | 3aa36b782c715a2d3c965d5d9b37f7a49a5f17e1 | [
"Apache-2.0"
] | 1 | 2020-10-10T13:23:05.000Z | 2020-10-10T13:23:05.000Z | synapse/__init__.py | schildbach/synapse | 3aa36b782c715a2d3c965d5d9b37f7a49a5f17e1 | [
"Apache-2.0"
] | null | null | null | synapse/__init__.py | schildbach/synapse | 3aa36b782c715a2d3c965d5d9b37f7a49a5f17e1 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2014-2016 OpenMarket Ltd
# Copyright 2018-9 New Vector Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2... | 31.627119 | 79 | 0.752947 |
import json
import os
import sys
if sys.version_info < (3, 5):
print("Synapse requires Python 3.5 or above.")
sys.exit(1)
# Twisted and canonicaljson will fail to import when this file is executed to
# get the __version__ during a fresh install. That's OK and subsequent calls to
try:
fr... | true | true |
f7038372acea8564b8305e0beb5f6d7f87ed3aa9 | 6,454 | py | Python | experiments/increasing_dim/Exp_1/kron.py | vdutor/VFF | 459be5b480bba49e8c15dc7daeca5fd1ddd762df | [
"Apache-2.0"
] | 75 | 2016-11-21T21:50:12.000Z | 2022-03-22T17:56:36.000Z | experiments/increasing_dim/Exp_1/kron.py | vdutor/VFF | 459be5b480bba49e8c15dc7daeca5fd1ddd762df | [
"Apache-2.0"
] | 4 | 2018-03-22T19:47:08.000Z | 2021-10-06T14:49:54.000Z | experiments/increasing_dim/Exp_1/kron.py | vdutor/VFF | 459be5b480bba49e8c15dc7daeca5fd1ddd762df | [
"Apache-2.0"
] | 26 | 2016-11-22T14:14:58.000Z | 2022-02-03T18:29:20.000Z | import numpy as np
import sys
import gpflow
import VFF
from time import time
from config import *
dim = sys.argv[1]
rep = sys.argv[2]
print('vff: dimension {}, replicate {}'.format(dim, r))
# data
data = np.load('data/data_dim{}_rep{}.npz'.format(dim, 0))
# full_gp
def prodkern(dim):
return gpflow.kernels.Pro... | 37.523256 | 101 | 0.503719 | import numpy as np
import sys
import gpflow
import VFF
from time import time
from config import *
dim = sys.argv[1]
rep = sys.argv[2]
print('vff: dimension {}, replicate {}'.format(dim, r))
data = np.load('data/data_dim{}_rep{}.npz'.format(dim, 0))
def prodkern(dim):
return gpflow.kernels.Prod([gpflow.kerne... | true | true |
f70383c83f8ac45d0ac95cb44577dc706c18ae28 | 8,317 | py | Python | datanator/data_source/rna_halflife/doi_10_1093_nar_gks1019.py | KarrLab/Kinetic-Datanator | 8aff047fd117033b98eca8ee3b21a8f07c430dec | [
"CC-BY-3.0",
"CC0-1.0",
"CC-BY-4.0",
"MIT"
] | 10 | 2018-11-20T17:04:09.000Z | 2021-08-24T18:29:06.000Z | datanator/data_source/rna_halflife/doi_10_1093_nar_gks1019.py | KarrLab/Kinetic-Datanator | 8aff047fd117033b98eca8ee3b21a8f07c430dec | [
"CC-BY-3.0",
"CC0-1.0",
"CC-BY-4.0",
"MIT"
] | 59 | 2018-11-23T20:42:11.000Z | 2020-11-08T19:51:36.000Z | datanator/data_source/rna_halflife/doi_10_1093_nar_gks1019.py | KarrLab/Kinetic-Datanator | 8aff047fd117033b98eca8ee3b21a8f07c430dec | [
"CC-BY-3.0",
"CC0-1.0",
"CC-BY-4.0",
"MIT"
] | 3 | 2018-12-15T00:53:54.000Z | 2021-08-24T18:29:08.000Z | import pandas as pd
from datanator.util import rna_halflife_util
import datetime
import datanator.config.core
import datetime
from pymongo.collation import Collation, CollationStrength
class Halflife(rna_halflife_util.RnaHLUtil):
def __init__(self, cache_dir=None, server=None, src_db=None, protein_col=None,
... | 59.407143 | 555 | 0.593123 | import pandas as pd
from datanator.util import rna_halflife_util
import datetime
import datanator.config.core
import datetime
from pymongo.collation import Collation, CollationStrength
class Halflife(rna_halflife_util.RnaHLUtil):
def __init__(self, cache_dir=None, server=None, src_db=None, protein_col=None,
... | true | true |
f703863d27b157411139d10736ab6cddb11462a0 | 4,522 | py | Python | tests/integration/issues/hanging_termination/test_hanging_termination.py | Akshat-unt/jina | b0b058f99f3ee4dcbcbbf2acbf04c5d7e7e9c717 | [
"Apache-2.0"
] | 1 | 2021-12-18T06:54:49.000Z | 2021-12-18T06:54:49.000Z | tests/integration/issues/hanging_termination/test_hanging_termination.py | Akshat-unt/jina | b0b058f99f3ee4dcbcbbf2acbf04c5d7e7e9c717 | [
"Apache-2.0"
] | 2 | 2021-12-17T15:22:12.000Z | 2021-12-18T07:19:06.000Z | tests/integration/issues/hanging_termination/test_hanging_termination.py | Akshat-unt/jina | b0b058f99f3ee4dcbcbbf2acbf04c5d7e7e9c717 | [
"Apache-2.0"
] | null | null | null | import os
from pathlib import Path
import numpy as np
import pytest
from jina import Flow, Document
from jina.clients import Client
from jina.logging.profile import TimeContext
from jina.parsers import set_client_cli_parser
from typing import Dict
from jina import DocumentArray, Executor, requests
class DumpExecuto... | 32.3 | 85 | 0.568996 | import os
from pathlib import Path
import numpy as np
import pytest
from jina import Flow, Document
from jina.clients import Client
from jina.logging.profile import TimeContext
from jina.parsers import set_client_cli_parser
from typing import Dict
from jina import DocumentArray, Executor, requests
class DumpExecuto... | true | true |
f70386457425b8a79d1bf8bba8f25e6afd14e258 | 2,013 | py | Python | utils/timeout.py | trilogy-group/kayako-dd-agent | 4a4cce9a367a6a522f3f4290819cbcd3ef637832 | [
"BSD-3-Clause"
] | 76 | 2015-02-09T12:20:12.000Z | 2022-03-31T04:29:35.000Z | utils/timeout.py | fotinakis/dd-agent | b8642a36f26190b7bed3208e145bd3ac4cc4f59b | [
"BSD-3-Clause"
] | 58 | 2015-01-12T08:57:23.000Z | 2021-09-24T23:06:23.000Z | utils/timeout.py | fotinakis/dd-agent | b8642a36f26190b7bed3208e145bd3ac4cc4f59b | [
"BSD-3-Clause"
] | 31 | 2015-03-30T15:30:19.000Z | 2021-01-12T07:37:22.000Z | # (C) Datadog, Inc. 2010-2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
from threading import Thread
import functools
_thread_by_func = {}
class TimeoutException(Exception):
"""
Raised when a function runtime exceeds the limit set.
"""
pass
class ThreadMethod(Thre... | 26.84 | 99 | 0.606557 |
from threading import Thread
import functools
_thread_by_func = {}
class TimeoutException(Exception):
pass
class ThreadMethod(Thread):
def __init__(self, target, args, kwargs):
Thread.__init__(self)
self.setDaemon(True)
self.target, self.args, self.kwargs = target, args, kwargs
... | true | true |
f703876b792a5aa0ae1f2b68123b4b424e567173 | 2,939 | py | Python | designate/scheduler/filters/pool_id_attribute_filter.py | mrlesmithjr/designate | bff3d5f6e31fe595a77143ec4ac779c187bf72a8 | [
"Apache-2.0"
] | 145 | 2015-01-02T09:35:53.000Z | 2021-12-14T17:03:53.000Z | designate/scheduler/filters/pool_id_attribute_filter.py | mrlesmithjr/designate | bff3d5f6e31fe595a77143ec4ac779c187bf72a8 | [
"Apache-2.0"
] | 6 | 2015-03-15T00:22:27.000Z | 2019-12-16T09:37:38.000Z | designate/scheduler/filters/pool_id_attribute_filter.py | mrlesmithjr/designate | bff3d5f6e31fe595a77143ec4ac779c187bf72a8 | [
"Apache-2.0"
] | 109 | 2015-01-13T16:47:34.000Z | 2021-03-15T13:18:48.000Z | # Copyright 2016 Hewlett Packard Enterprise Development Company, L.P.
#
# 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 b... | 34.576471 | 78 | 0.636611 |
from oslo_log import log as logging
from designate import exceptions
from designate import objects
from designate import policy
from designate.scheduler.filters import base
LOG = logging.getLogger(__name__)
class PoolIDAttributeFilter(base.Filter):
name = 'pool_id_attribute'
def filter(self, ... | true | true |
f703884b878ba570bfebe96909363b76a6c9c45f | 34 | py | Python | operation/__init__.py | gretchi/twim | 20a4bf459182a01d535cfb948d8b30de087585f1 | [
"MIT"
] | null | null | null | operation/__init__.py | gretchi/twim | 20a4bf459182a01d535cfb948d8b30de087585f1 | [
"MIT"
] | null | null | null | operation/__init__.py | gretchi/twim | 20a4bf459182a01d535cfb948d8b30de087585f1 | [
"MIT"
] | null | null | null |
from .operation import Operation
| 11.333333 | 32 | 0.823529 |
from .operation import Operation
| true | true |
f703884d0e67a0ffdabbd1f89173bd1ecbd974bb | 8,899 | py | Python | aiida/orm/utils/__init__.py | louisponet/aiida-core | 3214236df66a3792ee57fe38a06c0c3bb65861ab | [
"MIT",
"BSD-3-Clause"
] | 1 | 2016-09-12T10:51:00.000Z | 2016-09-12T10:51:00.000Z | aiida/orm/utils/__init__.py | louisponet/aiida-core | 3214236df66a3792ee57fe38a06c0c3bb65861ab | [
"MIT",
"BSD-3-Clause"
] | 17 | 2020-03-11T17:04:05.000Z | 2020-05-01T09:34:45.000Z | aiida/orm/utils/__init__.py | louisponet/aiida-core | 3214236df66a3792ee57fe38a06c0c3bb65861ab | [
"MIT",
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | 43.199029 | 120 | 0.684234 | true | true | |
f703888ac8620fcfd52e21ef458eecb61c9abac7 | 4,366 | py | Python | pynet/cam.py | claireguichon/pynet | 92706375e61fb5cb523548303b7d04769c9de134 | [
"CECILL-B"
] | null | null | null | pynet/cam.py | claireguichon/pynet | 92706375e61fb5cb523548303b7d04769c9de134 | [
"CECILL-B"
] | null | null | null | pynet/cam.py | claireguichon/pynet | 92706375e61fb5cb523548303b7d04769c9de134 | [
"CECILL-B"
] | null | null | null | # -*- coding: utf-8 -*-
##########################################################################
# NSAp - Copyright (C) CEA, 2019
# Distributed under the terms of the CeCILL-B license, as published by
# the CEA-CNRS-INRIA. Refer to the LICENSE file or to
# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
#... | 34.109375 | 77 | 0.598717 | true | true | |
f7038a4e3cc3a6dbe03fde86c4a7001c8c8b8b51 | 9,495 | py | Python | src/UI_assign_group_window.py | GatherLab/OLED-evaluation | 419dfd5d2c3773f5f90d76aef634f8b1cc0b6378 | [
"MIT"
] | null | null | null | src/UI_assign_group_window.py | GatherLab/OLED-evaluation | 419dfd5d2c3773f5f90d76aef634f8b1cc0b6378 | [
"MIT"
] | null | null | null | src/UI_assign_group_window.py | GatherLab/OLED-evaluation | 419dfd5d2c3773f5f90d76aef634f8b1cc0b6378 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from PySide2 import QtCore, QtGui, QtWidgets
import json
import core_functions as cf
import numpy as np
from UI_labeled_slider import LabeledSlider
class Ui_AssignGroup(object):
def setupUi(self, AssignGroups):
# Note: this is not how it should be done but currently I don't know
... | 42.013274 | 89 | 0.618325 |
from PySide2 import QtCore, QtGui, QtWidgets
import json
import core_functions as cf
import numpy as np
from UI_labeled_slider import LabeledSlider
class Ui_AssignGroup(object):
def setupUi(self, AssignGroups):
# how to do it differently. This is only needed to be able to emit
# signal... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.