hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
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 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f723b4692781630404d7488f4a6f1b33fb840d4b | 2,190 | py | Python | newssimilarity/model/article.py | imackerracher/NewsSimilarity | 2e6a85dc9e95ef94bec2339987950f4e88f5d909 | [
"Apache-2.0"
] | null | null | null | newssimilarity/model/article.py | imackerracher/NewsSimilarity | 2e6a85dc9e95ef94bec2339987950f4e88f5d909 | [
"Apache-2.0"
] | null | null | null | newssimilarity/model/article.py | imackerracher/NewsSimilarity | 2e6a85dc9e95ef94bec2339987950f4e88f5d909 | [
"Apache-2.0"
] | null | null | null | """
Article object, read in from json
"""
class Article(object):
def __init__(self, head, lead, body,
date, time, writers,
publisher, source_outlet,
additional_information, annotation_list,
feature_list, raw_article):
"""
:param h... | 40.555556 | 117 | 0.637443 |
class Article(object):
def __init__(self, head, lead, body,
date, time, writers,
publisher, source_outlet,
additional_information, annotation_list,
feature_list, raw_article):
self.head = head
self.lead = lead
self.body =... | true | true |
f723b46aad1421a2e114cd58b3973ff37b96a76a | 3,323 | py | Python | plugins/mustGatherAccessor.py | rvanderp3/mg-helper | 349ac88e52bb3895044cb3e1f30046522cad9b0c | [
"Apache-2.0"
] | null | null | null | plugins/mustGatherAccessor.py | rvanderp3/mg-helper | 349ac88e52bb3895044cb3e1f30046522cad9b0c | [
"Apache-2.0"
] | null | null | null | plugins/mustGatherAccessor.py | rvanderp3/mg-helper | 349ac88e52bb3895044cb3e1f30046522cad9b0c | [
"Apache-2.0"
] | null | null | null | import yaml
import os.path
from os import path
import tarfile
class MustGatherAccessor:
tarcache = None
tar = None
name = "must-gather accessor"
def __init__ (self,filename):
self.filename = filename
def readfile(self):
if path.isdir(self.filename):
pass... | 31.647619 | 88 | 0.476076 | import yaml
import os.path
from os import path
import tarfile
class MustGatherAccessor:
tarcache = None
tar = None
name = "must-gather accessor"
def __init__ (self,filename):
self.filename = filename
def readfile(self):
if path.isdir(self.filename):
pass... | true | true |
f723b4994184ba630e2af0efd757f41de6e1bb07 | 5,242 | py | Python | vision/tests/unit/gapic/v1/test_image_annotator_client_v1.py | nielm/google-cloud-python | fd126fdea34206109eb00d675374ff7dc4dcc5ef | [
"Apache-2.0"
] | 1 | 2019-01-23T21:54:51.000Z | 2019-01-23T21:54:51.000Z | vision/tests/unit/gapic/v1/test_image_annotator_client_v1.py | nielm/google-cloud-python | fd126fdea34206109eb00d675374ff7dc4dcc5ef | [
"Apache-2.0"
] | 1 | 2018-04-06T19:51:23.000Z | 2018-04-06T19:51:23.000Z | vision/tests/unit/gapic/v1/test_image_annotator_client_v1.py | nielm/google-cloud-python | fd126fdea34206109eb00d675374ff7dc4dcc5ef | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright 2019 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... | 32.968553 | 87 | 0.681801 |
import mock
import pytest
from google.rpc import status_pb2
from google.cloud import vision_v1
from google.cloud.vision_v1.proto import image_annotator_pb2
from google.longrunning import operations_pb2
class MultiCallableStub(object):
def __init__(self, method, channel_stub):
self.metho... | true | true |
f723b4aa1f30b8829647c7182eab4c6610d10e07 | 845 | py | Python | lib/jayrboltonTest/contig_filter_util.py | jayrbolton/kbase_tutorial_contig_filter | 66b5f50db8f584e13a0923bda6f0008c12438d88 | [
"MIT"
] | null | null | null | lib/jayrboltonTest/contig_filter_util.py | jayrbolton/kbase_tutorial_contig_filter | 66b5f50db8f584e13a0923bda6f0008c12438d88 | [
"MIT"
] | null | null | null | lib/jayrboltonTest/contig_filter_util.py | jayrbolton/kbase_tutorial_contig_filter | 66b5f50db8f584e13a0923bda6f0008c12438d88 | [
"MIT"
] | null | null | null | from Bio import SeqIO
def contig_filter(input_path, filtered_path, min_length):
# Inside {username}ContigFilterImpl#run_{username}ContigFilter_max, after you have fetched the fasta file:
# Parse the downloaded file in FASTA format
parsed_assembly = SeqIO.parse(input_path, 'fasta')
min_length = min_len... | 32.5 | 110 | 0.678107 | from Bio import SeqIO
def contig_filter(input_path, filtered_path, min_length):
ngth = min_length
good_contigs = []
n_total = 0
n_remaining = 0
for record in list(parsed_assembly):
n_total += 1
if len(record.seq) >= min_length:
good_contigs.append(record)... | true | true |
f723b5aababa8476e324ce06e1a59d0b7db72c76 | 1,881 | py | Python | okapi/urls.py | jbbqqf/okapi | 3db29ef1e15685fae304190bd176f75c4e367d03 | [
"BSD-3-Clause"
] | null | null | null | okapi/urls.py | jbbqqf/okapi | 3db29ef1e15685fae304190bd176f75c4e367d03 | [
"BSD-3-Clause"
] | null | null | null | okapi/urls.py | jbbqqf/okapi | 3db29ef1e15685fae304190bd176f75c4e367d03 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""okapi URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home,... | 35.490566 | 77 | 0.66773 |
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.conf.urls.static import static
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'^okauth/', include('okau... | true | true |
f723b70c324fc4c0f3106b87f660b2c3aa92b9e8 | 6,885 | py | Python | thingsboard_gateway/tb_utility/tb_utility.py | meuron-io/thingsboard-gateway | 26e7299047507c74613aeea1f19dcdba2e1e5644 | [
"Apache-2.0"
] | 1,123 | 2017-02-07T13:09:40.000Z | 2022-03-30T10:40:48.000Z | thingsboard_gateway/tb_utility/tb_utility.py | meuron-io/thingsboard-gateway | 26e7299047507c74613aeea1f19dcdba2e1e5644 | [
"Apache-2.0"
] | 655 | 2017-03-07T17:25:55.000Z | 2022-03-31T07:59:53.000Z | thingsboard_gateway/tb_utility/tb_utility.py | meuron-io/thingsboard-gateway | 26e7299047507c74613aeea1f19dcdba2e1e5644 | [
"Apache-2.0"
] | 648 | 2017-02-07T13:32:30.000Z | 2022-03-31T05:17:55.000Z | # Copyright 2021. ThingsBoard
#
# 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 ... | 40.263158 | 126 | 0.548729 |
from logging import getLogger
from re import search, findall
from jsonpath_rw import parse
from simplejson import JSONDecodeError, dumps, loads
log = getLogger("service")
class TBUtility:
@staticmethod
def decode(message):
try:
if isinstance(message.payload, bytes):
... | true | true |
f723b735cf5e93033b633872fb57a7d0a690f5b6 | 37,513 | py | Python | taxcalc/tests/test_calculate.py | ClarePan/Tax-Calculator | d2d6cb4b551f34017db7166d91d982b5c4670816 | [
"CC0-1.0"
] | 1 | 2021-02-23T21:03:43.000Z | 2021-02-23T21:03:43.000Z | taxcalc/tests/test_calculate.py | ClarePan/Tax-Calculator | d2d6cb4b551f34017db7166d91d982b5c4670816 | [
"CC0-1.0"
] | null | null | null | taxcalc/tests/test_calculate.py | ClarePan/Tax-Calculator | d2d6cb4b551f34017db7166d91d982b5c4670816 | [
"CC0-1.0"
] | null | null | null | # CODING-STYLE CHECKS:
# pycodestyle test_calculate.py
import os
import json
from io import StringIO
import tempfile
import copy
import six
import pytest
import numpy as np
import pandas as pd
from taxcalc import Policy, Records, Calculator, Behavior, Consumption
RAWINPUTFILE_FUNITS = 4
RAWINPUTFILE_YEAR = 2015
RAWI... | 38.200611 | 79 | 0.632208 |
import os
import json
from io import StringIO
import tempfile
import copy
import six
import pytest
import numpy as np
import pandas as pd
from taxcalc import Policy, Records, Calculator, Behavior, Consumption
RAWINPUTFILE_FUNITS = 4
RAWINPUTFILE_YEAR = 2015
RAWINPUTFILE_CONTENTS = (
'RECID,MARS\n'
'1,2\n'
... | true | true |
f723b7721b96101a76c0e12c365a4083110cae7a | 3,147 | py | Python | drafthub/core/templatetags/drafthub_extras.py | felipelincoln/drafthub | e8a6055205646d45c26419938c3277f544931925 | [
"MIT"
] | 3 | 2020-05-13T09:54:27.000Z | 2021-01-06T17:46:53.000Z | drafthub/core/templatetags/drafthub_extras.py | felipelincoln/drafthub | e8a6055205646d45c26419938c3277f544931925 | [
"MIT"
] | 3 | 2020-05-20T17:27:10.000Z | 2020-05-20T20:41:37.000Z | drafthub/core/templatetags/drafthub_extras.py | felipelincoln/drafthub | e8a6055205646d45c26419938c3277f544931925 | [
"MIT"
] | null | null | null | import requests
import re
from django import template
from django.utils.safestring import mark_safe
import markdown as _markdown
import bleach
from pymdownx import emoji
from drafthub.draft.utils import get_data_from_url
markdown_kwargs = {
'extensions':[
'pymdownx.superfences',
'markdown.extensi... | 24.395349 | 79 | 0.5796 | import requests
import re
from django import template
from django.utils.safestring import mark_safe
import markdown as _markdown
import bleach
from pymdownx import emoji
from drafthub.draft.utils import get_data_from_url
markdown_kwargs = {
'extensions':[
'pymdownx.superfences',
'markdown.extensi... | true | true |
f723b7b58e53b5843835f93d00c72899fbaaa3ce | 16,086 | py | Python | models/model/seq2seq_im_mask_cnn_finetune.py | shivgarg/alfred_transformers | 3eab07d3a218eb9b809dec8b7120b92ebd00c890 | [
"MIT"
] | null | null | null | models/model/seq2seq_im_mask_cnn_finetune.py | shivgarg/alfred_transformers | 3eab07d3a218eb9b809dec8b7120b92ebd00c890 | [
"MIT"
] | null | null | null | models/model/seq2seq_im_mask_cnn_finetune.py | shivgarg/alfred_transformers | 3eab07d3a218eb9b809dec8b7120b92ebd00c890 | [
"MIT"
] | null | null | null | import os
import torch
import numpy as np
import nn.vnn as vnn
import collections
from torch import nn
from torch.nn import functional as F
from torch.nn.utils.rnn import pad_sequence, pack_padded_sequence, pad_packed_sequence
from model.seq2seq import Module as Base
from models.utils.metric import compute_f1, compute_... | 40.724051 | 174 | 0.586597 | import os
import torch
import numpy as np
import nn.vnn as vnn
import collections
from torch import nn
from torch.nn import functional as F
from torch.nn.utils.rnn import pad_sequence, pack_padded_sequence, pad_packed_sequence
from model.seq2seq import Module as Base
from models.utils.metric import compute_f1, compute_... | true | true |
f723b7ecde46f054272f9893ebd0e63cffbd1cd6 | 6,773 | py | Python | tests/gamestonk_terminal/etf/discovery/test_disc_controller.py | GarnixJu2015/GamestonkTerminal | ec400e46ddce4ac934af836b863528f14a13d865 | [
"MIT"
] | null | null | null | tests/gamestonk_terminal/etf/discovery/test_disc_controller.py | GarnixJu2015/GamestonkTerminal | ec400e46ddce4ac934af836b863528f14a13d865 | [
"MIT"
] | null | null | null | tests/gamestonk_terminal/etf/discovery/test_disc_controller.py | GarnixJu2015/GamestonkTerminal | ec400e46ddce4ac934af836b863528f14a13d865 | [
"MIT"
] | null | null | null | # IMPORTATION STANDARD
import os
# IMPORTATION THIRDPARTY
import pandas as pd
import pytest
# IMPORTATION INTERNAL
from gamestonk_terminal.etf.discovery import disc_controller
# pylint: disable=E1101
# pylint: disable=W0603
# pylint: disable=E1111
EMPTY_DF = pd.DataFrame()
@pytest.mark.vcr(record_mode="none")
@py... | 25.272388 | 82 | 0.579655 |
import os
import pandas as pd
import pytest
from gamestonk_terminal.etf.discovery import disc_controller
EMPTY_DF = pd.DataFrame()
@pytest.mark.vcr(record_mode="none")
@pytest.mark.parametrize(
"queue, expected",
[
(["load", "help"], []),
(["quit", "help"], ["help"]),
],
)
def te... | true | true |
f723b9c35cf5df83c827a8fdfdc3fba5d26b81e7 | 728 | py | Python | Python/FromUniversity/PYQT5/testgame.py | programmer-666/Codes | fdffe38a789ba3636dff7ceaa9f1b4113ae17c2b | [
"MIT"
] | null | null | null | Python/FromUniversity/PYQT5/testgame.py | programmer-666/Codes | fdffe38a789ba3636dff7ceaa9f1b4113ae17c2b | [
"MIT"
] | null | null | null | Python/FromUniversity/PYQT5/testgame.py | programmer-666/Codes | fdffe38a789ba3636dff7ceaa9f1b4113ae17c2b | [
"MIT"
] | 1 | 2021-09-16T14:24:29.000Z | 2021-09-16T14:24:29.000Z | import sys
from PyQt5 import QtWidgets
class game(QtWidgets.QMainWindow):
def __init__(self):
self.ap = QtWidgets.QApplication(sys.argv)
super(game, self).__init__()
self.setGeometry(100,100,200,200)
self.conts()
self.x = 50
self.y = 50
def moving(self):
s... | 28 | 50 | 0.590659 | import sys
from PyQt5 import QtWidgets
class game(QtWidgets.QMainWindow):
def __init__(self):
self.ap = QtWidgets.QApplication(sys.argv)
super(game, self).__init__()
self.setGeometry(100,100,200,200)
self.conts()
self.x = 50
self.y = 50
def moving(self):
s... | true | true |
f723bb3a1ed4cb91e25d960a0f850160a5553547 | 112,619 | py | Python | pygsti/models/modelconstruction.py | maij/pyGSTi | 70e83e05fa689f53550feb3914c4fac40ca4a943 | [
"Apache-2.0"
] | 73 | 2016-01-28T05:02:05.000Z | 2022-03-30T07:46:33.000Z | pygsti/models/modelconstruction.py | 00mjk/pyGSTi | 4f8bf5337b01b7afcb7b0580b717b5d1fe281be4 | [
"Apache-2.0"
] | 113 | 2016-02-25T15:32:18.000Z | 2022-03-31T13:18:13.000Z | pygsti/models/modelconstruction.py | 00mjk/pyGSTi | 4f8bf5337b01b7afcb7b0580b717b5d1fe281be4 | [
"Apache-2.0"
] | 41 | 2016-03-15T19:32:07.000Z | 2022-02-16T10:22:05.000Z | """
Functions for the construction of new models.
"""
#***************************************************************************************************
# Copyright 2015, 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
# Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Government... | 53.577069 | 120 | 0.64688 |
import collections as _collections
import itertools as _itertools
from os import stat
from pygsti.modelmembers.instruments.instrument import Instrument
import numpy as _np
import scipy as _scipy
import scipy.linalg as _spl
from pygsti.evotypes import Evotype as _Evotype
from pygsti.modelmembers import operat... | true | true |
f723bc9754ddb86c41340d88ffa3f486b80a42f3 | 258 | py | Python | weight_converter/utils.py | adamriaz/weight-converter | 1ac82ef2935e76ec6c78f322e995fbce6454b6c8 | [
"MIT"
] | null | null | null | weight_converter/utils.py | adamriaz/weight-converter | 1ac82ef2935e76ec6c78f322e995fbce6454b6c8 | [
"MIT"
] | null | null | null | weight_converter/utils.py | adamriaz/weight-converter | 1ac82ef2935e76ec6c78f322e995fbce6454b6c8 | [
"MIT"
] | null | null | null | def divide_by_zero_check(func):
"""
Decorator for checking division by zero from user input
"""
def inner(value):
if value.value == 0:
raise ValueError('Cannot divide by zero!')
return func(value)
return inner
| 25.8 | 59 | 0.616279 | def divide_by_zero_check(func):
def inner(value):
if value.value == 0:
raise ValueError('Cannot divide by zero!')
return func(value)
return inner
| true | true |
f723be6ac409c60b2a0d167791d7a99d3f39abbb | 2,575 | py | Python | external_libs/spglib-1.9.9/python/test/test_hall_number_from_symmetry.py | shunsuke-sato/octopus | dcf68a185cdb13708395546b1557ca46aed969f6 | [
"Apache-2.0"
] | 4 | 2016-11-17T09:03:11.000Z | 2019-10-17T06:31:08.000Z | external_libs/spglib-1.9.9/python/test/test_hall_number_from_symmetry.py | shunsuke-sato/octopus | dcf68a185cdb13708395546b1557ca46aed969f6 | [
"Apache-2.0"
] | 1 | 2020-08-11T19:14:06.000Z | 2020-08-11T19:14:06.000Z | external_libs/spglib-1.9.9/python/test/test_hall_number_from_symmetry.py | shunsuke-sato/octopus | dcf68a185cdb13708395546b1557ca46aed969f6 | [
"Apache-2.0"
] | 5 | 2016-11-22T20:30:46.000Z | 2020-05-29T23:24:51.000Z | import unittest
import numpy as np
from spglib import get_symmetry_dataset, get_hall_number_from_symmetry
from vasp import read_vasp
from os import listdir
dirnames = ('cubic',
'hexagonal',
'monoclinic',
'orthorhombic',
'tetragonal',
'triclinic',
... | 39.015152 | 80 | 0.514951 | import unittest
import numpy as np
from spglib import get_symmetry_dataset, get_hall_number_from_symmetry
from vasp import read_vasp
from os import listdir
dirnames = ('cubic',
'hexagonal',
'monoclinic',
'orthorhombic',
'tetragonal',
'triclinic',
... | true | true |
f723be8c97c6be2454140fb16008806dc90a7f1d | 2,740 | py | Python | data/get_data.py | OmarJabri7/SAIA | f45f1d8073d4b56f5bed6f378f791102b067317c | [
"MIT"
] | 1 | 2022-03-22T19:11:48.000Z | 2022-03-22T19:11:48.000Z | data/get_data.py | OmarJabri7/Disaster-Tweets-Kaggle | 54dfee4684dbfd5bf6cb58cc3974abc051022022 | [
"MIT"
] | null | null | null | data/get_data.py | OmarJabri7/Disaster-Tweets-Kaggle | 54dfee4684dbfd5bf6cb58cc3974abc051022022 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
from nltk.corpus import words
import nltk
import re
import string
from data_processing import DisasterProcessor
X = pd.read_csv("emotion_data/tweet_emotions.csv")
stop_wrds = nltk.corpus.stopwords.words("english")
columns = X.columns
columns = ["content"]
preprocessor = Disaster... | 37.027027 | 113 | 0.630657 | import pandas as pd
import numpy as np
from nltk.corpus import words
import nltk
import re
import string
from data_processing import DisasterProcessor
X = pd.read_csv("emotion_data/tweet_emotions.csv")
stop_wrds = nltk.corpus.stopwords.words("english")
columns = X.columns
columns = ["content"]
preprocessor = Disaster... | true | true |
f723c10b490155fd4a2bd2ac7ff767f6f0cf72e9 | 8,494 | py | Python | crosshair/opcode_intercept.py | samuelchassot/CrossHair | 4eac7a23e470567cc23e6d0916ce6dd6820eacd8 | [
"MIT"
] | null | null | null | crosshair/opcode_intercept.py | samuelchassot/CrossHair | 4eac7a23e470567cc23e6d0916ce6dd6820eacd8 | [
"MIT"
] | null | null | null | crosshair/opcode_intercept.py | samuelchassot/CrossHair | 4eac7a23e470567cc23e6d0916ce6dd6820eacd8 | [
"MIT"
] | null | null | null | from collections.abc import MutableMapping, Set
import dis
from types import CodeType
from types import FrameType
from sys import version_info
from crosshair.core import CrossHairValue
from crosshair.core import register_opcode_patch
from crosshair.libimpl.builtinslib import SymbolicInt
from crosshair.libimpl.builtins... | 38.089686 | 88 | 0.674005 | from collections.abc import MutableMapping, Set
import dis
from types import CodeType
from types import FrameType
from sys import version_info
from crosshair.core import CrossHairValue
from crosshair.core import register_opcode_patch
from crosshair.libimpl.builtinslib import SymbolicInt
from crosshair.libimpl.builtins... | true | true |
f723c12709c80e71332f0ad4c801db953c05c2c8 | 1,652 | py | Python | linptech/packet.py | yangguozhanzhao/linptech | 92ee1538d11baf473535cd0ed6b879adcee66e70 | [
"MIT"
] | 1 | 2020-07-26T05:37:43.000Z | 2020-07-26T05:37:43.000Z | linptech/packet.py | yangguozhanzhao/linptech | 92ee1538d11baf473535cd0ed6b879adcee66e70 | [
"MIT"
] | null | null | null | linptech/packet.py | yangguozhanzhao/linptech | 92ee1538d11baf473535cd0ed6b879adcee66e70 | [
"MIT"
] | 2 | 2018-04-03T04:17:12.000Z | 2018-10-12T09:44:20.000Z | from linptech.crc8 import crc8
import logging
class Packet(object):
'''
Base class for Packet.
Mainly used for for packet generation and
Packet.parse_msg(buf) for parsing message.
parse_msg() returns subclass, if one is defined for the data type.
'''
def __init__(self, data=None, optional="00"*7):
if data i... | 23.6 | 67 | 0.672518 | from linptech.crc8 import crc8
import logging
class Packet(object):
def __init__(self, data=None, optional="00"*7):
if data is None:
logging.warning('Packet.data is None')
else:
self.data = data
if optional is None:
logging.info('Packet.optional is None.')
else:
self.optional = optional
@stat... | true | true |
f723c13ed49b8c87b5f0275078a084b4c8f235a1 | 16,785 | py | Python | test/latency_position_test.py | AustinHellerRepo/GameManager | 2eee8e821f551b4683e59ea8cde7e61c26cf8878 | [
"MIT"
] | null | null | null | test/latency_position_test.py | AustinHellerRepo/GameManager | 2eee8e821f551b4683e59ea8cde7e61c26cf8878 | [
"MIT"
] | null | null | null | test/latency_position_test.py | AustinHellerRepo/GameManager | 2eee8e821f551b4683e59ea8cde7e61c26cf8878 | [
"MIT"
] | null | null | null | from __future__ import annotations
import unittest
import time
import matplotlib.pyplot as plt
import numpy as np
from typing import List, Tuple, Dict, Set, Callable, Type
class Dot():
def __init__(self, position: Tuple[float, float], velocity: Tuple[float, float], acceleration: Tuple[float, float]):
self.__posi... | 28.305228 | 276 | 0.742985 | from __future__ import annotations
import unittest
import time
import matplotlib.pyplot as plt
import numpy as np
from typing import List, Tuple, Dict, Set, Callable, Type
class Dot():
def __init__(self, position: Tuple[float, float], velocity: Tuple[float, float], acceleration: Tuple[float, float]):
self.__posi... | true | true |
f723c14378cc4d16c4baa11917ffffcdd73ab43e | 190 | py | Python | mmdet3d/ops/paconv/__init__.py | maskjp/mmdetection3d | 98f332372b1a4c82bc2d57588a5d764f4176c869 | [
"Apache-2.0"
] | 1 | 2022-03-04T19:29:42.000Z | 2022-03-04T19:29:42.000Z | mmdet3d/ops/paconv/__init__.py | maskjp/mmdetection3d | 98f332372b1a4c82bc2d57588a5d764f4176c869 | [
"Apache-2.0"
] | null | null | null | mmdet3d/ops/paconv/__init__.py | maskjp/mmdetection3d | 98f332372b1a4c82bc2d57588a5d764f4176c869 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) OpenMMLab. All rights reserved.
from .assign_score import assign_score_withk
from .paconv import PAConv, PAConvCUDA
__all__ = ['assign_score_withk', 'PAConv', 'PAConvCUDA']
| 31.666667 | 56 | 0.784211 |
from .assign_score import assign_score_withk
from .paconv import PAConv, PAConvCUDA
__all__ = ['assign_score_withk', 'PAConv', 'PAConvCUDA']
| true | true |
f723c28d10fea756d280aba926ac651ddd9a5b0d | 354 | py | Python | wiser_care_theme/wiser_care_theme/doctype/wiser_website_settings/wiser_website_settings.py | MostafaFekry/wiser_care_theme | 9892442803dffeeb5e02136c87c2eb4cc9144b60 | [
"MIT"
] | null | null | null | wiser_care_theme/wiser_care_theme/doctype/wiser_website_settings/wiser_website_settings.py | MostafaFekry/wiser_care_theme | 9892442803dffeeb5e02136c87c2eb4cc9144b60 | [
"MIT"
] | null | null | null | wiser_care_theme/wiser_care_theme/doctype/wiser_website_settings/wiser_website_settings.py | MostafaFekry/wiser_care_theme | 9892442803dffeeb5e02136c87c2eb4cc9144b60 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2019, Systematic and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class WiserWebsiteSettings(Document):
def on_update(self):
from frappe.website.render import c... | 27.230769 | 49 | 0.788136 |
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class WiserWebsiteSettings(Document):
def on_update(self):
from frappe.website.render import clear_cache
clear_cache("index")
| true | true |
f723c4bdd9779dd352fdad7e5c8f3b6996c4c2ec | 982 | py | Python | data-pipline.py | helloxms/Disaster-Response-Pipline-Udacity | cd623ec339b766a7e91fe2e35de95062885c07de | [
"MIT"
] | null | null | null | data-pipline.py | helloxms/Disaster-Response-Pipline-Udacity | cd623ec339b766a7e91fe2e35de95062885c07de | [
"MIT"
] | null | null | null | data-pipline.py | helloxms/Disaster-Response-Pipline-Udacity | cd623ec339b766a7e91fe2e35de95062885c07de | [
"MIT"
] | null | null | null | # import packages
import sys
def load_data(data_file):
# read in file
# clean data
# load to database
# define features and label arrays
return X, y
def build_model():
# text processing and model pipeline
# define parameters for GridSearchCV
# c... | 16.098361 | 66 | 0.62831 |
import sys
def load_data(data_file):
return X, y
def build_model():
return model_pipeline
def train(X, y, model):
return model
def export_model(model):
def run_pipeline(data_file):
... | false | true |
f723c54aee85d58c016b328753e3fa153669b6d6 | 2,533 | py | Python | voctocore/tests/test_audiomix_multiple_sources.py | 0xflotus/voctomix | 3156f3546890e6ae8d379df17e5cc718eee14b15 | [
"MIT"
] | 521 | 2015-01-07T21:43:30.000Z | 2022-03-17T22:07:13.000Z | voctocore/tests/test_audiomix_multiple_sources.py | 0xflotus/voctomix | 3156f3546890e6ae8d379df17e5cc718eee14b15 | [
"MIT"
] | 241 | 2015-05-27T10:11:09.000Z | 2022-02-11T03:29:20.000Z | voctocore/tests/test_audiomix_multiple_sources.py | 0xflotus/voctomix | 3156f3546890e6ae8d379df17e5cc718eee14b15 | [
"MIT"
] | 111 | 2015-08-13T20:06:52.000Z | 2022-03-11T09:48:46.000Z | import unittest
from lib.errors.configuration_error import ConfigurationError
from tests.helper.voctomix_test import VoctomixTest
from lib.audiomix import AudioMix
from lib.config import Config
# noinspection PyUnusedLocal
class AudiomixMultipleSources(VoctomixTest):
def test_no_configured_audiosource_sets_first... | 36.185714 | 102 | 0.698776 | import unittest
from lib.errors.configuration_error import ConfigurationError
from tests.helper.voctomix_test import VoctomixTest
from lib.audiomix import AudioMix
from lib.config import Config
class AudiomixMultipleSources(VoctomixTest):
def test_no_configured_audiosource_sets_first_to_full(self):
audi... | true | true |
f723c5c9d3b222d7776eada4ac0bace2610445b6 | 450 | py | Python | V2RaycSpider1225/BusinessCentralLayer/middleware/work_io.py | kujie0121/V2RayCloudSpider | 32cd65f7811374679fe09cfae2fda805d42fe7ab | [
"MIT"
] | 1 | 2021-02-17T07:51:09.000Z | 2021-02-17T07:51:09.000Z | V2RaycSpider1225/BusinessCentralLayer/middleware/work_io.py | kujie0121/V2RayCloudSpider | 32cd65f7811374679fe09cfae2fda805d42fe7ab | [
"MIT"
] | null | null | null | V2RaycSpider1225/BusinessCentralLayer/middleware/work_io.py | kujie0121/V2RayCloudSpider | 32cd65f7811374679fe09cfae2fda805d42fe7ab | [
"MIT"
] | null | null | null | __all__ = ['Middleware']
from gevent.queue import Queue
# 工作栈
class Middleware:
# cache of redis
zeus = Queue()
# Trash
apollo = Queue()
theseus = {}
# 共享任务队列
poseidon = Queue()
hera = Queue()
# FIXME
# 不明原因bug 使用dict(zip())方案生成的同样的变量,
# 在经过同一个函数方案后输出竟然不一样
cach... | 16.666667 | 88 | 0.6 | __all__ = ['Middleware']
from gevent.queue import Queue
class Middleware:
zeus = Queue()
apollo = Queue()
theseus = {}
poseidon = Queue()
hera = Queue()
cache_redis_queue = {'ssr': {}, 'v2ray': {}}
| true | true |
f723c61d42e207f1fe86c447483a8df191033920 | 2,661 | py | Python | tests/test_basics.py | JunyongYao/flask-backend-seed | 9d16f56a9f34ebb1ec32eaab800b7ad6b10d0c9d | [
"MIT"
] | 9 | 2017-10-20T09:26:09.000Z | 2021-01-28T02:54:43.000Z | tests/test_basics.py | JunyongYao/flask-backend-seed | 9d16f56a9f34ebb1ec32eaab800b7ad6b10d0c9d | [
"MIT"
] | 2 | 2018-03-06T06:27:53.000Z | 2018-04-19T01:47:38.000Z | tests/test_basics.py | JunyongYao/flask-backend-seed | 9d16f56a9f34ebb1ec32eaab800b7ad6b10d0c9d | [
"MIT"
] | 2 | 2019-07-18T22:32:28.000Z | 2020-06-15T14:10:29.000Z | # -*- coding: utf-8 -*-
import json
import random
import string
import unittest
from flask import current_app
from config import config
from app import create_app, db, redis, add_api_support
class BasicsTestCase(unittest.TestCase):
def setUp(self):
test_app = create_app(config['testing'])
test_ap... | 32.45122 | 100 | 0.661405 |
import json
import random
import string
import unittest
from flask import current_app
from config import config
from app import create_app, db, redis, add_api_support
class BasicsTestCase(unittest.TestCase):
def setUp(self):
test_app = create_app(config['testing'])
test_app = add_api_support(tes... | true | true |
f723c69ef811ef7571c423cdbc18fa2896c2bcf8 | 4,253 | py | Python | datagen/meerkat.py | tilleyd/point-proposal-net | 3731984046cd56101238de30a441d610b79bc8b0 | [
"MIT"
] | null | null | null | datagen/meerkat.py | tilleyd/point-proposal-net | 3731984046cd56101238de30a441d610b79bc8b0 | [
"MIT"
] | null | null | null | datagen/meerkat.py | tilleyd/point-proposal-net | 3731984046cd56101238de30a441d610b79bc8b0 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
IMAGE_SIZE = 1024
NUM_SOURCES = 200
NUM_IMAGES = 1
RA_MIN, RA_MAX = (-50, 50)
DEC_MIN, DEC_MAX = (-30, 50)
OFFSET_RA = 1.1 # need to fine tune to fit sources into image
OFFSET_DEC = 0.7
#
# measure bg rms
#
from astropy.io import fits
import numpy as np
try:
# if there is already a backgroun... | 30.818841 | 106 | 0.517987 |
IMAGE_SIZE = 1024
NUM_SOURCES = 200
NUM_IMAGES = 1
RA_MIN, RA_MAX = (-50, 50)
DEC_MIN, DEC_MAX = (-30, 50)
OFFSET_RA = 1.1
OFFSET_DEC = 0.7
from astropy.io import fits
import numpy as np
try:
bg = np.squeeze(fits.getdata('output/0-nosource-image.fits'))
sigma = np.std(bg)
except Exception:
pr... | false | true |
f723c6be07f0c68bbd987b45988d3ea7dc170622 | 24,126 | py | Python | refactorings/utils/utils_listener_fast.py | mossj77/CodART | ac83a49a4aa9310b09da12fb476a84586812310b | [
"MIT"
] | 1 | 2021-10-10T23:56:49.000Z | 2021-10-10T23:56:49.000Z | refactorings/utils/utils_listener_fast.py | pouorix/CodART | 84b35a5a14e583d88319d7f6c2de8dc3b3dc83b2 | [
"MIT"
] | null | null | null | refactorings/utils/utils_listener_fast.py | pouorix/CodART | 84b35a5a14e583d88319d7f6c2de8dc3b3dc83b2 | [
"MIT"
] | null | null | null | import re # regular expressions
import antlr4
from antlr4.Token import CommonToken
import antlr4.tree
from antlr4.CommonTokenStream import CommonTokenStream
from typing import List, Optional
from gen.java.JavaParser import JavaParser
from gen.java.JavaParserListener import JavaParserListener
class Program:
def... | 40.822335 | 116 | 0.619829 | import re
import antlr4
from antlr4.Token import CommonToken
import antlr4.tree
from antlr4.CommonTokenStream import CommonTokenStream
from typing import List, Optional
from gen.java.JavaParser import JavaParser
from gen.java.JavaParserListener import JavaParserListener
class Program:
def __init__(self):
... | true | true |
f723c6d8b64443d90a1248040568d87fc7bf7641 | 4,464 | py | Python | tensorflow/python/keras/optimizer_v2/utils.py | luisangel86a/tensorflow | 77ee5e02721ba797fe01d47019e6017d2bb09ab7 | [
"Apache-2.0"
] | 1 | 2020-10-25T00:12:12.000Z | 2020-10-25T00:12:12.000Z | tensorflow/python/keras/optimizer_v2/utils.py | luisangel86a/tensorflow | 77ee5e02721ba797fe01d47019e6017d2bb09ab7 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/keras/optimizer_v2/utils.py | luisangel86a/tensorflow | 77ee5e02721ba797fe01d47019e6017d2bb09ab7 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 35.428571 | 88 | 0.714382 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.distribute import central_storage_strategy
from tensorflow.python.distribute import distribution_strategy_context as distribute_ctx
from tensorflow.python.distribute import... | true | true |
f723c71f72bc88cff1f65f82dbd10987ac1732ba | 9,771 | py | Python | stable_baselines3/common/vec_env/subproc_vec_env.py | qgallouedec/stable-baselines3 | a6f5049a99a4c21a6f0bcce458ca3306cef310e0 | [
"MIT"
] | null | null | null | stable_baselines3/common/vec_env/subproc_vec_env.py | qgallouedec/stable-baselines3 | a6f5049a99a4c21a6f0bcce458ca3306cef310e0 | [
"MIT"
] | null | null | null | stable_baselines3/common/vec_env/subproc_vec_env.py | qgallouedec/stable-baselines3 | a6f5049a99a4c21a6f0bcce458ca3306cef310e0 | [
"MIT"
] | null | null | null | import multiprocessing as mp
from collections import OrderedDict
from typing import Any, Callable, List, Optional, Sequence, Tuple, Type, Union
import gym
import numpy as np
from stable_baselines3.common.vec_env.base_vec_env import (
CloudpickleWrapper,
VecEnv,
VecEnvIndices,
VecEnvObs,
VecEnvStep... | 43.816143 | 118 | 0.635861 | import multiprocessing as mp
from collections import OrderedDict
from typing import Any, Callable, List, Optional, Sequence, Tuple, Type, Union
import gym
import numpy as np
from stable_baselines3.common.vec_env.base_vec_env import (
CloudpickleWrapper,
VecEnv,
VecEnvIndices,
VecEnvObs,
VecEnvStep... | true | true |
f723c763e4fef4f96747ccb5bded293f8e7b9e66 | 1,057 | py | Python | app/main/tools/test_report.py | BorrowHome/flasky-sandbox | 70ef7aa087a0954f7ff4b4845f6599d8481ef0b1 | [
"Apache-2.0"
] | 1 | 2021-03-15T02:59:13.000Z | 2021-03-15T02:59:13.000Z | app/main/tools/test_report.py | BorrowHome/flasky-sandbox | 70ef7aa087a0954f7ff4b4845f6599d8481ef0b1 | [
"Apache-2.0"
] | 6 | 2021-03-19T09:49:44.000Z | 2022-03-12T00:10:14.000Z | app/main/tools/test_report.py | BorrowHome/flasky-sandbox | 70ef7aa087a0954f7ff4b4845f6599d8481ef0b1 | [
"Apache-2.0"
] | 2 | 2020-01-11T13:39:22.000Z | 2020-07-02T03:57:43.000Z | import json
from flask import request, render_template
from app.utils.docx.docx import set_sand_docxtpl
from config import Config
from app.main import main
@main.route('/test_report/', methods=['GET', 'POST'])
def test_report():
if request.method == 'POST':
file_location = Config.SAVE_DOCUMENT_PATH
... | 26.425 | 57 | 0.655629 | import json
from flask import request, render_template
from app.utils.docx.docx import set_sand_docxtpl
from config import Config
from app.main import main
@main.route('/test_report/', methods=['GET', 'POST'])
def test_report():
if request.method == 'POST':
file_location = Config.SAVE_DOCUMENT_PATH
... | true | true |
f723c8a42621a6c77b949415bc7d8ebb1efd5fee | 8,382 | py | Python | rstslide/plugins/Matplotlib/XKCDify.py | rartino/httk-rsttools | 57c46362899105a72b3b6efc45b50bcda8e574a7 | [
"MIT"
] | null | null | null | rstslide/plugins/Matplotlib/XKCDify.py | rartino/httk-rsttools | 57c46362899105a72b3b6efc45b50bcda8e574a7 | [
"MIT"
] | null | null | null | rstslide/plugins/Matplotlib/XKCDify.py | rartino/httk-rsttools | 57c46362899105a72b3b6efc45b50bcda8e574a7 | [
"MIT"
] | null | null | null | """
XKCD plot generator
-------------------
Author: Jake Vanderplas
This is a script that will take any matplotlib line diagram, and convert it
to an XKCD-style plot. It will work for plots with line & text elements,
including axes labels and titles (but not axes tick labels).
The idea for this comes from work by Da... | 31.393258 | 97 | 0.570866 | import os
import numpy as np
import pylab as pl
from scipy import interpolate, signal
import matplotlib.font_manager as fm
script_path = os.path.dirname(os.path.abspath(__file__))
def xkcd_line(x, y, xlim=None, ylim=None,
mag=1.0, f1=30, f2=0.05, f3=15):
x = np.asarray(x)
y = np.asarra... | true | true |
f723c8c94f31ee4136915426bd76d4aad731bdda | 5,323 | py | Python | utils/utils_fit.py | bubbliiiing/yolox-tf2 | 0407c77858d436a6b370e591eea7963cc807f3b4 | [
"Apache-2.0"
] | 49 | 2021-11-01T06:02:21.000Z | 2022-03-29T07:08:22.000Z | utils/utils_fit.py | bubbliiiing/yolox-tf2 | 0407c77858d436a6b370e591eea7963cc807f3b4 | [
"Apache-2.0"
] | 6 | 2021-11-17T08:35:09.000Z | 2022-02-15T12:43:14.000Z | utils/utils_fit.py | bubbliiiing/yolox-tf2 | 0407c77858d436a6b370e591eea7963cc807f3b4 | [
"Apache-2.0"
] | 20 | 2021-11-19T12:03:21.000Z | 2022-03-16T01:45:25.000Z | import os
import tensorflow as tf
from nets.yolo import get_yolo_loss
from tqdm import tqdm
#------------------------------#
# 防止bug
#------------------------------#
def get_train_step_fn(strategy):
@tf.function
def train_step(imgs, targets, net, yolo_loss, optimizer):
with tf.Gradient... | 43.276423 | 144 | 0.520195 | import os
import tensorflow as tf
from nets.yolo import get_yolo_loss
from tqdm import tqdm
ef get_train_step_fn(strategy):
@tf.function
def train_step(imgs, targets, net, yolo_loss, optimizer):
with tf.GradientTape() as tape:
P5_output, P4_ou... | true | true |
f723c9484375a916d20b7a139369a7ec0dc8afb7 | 3,140 | py | Python | warrior/WarriorCore/Classes/war_print_class.py | YutakaMizugaki/warriorframework | 685761cf044182ec88ce86a942d4be1e150a1256 | [
"Apache-2.0"
] | 24 | 2017-06-06T15:48:08.000Z | 2021-03-17T07:52:52.000Z | warrior/WarriorCore/Classes/war_print_class.py | YutakaMizugaki/warriorframework | 685761cf044182ec88ce86a942d4be1e150a1256 | [
"Apache-2.0"
] | 272 | 2017-05-19T20:39:12.000Z | 2021-12-13T19:34:51.000Z | warrior/WarriorCore/Classes/war_print_class.py | pavithra-gowda/warrior | 19b153310552b986b86b5470fcfea9547a74c3a9 | [
"Apache-2.0"
] | 37 | 2017-05-17T21:24:37.000Z | 2021-07-24T18:09:22.000Z | '''
Copyright 2017, Fujitsu Network Communications, 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... | 35.280899 | 80 | 0.670064 |
import sys
import re
def print_main(message, print_type, color_message=None, *args, **kwargs):
if color_message is not None:
print_string = print_type + " " + str(color_message)
elif color_message is None:
print_string = print_type + " " + str(message)
if len(args) > 0:
print_stri... | true | true |
f723c959dc405638e9be66e367589488a0bb7950 | 74,965 | py | Python | doppyo/sugar.py | aaronspring/doppyo | e29e21fbb997f024f39d2e5e67decfc235b0dcca | [
"MIT"
] | null | null | null | doppyo/sugar.py | aaronspring/doppyo | e29e21fbb997f024f39d2e5e67decfc235b0dcca | [
"MIT"
] | null | null | null | doppyo/sugar.py | aaronspring/doppyo | e29e21fbb997f024f39d2e5e67decfc235b0dcca | [
"MIT"
] | null | null | null | """
Collection of old doppyo functions and useful tidbits for internal dcfp use
Authors: Dougie Squire and Thomas Moore
Date created: 01/10/2018
Python Version: 3.6
"""
# ===================================================================================================
# Packages
# ===================... | 48.837134 | 201 | 0.555499 |
import numpy as np
import pandas as pd
import xarray as xr
import cartopy
from collections import Sequence
from itertools import chain, count
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.ticker as mticker
from cartopy.util import add_cyclic_point
from cartopy.mpl.gridliner import LONGITUDE_F... | true | true |
f723c95d5658ceeced474744cccb763f8b5be84d | 2,382 | py | Python | Foundations_of_Private_Computation/Split_Learning/concepts-definitions-code/ite-repo/demos/analytical_values/demo_k_ejt1.py | gonzalo-munillag/Private_AI_OpenMined | c23da9cc1c914d10646a0c0bc1a2497fe2cbaaca | [
"MIT"
] | 5 | 2021-01-06T16:49:22.000Z | 2021-02-19T05:34:27.000Z | Foundations_of_Private_Computation/Split_Learning/concepts-definitions-code/ite-repo/demos/analytical_values/demo_k_ejt1.py | gonzalo-munillag/Private_AI_OpenMined | c23da9cc1c914d10646a0c0bc1a2497fe2cbaaca | [
"MIT"
] | null | null | null | Foundations_of_Private_Computation/Split_Learning/concepts-definitions-code/ite-repo/demos/analytical_values/demo_k_ejt1.py | gonzalo-munillag/Private_AI_OpenMined | c23da9cc1c914d10646a0c0bc1a2497fe2cbaaca | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
""" Demo for exponentiated Jensen-Tsallis kernel-1 estimators.
Analytical vs estimated value is illustrated for spherical normal random
variables.
"""
from numpy import eye
from numpy.random import rand, multivariate_normal, randn
from scipy import arange, zeros, ones
import matplotlib.pyplot... | 33.549296 | 74 | 0.646096 |
from numpy import eye
from numpy.random import rand, multivariate_normal, randn
from scipy import arange, zeros, ones
import matplotlib.pyplot as plt
from ite.cost.x_factory import co_factory
from ite.cost.x_analytical_values import analytical_value_k_ejt1
def main():
dim = 1
num_of_samples_v = ara... | true | true |
f723ca086eef0104ef4640b52705cddbd642cc36 | 2,063 | py | Python | parsifal/reviews/migrations/0046_auto_20190717_2301.py | glauberferreira/parsifal-mec | 66f85e0d48a270bddd1170caa2131bc74872462d | [
"MIT"
] | 1 | 2019-06-13T16:09:26.000Z | 2019-06-13T16:09:26.000Z | parsifal/reviews/migrations/0046_auto_20190717_2301.py | glauberferreira/parsifal-mec | 66f85e0d48a270bddd1170caa2131bc74872462d | [
"MIT"
] | null | null | null | parsifal/reviews/migrations/0046_auto_20190717_2301.py | glauberferreira/parsifal-mec | 66f85e0d48a270bddd1170caa2131bc74872462d | [
"MIT"
] | 3 | 2019-10-05T04:16:59.000Z | 2021-04-20T05:00:50.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('reviews'... | 35.568966 | 164 | 0.596704 |
from __future__ import unicode_literals
from django.db import models, migrations
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('reviews', '0045_articlefile'),
... | true | true |
f723ca1a6623fc6b30625bd969dcb19ab9192111 | 358 | py | Python | Lessons/simpleWebBrowser.py | Luderio/Scientific-Computing-with-Python | c7eebcc3b46b68b3d5c08ad25fb802ae9ff42f7f | [
"MIT"
] | null | null | null | Lessons/simpleWebBrowser.py | Luderio/Scientific-Computing-with-Python | c7eebcc3b46b68b3d5c08ad25fb802ae9ff42f7f | [
"MIT"
] | null | null | null | Lessons/simpleWebBrowser.py | Luderio/Scientific-Computing-with-Python | c7eebcc3b46b68b3d5c08ad25fb802ae9ff42f7f | [
"MIT"
] | null | null | null | #Simple We Browser using sockets
import socket
mysock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
mysock.connect(('data.pr4e.org', 80))
cmd = 'GET http://data.pr4e.org/romeo.txt HTTP/1.0\r\n\r\n'.encode()
mysock.send(cmd)
while True :
data = mysock.recv(512)
if len(data) < 1 :
break
... | 23.866667 | 68 | 0.664804 |
import socket
mysock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
mysock.connect(('data.pr4e.org', 80))
cmd = 'GET http://data.pr4e.org/romeo.txt HTTP/1.0\r\n\r\n'.encode()
mysock.send(cmd)
while True :
data = mysock.recv(512)
if len(data) < 1 :
break
print(data.decode())
mysock.c... | true | true |
f723ca2e7cf32da6dc08be2afefe8b8e7395f254 | 287 | py | Python | app.py | IIVIIIII/2020_Weathering | 0759f2848ca912c8f1f9875f18c8e0aa604948f5 | [
"MIT"
] | null | null | null | app.py | IIVIIIII/2020_Weathering | 0759f2848ca912c8f1f9875f18c8e0aa604948f5 | [
"MIT"
] | null | null | null | app.py | IIVIIIII/2020_Weathering | 0759f2848ca912c8f1f9875f18c8e0aa604948f5 | [
"MIT"
] | null | null | null | from flask import Flask, jsonify
import data4app
app = Flask(__name__)
@app.route("/")
def home():
return "Lets goooo!!!"
@app.route("/<var>")
def jsonified(var):
data = data4app.get_data(var)
return jsonify(data)
if __name__ == "__main__":
app.run(debug=True)
| 15.105263 | 33 | 0.648084 | from flask import Flask, jsonify
import data4app
app = Flask(__name__)
@app.route("/")
def home():
return "Lets goooo!!!"
@app.route("/<var>")
def jsonified(var):
data = data4app.get_data(var)
return jsonify(data)
if __name__ == "__main__":
app.run(debug=True)
| true | true |
f723ca8574f5c324eb54931b511ea756f5d6462f | 18,973 | py | Python | sdk/python/tekton_pipeline/models/pod_template.py | jmcshane/experimental | 3c47c7e87bcdadc6172941169f3f24fc3f159ae0 | [
"Apache-2.0"
] | null | null | null | sdk/python/tekton_pipeline/models/pod_template.py | jmcshane/experimental | 3c47c7e87bcdadc6172941169f3f24fc3f159ae0 | [
"Apache-2.0"
] | null | null | null | sdk/python/tekton_pipeline/models/pod_template.py | jmcshane/experimental | 3c47c7e87bcdadc6172941169f3f24fc3f159ae0 | [
"Apache-2.0"
] | 1 | 2020-07-30T15:55:45.000Z | 2020-07-30T15:55:45.000Z | # Copyright 2020 The Tekton Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | 38.329293 | 485 | 0.669056 |
import pprint
import re
import six
from tekton_pipeline.configuration import Configuration
class PodTemplate(object):
openapi_types = {
'affinity': 'V1Affinity',
'automount_service_account_token': 'bool',
'dns_config': 'V1PodDNSConfig',
'dns_policy': 'str',
... | true | true |
f723cb619eaf3108159317787a8063eb46bfbdab | 413 | py | Python | experiments/fdtd-2d/tmp_files/144.py | LoopTilingBenchmark/benchmark | 52a3d2e70216552a498fd91de02a2fa9cb62122c | [
"BSD-2-Clause"
] | null | null | null | experiments/fdtd-2d/tmp_files/144.py | LoopTilingBenchmark/benchmark | 52a3d2e70216552a498fd91de02a2fa9cb62122c | [
"BSD-2-Clause"
] | null | null | null | experiments/fdtd-2d/tmp_files/144.py | LoopTilingBenchmark/benchmark | 52a3d2e70216552a498fd91de02a2fa9cb62122c | [
"BSD-2-Clause"
] | null | null | null | from chill import *
source('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/polybench/polybench-code/stencils/fdtd-2d/kernel.c')
destination('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/experiments/fdtd-2d/tmp_files/144.c')
procedure('kernel_fdtd_2d')
loop(0)
known(' nx > 1 ')
known(' ny > 1 ')
til... | 22.944444 | 116 | 0.72155 | from chill import *
source('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/polybench/polybench-code/stencils/fdtd-2d/kernel.c')
destination('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/experiments/fdtd-2d/tmp_files/144.c')
procedure('kernel_fdtd_2d')
loop(0)
known(' nx > 1 ')
known(' ny > 1 ')
til... | true | true |
f723cba44ec9074d909b91e8b3bb8d8e84df91e5 | 506 | py | Python | tests/test_base.py | not-nexus/shelf | ea59703082402ad3b6454482f0487418295fbd19 | [
"MIT"
] | 4 | 2016-11-07T13:02:18.000Z | 2019-09-03T02:04:05.000Z | tests/test_base.py | not-nexus/shelf | ea59703082402ad3b6454482f0487418295fbd19 | [
"MIT"
] | 21 | 2016-11-30T20:44:52.000Z | 2017-05-02T15:38:56.000Z | tests/test_base.py | not-nexus/shelf | ea59703082402ad3b6454482f0487418295fbd19 | [
"MIT"
] | 2 | 2017-01-24T14:36:04.000Z | 2020-01-13T16:10:05.000Z | import pyproctor
class TestBase(pyproctor.TestBase):
@classmethod
def setUpClass(cls):
"""
This exists to make sure that no matter what, tests
will log on stdout. Every call to basicConfig after
this point will be a no-op
"""
# AGI-731
# See... | 25.3 | 64 | 0.561265 | import pyproctor
class TestBase(pyproctor.TestBase):
@classmethod
def setUpClass(cls):
| true | true |
f723cc233a58a2785fb04f6b38b7dd40a29e256b | 97 | py | Python | tests/test_import.py | Quiltomics/indexd | 95274d40f16de881492c2db70a969eb77c8f5e7c | [
"Apache-2.0"
] | 2 | 2019-06-10T15:30:51.000Z | 2020-01-18T23:24:13.000Z | tests/test_import.py | lookcrabs/indexd | 646a7f336148496b07462ce3d3f8e930fa08a06c | [
"Apache-2.0"
] | 15 | 2019-03-19T21:57:31.000Z | 2021-08-11T21:01:33.000Z | tests/test_import.py | NCI-GDC/indexd | d159a82e7da100c807621bc41f2626dae64b4be9 | [
"Apache-2.0"
] | 1 | 2020-11-05T15:03:24.000Z | 2020-11-05T15:03:24.000Z | def test_import_index():
'''
Try to import the indexd package.
'''
import indexd
| 16.166667 | 37 | 0.608247 | def test_import_index():
import indexd
| true | true |
f723ccb1d235fd916b20e25c9c162899696706eb | 4,292 | py | Python | tests/python/contrib/test_gemm_acc32_vnni.py | jiangzoi/incubator-tvm | 144c6f45f7217b9df2f5605e06f0903e470ac11c | [
"Apache-2.0"
] | 9 | 2019-12-17T08:03:54.000Z | 2022-01-19T02:34:23.000Z | tests/python/contrib/test_gemm_acc32_vnni.py | jiangzoi/incubator-tvm | 144c6f45f7217b9df2f5605e06f0903e470ac11c | [
"Apache-2.0"
] | 2 | 2020-06-18T21:15:42.000Z | 2020-06-24T17:38:37.000Z | tests/python/contrib/test_gemm_acc32_vnni.py | jiangzoi/incubator-tvm | 144c6f45f7217b9df2f5605e06f0903e470ac11c | [
"Apache-2.0"
] | 3 | 2020-10-04T20:30:18.000Z | 2022-01-24T18:03:52.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 40.11215 | 107 | 0.627213 |
import tvm
from tvm import te
import numpy as np
from topi.x86.tensor_intrin import dot_16x1x16_uint8_int8_int32_cascadelake
from topi.x86.tensor_intrin import dot_16x1x16_uint8_int8_int32
import pytest
@pytest.mark.skip("skip because feature not enabled")
def test_fc_int8_acc32():
m = 1024
... | true | true |
f723ccc97ea70d87a17b104645eede99a1853ac3 | 2,675 | py | Python | wings/api_client.py | KnowledgeCaptureAndDiscovery/wings-client | af1d068f4adc07d9060afa94dc99e0b2565be088 | [
"Apache-2.0"
] | null | null | null | wings/api_client.py | KnowledgeCaptureAndDiscovery/wings-client | af1d068f4adc07d9060afa94dc99e0b2565be088 | [
"Apache-2.0"
] | 8 | 2019-07-28T17:04:38.000Z | 2019-08-06T23:57:08.000Z | wings/api_client.py | KnowledgeCaptureAndDiscovery/wings-client | af1d068f4adc07d9060afa94dc99e0b2565be088 | [
"Apache-2.0"
] | 1 | 2019-07-29T22:53:41.000Z | 2019-07-29T22:53:41.000Z | import atexit
import importlib
import logging
import requests
class ApiClient:
def __init__(self, **kwargs):
self.kwargs = kwargs
self.session = requests.Session()
self.libns = self.get_export_url() + "components/library.owl#"
self.dcdom = self.get_export_url() + "data/ontology.ow... | 31.104651 | 88 | 0.603738 | import atexit
import importlib
import logging
import requests
class ApiClient:
def __init__(self, **kwargs):
self.kwargs = kwargs
self.session = requests.Session()
self.libns = self.get_export_url() + "components/library.owl#"
self.dcdom = self.get_export_url() + "data/ontology.ow... | true | true |
f723ce701eeae1b756748f8b4615052fa8ad1b50 | 4,318 | py | Python | ramp-database/ramp_database/tests/test_testing.py | agramfort/ramp-board | 1c2cfe7af486e57ee0d4fb017b5266bb8ad152e3 | [
"BSD-3-Clause"
] | null | null | null | ramp-database/ramp_database/tests/test_testing.py | agramfort/ramp-board | 1c2cfe7af486e57ee0d4fb017b5266bb8ad152e3 | [
"BSD-3-Clause"
] | null | null | null | ramp-database/ramp_database/tests/test_testing.py | agramfort/ramp-board | 1c2cfe7af486e57ee0d4fb017b5266bb8ad152e3 | [
"BSD-3-Clause"
] | null | null | null | import os
import shutil
import pytest
from ramp_utils import read_config
from ramp_utils import generate_ramp_config
from ramp_utils.testing import database_config_template
from ramp_utils.testing import ramp_config_template
from ramp_database.utils import setup_db
from ramp_database.utils import session_scope
fro... | 34.822581 | 76 | 0.789717 | import os
import shutil
import pytest
from ramp_utils import read_config
from ramp_utils import generate_ramp_config
from ramp_utils.testing import database_config_template
from ramp_utils.testing import ramp_config_template
from ramp_database.utils import setup_db
from ramp_database.utils import session_scope
fro... | true | true |
f723cf6dae464950f3d8b77edb889dcb5492b6ce | 4,453 | py | Python | python/ingestor/business.py | agahchen/RSBC-DataHub-API | d3742a09851d5753809e8eb8e1f7f6ca10b121ad | [
"Apache-2.0"
] | null | null | null | python/ingestor/business.py | agahchen/RSBC-DataHub-API | d3742a09851d5753809e8eb8e1f7f6ca10b121ad | [
"Apache-2.0"
] | null | null | null | python/ingestor/business.py | agahchen/RSBC-DataHub-API | d3742a09851d5753809e8eb8e1f7f6ca10b121ad | [
"Apache-2.0"
] | null | null | null | import python.common.middleware as middleware
import python.common.actions as actions
import python.common.rsi_email as rsi_email
import python.common.rest as rest
def get_available_time_slots() -> list:
"""
An application is ready for scheduling when all the payment rules are satisfied plus:
- the ap... | 46.385417 | 89 | 0.614193 | import python.common.middleware as middleware
import python.common.actions as actions
import python.common.rsi_email as rsi_email
import python.common.rest as rest
def get_available_time_slots() -> list:
return [
{"try": middleware.create_correlation_id, "fail": []},
{"try": middleware.determine_c... | true | true |
f723cf8e92377defaba93082120d82ab6f27e07b | 343 | py | Python | tests/test_models.py | devopsmakers/dj-prosftpd | fcef6b4a5b8b872c9830eaf0315f0467dd1944ff | [
"MIT"
] | null | null | null | tests/test_models.py | devopsmakers/dj-prosftpd | fcef6b4a5b8b872c9830eaf0315f0467dd1944ff | [
"MIT"
] | null | null | null | tests/test_models.py | devopsmakers/dj-prosftpd | fcef6b4a5b8b872c9830eaf0315f0467dd1944ff | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_dj-prosftpd
------------
Tests for `dj-prosftpd` models module.
"""
from django.test import TestCase
from dj_prosftpd import models
class TestDj_prosftpd(TestCase):
def setUp(self):
pass
def test_something(self):
pass
def tearDo... | 13.192308 | 38 | 0.620991 |
from django.test import TestCase
from dj_prosftpd import models
class TestDj_prosftpd(TestCase):
def setUp(self):
pass
def test_something(self):
pass
def tearDown(self):
pass
| true | true |
f723cfc4543d31b1df927182b8dd2e714298c92e | 14,427 | py | Python | fermi_blind_search/database.py | giacomov/fermi_blind_search | f8d52cb8b61519223918d197682b4f70c78cce10 | [
"BSD-3-Clause"
] | null | null | null | fermi_blind_search/database.py | giacomov/fermi_blind_search | f8d52cb8b61519223918d197682b4f70c78cce10 | [
"BSD-3-Clause"
] | null | null | null | fermi_blind_search/database.py | giacomov/fermi_blind_search | f8d52cb8b61519223918d197682b4f70c78cce10 | [
"BSD-3-Clause"
] | 1 | 2017-04-01T10:42:07.000Z | 2017-04-01T10:42:07.000Z | #!/usr/bin/env python
from contextlib import contextmanager
import argparse
import sys
import sshtunnel
from sqlalchemy import *
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
from fermi_blind_search.configuration import get_config
from fermi_blind_search import myLoggi... | 37.27907 | 121 | 0.582311 |
from contextlib import contextmanager
import argparse
import sys
import sshtunnel
from sqlalchemy import *
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
from fermi_blind_search.configuration import get_config
from fermi_blind_search import myLogging
_logger = myLoggi... | true | true |
f723cfd084712344629373ab39822ddba59ccffa | 2,538 | py | Python | irrigator_pro/farms/migrations/0012_copy_field_list_to_field_for_waterhistory_and_probe.py | warnes/irrigatorpro | 4838f8832bdbf87f394a0298adc5dabfc26e82e8 | [
"MIT"
] | null | null | null | irrigator_pro/farms/migrations/0012_copy_field_list_to_field_for_waterhistory_and_probe.py | warnes/irrigatorpro | 4838f8832bdbf87f394a0298adc5dabfc26e82e8 | [
"MIT"
] | null | null | null | irrigator_pro/farms/migrations/0012_copy_field_list_to_field_for_waterhistory_and_probe.py | warnes/irrigatorpro | 4838f8832bdbf87f394a0298adc5dabfc26e82e8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
import sys
from django.db import connection
def convert_probe_field_list_to_field(apps, schema_editor):
"""
For each current Probe, copy field_list[0] into field, and create
n... | 29.511628 | 84 | 0.670607 |
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
import sys
from django.db import connection
def convert_probe_field_list_to_field(apps, schema_editor):
Probe = apps.get_model("farms", "Probe")
cursor = connection.cursor()
cursor.execute("select ... | true | true |
f723d086e096878de8624880928432132d608eb2 | 7,000 | py | Python | rllib/agents/marwil/tests/test_marwil.py | kifarid/ray | 43c97c2afb979987be82fa50048674e9b6776d5d | [
"Apache-2.0"
] | 3 | 2021-08-29T20:41:21.000Z | 2022-01-31T18:47:51.000Z | rllib/agents/marwil/tests/test_marwil.py | kifarid/ray | 43c97c2afb979987be82fa50048674e9b6776d5d | [
"Apache-2.0"
] | 61 | 2021-06-05T07:05:08.000Z | 2022-03-19T07:14:56.000Z | rllib/agents/marwil/tests/test_marwil.py | kifarid/ray | 43c97c2afb979987be82fa50048674e9b6776d5d | [
"Apache-2.0"
] | null | null | null | import numpy as np
import os
from pathlib import Path
import unittest
import ray
import ray.rllib.agents.marwil as marwil
from ray.rllib.evaluation.postprocessing import compute_advantages
from ray.rllib.offline import JsonReader
from ray.rllib.utils.framework import try_import_tf, try_import_torch
from ray.rllib.util... | 41.666667 | 79 | 0.576857 | import numpy as np
import os
from pathlib import Path
import unittest
import ray
import ray.rllib.agents.marwil as marwil
from ray.rllib.evaluation.postprocessing import compute_advantages
from ray.rllib.offline import JsonReader
from ray.rllib.utils.framework import try_import_tf, try_import_torch
from ray.rllib.util... | true | true |
f723d0fdbd1846134fc03f67f0123e5aedd5f7e6 | 1,938 | py | Python | config.py | LucaMalavolta/q2 | d4cd62c3ea898c99334ea84e2b41ec75db9558f7 | [
"BSD-2-Clause"
] | null | null | null | config.py | LucaMalavolta/q2 | d4cd62c3ea898c99334ea84e2b41ec75db9558f7 | [
"BSD-2-Clause"
] | null | null | null | config.py | LucaMalavolta/q2 | d4cd62c3ea898c99334ea84e2b41ec75db9558f7 | [
"BSD-2-Clause"
] | null | null | null | import os
import logging
import matplotlib.pyplot as plt
logger = logging.getLogger(__name__)
path = os.path.dirname(os.path.realpath(__file__))
path = os.path.join(path, 'Data')
COLORTEFF_PATH = os.path.join(path, 'ColorTeff')
MODATM_PATH = os.path.join(path, 'ModelAtmospheres')
ISOCHRONES_PATH = ... | 36.566038 | 78 | 0.663055 | import os
import logging
import matplotlib.pyplot as plt
logger = logging.getLogger(__name__)
path = os.path.dirname(os.path.realpath(__file__))
path = os.path.join(path, 'Data')
COLORTEFF_PATH = os.path.join(path, 'ColorTeff')
MODATM_PATH = os.path.join(path, 'ModelAtmospheres')
ISOCHRONES_PATH = ... | true | true |
f723d13c5a9085305d4224504015e2a6d6c0eef1 | 1,341 | py | Python | concepts/recursion/fibonacci_sesies.py | dnootana/Python | 2881bafe8bc378fa3cae50a747fcea1a55630c63 | [
"MIT"
] | 1 | 2021-02-19T11:00:11.000Z | 2021-02-19T11:00:11.000Z | concepts/recursion/fibonacci_sesies.py | dnootana/Python | 2881bafe8bc378fa3cae50a747fcea1a55630c63 | [
"MIT"
] | null | null | null | concepts/recursion/fibonacci_sesies.py | dnootana/Python | 2881bafe8bc378fa3cae50a747fcea1a55630c63 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3.8
"""
given a number N generate N no of fibonacci numbers
"""
from memoize import memoize
number = 25
fib_list = [None] * (number)
def fibonacci(num):
"""
fibonacci series using iteration
"""
a, b = 0, 1
for i in range(num-1):
fib_list[i], fib_list[i+1] = a, b
a, b = b, a+b
return a... | 19.434783 | 71 | 0.671141 |
from memoize import memoize
number = 25
fib_list = [None] * (number)
def fibonacci(num):
a, b = 0, 1
for i in range(num-1):
fib_list[i], fib_list[i+1] = a, b
a, b = b, a+b
return a
fibonacci(number)
print("fibonacci series using iteration : ", fib_list)
fib_list = [None] * (number)
def fibonacci_a(num):
... | true | true |
f723d38041e06dcc3fe6b444f4b546e4e28b9d49 | 754 | py | Python | pydatastructs/linear_data_structures/__init__.py | hpnightowl/pydatastructs | ec69ef887fee200390bff41ab6859a4ab0b26fbf | [
"BSD-3-Clause"
] | null | null | null | pydatastructs/linear_data_structures/__init__.py | hpnightowl/pydatastructs | ec69ef887fee200390bff41ab6859a4ab0b26fbf | [
"BSD-3-Clause"
] | null | null | null | pydatastructs/linear_data_structures/__init__.py | hpnightowl/pydatastructs | ec69ef887fee200390bff41ab6859a4ab0b26fbf | [
"BSD-3-Clause"
] | 1 | 2021-02-05T04:49:55.000Z | 2021-02-05T04:49:55.000Z | __all__ = []
from pydatastructs.linear_data_structures import arrays, linked_lists, algorithms
from pydatastructs.linear_data_structures.arrays import OneDimensionalArray, DynamicOneDimensionalArray, \
MultiDimensionalArray
from pydatastructs.linear_data_structures.algorithms import merge_sort_parallel, brick_so... | 37.7 | 115 | 0.855438 | __all__ = []
from pydatastructs.linear_data_structures import arrays, linked_lists, algorithms
from pydatastructs.linear_data_structures.arrays import OneDimensionalArray, DynamicOneDimensionalArray, \
MultiDimensionalArray
from pydatastructs.linear_data_structures.algorithms import merge_sort_parallel, brick_so... | true | true |
f723d3bddf9b5128923113de82df064942d27440 | 391 | py | Python | Epitome/wsgi.py | pbout/ept | 7da64e606c9c163ffc8285cd8c77288807f4f477 | [
"RSA-MD"
] | null | null | null | Epitome/wsgi.py | pbout/ept | 7da64e606c9c163ffc8285cd8c77288807f4f477 | [
"RSA-MD"
] | null | null | null | Epitome/wsgi.py | pbout/ept | 7da64e606c9c163ffc8285cd8c77288807f4f477 | [
"RSA-MD"
] | null | null | null | """
WSGI config for Epitome project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTI... | 23 | 78 | 0.785166 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Epitome.settings")
application = get_wsgi_application()
| true | true |
f723d4daf4d337355a5c29418d6ad94c37865a78 | 3,109 | py | Python | meiduotest/meiduotest/settings.py | littrell0/meiduo_project_test | 3d2f6a6e528e6c45a5ffc1db0ddc5de9b4e52bf8 | [
"MIT"
] | null | null | null | meiduotest/meiduotest/settings.py | littrell0/meiduo_project_test | 3d2f6a6e528e6c45a5ffc1db0ddc5de9b4e52bf8 | [
"MIT"
] | null | null | null | meiduotest/meiduotest/settings.py | littrell0/meiduo_project_test | 3d2f6a6e528e6c45a5ffc1db0ddc5de9b4e52bf8 | [
"MIT"
] | null | null | null | """
Django settings for meiduotest project.
Generated by 'django-admin startproject' using Django 1.11.11.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
impor... | 25.694215 | 91 | 0.69733 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '8zj*1u%iy2m+d0hg$@#5d(nrr5_-2u))cqkf^_3wj&f3ayr)o='
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.content... | true | true |
f723d5a84455b1eb99d7bfc740ea30ad3707a3a0 | 4,334 | py | Python | mmdet/models/seg_heads/panoptic_fpn_head.py | SeHwanJoo/mmdetection_body | 1e1cadc6df91926fc99c4afbae383df0ea9cfed3 | [
"Apache-2.0"
] | 7 | 2021-08-08T08:34:30.000Z | 2022-01-10T18:37:47.000Z | mmdet/models/seg_heads/panoptic_fpn_head.py | SeHwanJoo/mmdetection_body | 1e1cadc6df91926fc99c4afbae383df0ea9cfed3 | [
"Apache-2.0"
] | null | null | null | mmdet/models/seg_heads/panoptic_fpn_head.py | SeHwanJoo/mmdetection_body | 1e1cadc6df91926fc99c4afbae383df0ea9cfed3 | [
"Apache-2.0"
] | 2 | 2021-08-11T05:57:50.000Z | 2022-01-04T11:13:32.000Z | import torch
import torch.nn as nn
from mmcv.runner import ModuleList
from ..builder import HEADS
from ..utils import ConvUpsample
from .base_semantic_head import BaseSemanticHead
@HEADS.register_module()
class PanopticFPNHead(BaseSemanticHead):
"""PanopticFPNHead used in Panoptic FPN.
Arg:
num_clas... | 38.696429 | 78 | 0.601292 | import torch
import torch.nn as nn
from mmcv.runner import ModuleList
from ..builder import HEADS
from ..utils import ConvUpsample
from .base_semantic_head import BaseSemanticHead
@HEADS.register_module()
class PanopticFPNHead(BaseSemanticHead):
def __init__(self,
num_classes,
... | true | true |
f723d8eb5daadf4e81d3c79aabb857dd8a2823c2 | 276 | py | Python | dashboard/apps.py | lynetteoh/COVID19dashboard | 61193d35acf004999443c47a30f0b9f9c6220c03 | [
"MIT"
] | null | null | null | dashboard/apps.py | lynetteoh/COVID19dashboard | 61193d35acf004999443c47a30f0b9f9c6220c03 | [
"MIT"
] | null | null | null | dashboard/apps.py | lynetteoh/COVID19dashboard | 61193d35acf004999443c47a30f0b9f9c6220c03 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
import pandas as pd
import sys
class DashboardConfig(AppConfig):
name = 'dashboard'
def ready(self):
if 'runserver' not in sys.argv:
return True
from dashboard.models import Case, State, Country
| 21.230769 | 57 | 0.65942 | from django.apps import AppConfig
import pandas as pd
import sys
class DashboardConfig(AppConfig):
name = 'dashboard'
def ready(self):
if 'runserver' not in sys.argv:
return True
from dashboard.models import Case, State, Country
| true | true |
f723d9b3d877c48369368b51d3310d0d2b722ba2 | 372 | py | Python | exercicios-turtle/.history/flower_20210624115429.py | Aleff13/poo-ufsc | bc1574df26f840a3c0fd5b1e0c72e5d69f61493d | [
"MIT"
] | 1 | 2021-11-28T18:49:21.000Z | 2021-11-28T18:49:21.000Z | exercicios-turtle/.history/flower_20210624115429.py | Aleff13/poo-ufsc | bc1574df26f840a3c0fd5b1e0c72e5d69f61493d | [
"MIT"
] | null | null | null | exercicios-turtle/.history/flower_20210624115429.py | Aleff13/poo-ufsc | bc1574df26f840a3c0fd5b1e0c72e5d69f61493d | [
"MIT"
] | null | null | null | import turtle
tortuguita = turtle.Turtle()
tortuguita.color('blue')
tortuguita.speed(100)
for i in range (18):
tortuguita.circle(200,100)
tortuguita.left(110)
tortuguita.up()
tortuguita.left(35)
tortuguita.forward(160)
tortuguita.down()
tortuguita.dot(70,"black")
tortuguita.left(35)
tortuguita.up()
tortugui... | 17.714286 | 30 | 0.752688 | import turtle
tortuguita = turtle.Turtle()
tortuguita.color('blue')
tortuguita.speed(100)
for i in range (18):
tortuguita.circle(200,100)
tortuguita.left(110)
tortuguita.up()
tortuguita.left(35)
tortuguita.forward(160)
tortuguita.down()
tortuguita.dot(70,"black")
tortuguita.left(35)
tortuguita.up()
tortugui... | true | true |
f723d9cabe29840070a01c4f2c8c2878b8b99f27 | 5,505 | py | Python | ccc/elasticsearch.py | mliepold/cc-utils | 3f8c4b0d11d6a52d1605026f478371411daab81e | [
"BSD-3-Clause"
] | 15 | 2018-04-18T13:25:30.000Z | 2022-03-04T09:25:41.000Z | ccc/elasticsearch.py | mliepold/cc-utils | 3f8c4b0d11d6a52d1605026f478371411daab81e | [
"BSD-3-Clause"
] | 221 | 2018-04-12T06:29:43.000Z | 2022-03-27T03:01:40.000Z | ccc/elasticsearch.py | mliepold/cc-utils | 3f8c4b0d11d6a52d1605026f478371411daab81e | [
"BSD-3-Clause"
] | 29 | 2018-04-11T14:42:23.000Z | 2021-11-09T16:26:32.000Z | # Copyright (c) 2019-2020 SAP SE or an SAP affiliate company. All rights reserved. This file is
# licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the L... | 29.438503 | 97 | 0.622525 |
import datetime
import functools
import os
import json
import elasticsearch
import ci.util
import concourse.util
import model.elasticsearch
def default_client_if_available():
if not ci.util._running_on_ci():
return None
cfg_factory = ci.util.ctx().cfg_factory()
cfg_set = cfg_fact... | true | true |
f723da3d31fc0d1c210b41c7779cc8ee4f4cd08c | 6,876 | py | Python | src/wallet/wallet_block_store.py | DONG-Jason/chia-blockchain | 27b28d62f6b315e45bc00231e007c775f07a414a | [
"Apache-2.0"
] | null | null | null | src/wallet/wallet_block_store.py | DONG-Jason/chia-blockchain | 27b28d62f6b315e45bc00231e007c775f07a414a | [
"Apache-2.0"
] | null | null | null | src/wallet/wallet_block_store.py | DONG-Jason/chia-blockchain | 27b28d62f6b315e45bc00231e007c775f07a414a | [
"Apache-2.0"
] | null | null | null | from typing import Dict, Optional, Tuple, List
import aiosqlite
from src.consensus.sub_block_record import SubBlockRecord
from src.types.header_block import HeaderBlock
from src.util.ints import uint32, uint64
from src.wallet.block_record import HeaderBlockRecord
from src.types.sized_bytes import bytes32
class Walle... | 39.745665 | 112 | 0.627981 | from typing import Dict, Optional, Tuple, List
import aiosqlite
from src.consensus.sub_block_record import SubBlockRecord
from src.types.header_block import HeaderBlock
from src.util.ints import uint32, uint64
from src.wallet.block_record import HeaderBlockRecord
from src.types.sized_bytes import bytes32
class Walle... | true | true |
f723db4534fac7bbdbc1fca243f9cc9d68e9c713 | 56,361 | py | Python | plugins/modules/oci_loadbalancer_backend_set.py | LaudateCorpus1/oci-ansible-collection | 2b1cd87b4d652a97c1ca752cfc4fdc4bdb37a7e7 | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_loadbalancer_backend_set.py | LaudateCorpus1/oci-ansible-collection | 2b1cd87b4d652a97c1ca752cfc4fdc4bdb37a7e7 | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_loadbalancer_backend_set.py | LaudateCorpus1/oci-ansible-collection | 2b1cd87b4d652a97c1ca752cfc4fdc4bdb37a7e7 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Copyright (c) 2020, 2022 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... | 49.657269 | 149 | 0.558134 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
"metadata_version": "1.1",
"status": ["preview"],
"supported_by": "community",
}
DOCUMENTATION = """
---
module: oci_loadbalancer_backend_set
short_description: Manage a BackendSet resource... | true | true |
f723dcbf78bff84e6aa9186e1ba18550f5791807 | 4,002 | py | Python | CodingEasy/settings.py | Atif0604/CodingEasy | 75d7e88dd7ab514ee4fdaa4b1b80175d78c5a91c | [
"MIT"
] | 40 | 2021-12-22T15:16:03.000Z | 2022-03-26T08:24:04.000Z | CodingEasy/settings.py | Atif0604/CodingEasy | 75d7e88dd7ab514ee4fdaa4b1b80175d78c5a91c | [
"MIT"
] | 222 | 2021-12-14T05:37:10.000Z | 2022-03-31T16:38:59.000Z | CodingEasy/settings.py | Atif0604/CodingEasy | 75d7e88dd7ab514ee4fdaa4b1b80175d78c5a91c | [
"MIT"
] | 89 | 2021-12-14T05:00:23.000Z | 2022-03-29T10:55:25.000Z | """
Django settings for CodingEasy project.
Generated by 'django-admin startproject' using Django 4.0.1.
For more information on this file, see
https://docs.djangoproject.com/en/4.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/4.0/ref/settings/
"""
from path... | 26.156863 | 91 | 0.703648 |
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = 'django-insecure-x_1=q*b(j*34f(dg0^2sa)-f$k^!0d(qa=@geze9s@8)-(!hy5'
DEBUG = True
ALLOWED_HOSTS = ["*"]
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.co... | true | true |
f723def610c1a3cf3e0216947eb0d00eb4392e68 | 9,125 | py | Python | tf_object_detection/to_tfrecords.py | AndresGarciaEscalante/bstld | cc37fb3388b7731be9e76fd1c4e2be13b6716afe | [
"MIT"
] | null | null | null | tf_object_detection/to_tfrecords.py | AndresGarciaEscalante/bstld | cc37fb3388b7731be9e76fd1c4e2be13b6716afe | [
"MIT"
] | null | null | null | tf_object_detection/to_tfrecords.py | AndresGarciaEscalante/bstld | cc37fb3388b7731be9e76fd1c4e2be13b6716afe | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
Creates full-image tfrecords to use the Bosch Small Traffic Lights Dataset
with the Tensorflow Object Detection API.
The training set is split into training and validation. Tfrecords are created
for a training, validation, and test set. Labels are grouped by their respective
colors to simpli... | 43.452381 | 98 | 0.699288 |
import argparse
from collections import OrderedDict, defaultdict
import hashlib
import os
from random import shuffle
import cv2
import tensorflow as tf
import tqdm
from object_detection.utils import dataset_util
import sys
current = os.path.dirname(os.path.realpath(__file__))
parent = os.path.dirname(cu... | true | true |
f723e0a0bf9e03267963a7c69b5889fe7fcdda12 | 2,069 | py | Python | scripts/generate_delta_sysroot_unittest.py | hustwei/chromite | 10eb79abeb64e859362546214b7e039096ac9830 | [
"BSD-3-Clause"
] | null | null | null | scripts/generate_delta_sysroot_unittest.py | hustwei/chromite | 10eb79abeb64e859362546214b7e039096ac9830 | [
"BSD-3-Clause"
] | null | null | null | scripts/generate_delta_sysroot_unittest.py | hustwei/chromite | 10eb79abeb64e859362546214b7e039096ac9830 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unittests for generate_delta_sysroot."""
from __future__ import print_function
import os
from chromite.lib import cros_build_lib
from chromite.l... | 29.985507 | 73 | 0.697438 |
from __future__ import print_function
import os
from chromite.lib import cros_build_lib
from chromite.lib import cros_test_lib
from chromite.scripts import generate_delta_sysroot as gds
def _Parse(argv):
return gds._ParseCommandLine(argv)
class InterfaceTest(cros_test_lib.OutputTestCase,
... | true | true |
f723e168770bfc02d7b2018b83bc4abe150a4e30 | 678 | py | Python | ex9_1_applications_agumentation.py | soyoung9306/-3-keras | e65f40171aadef3fe0b59c649b55b3f0bd09ca41 | [
"MIT"
] | 200 | 2017-10-23T05:05:34.000Z | 2022-01-25T00:58:45.000Z | ex9_1_applications_agumentation.py | MyeongHaHwang/keraspp | 4090fcc86072cda816d1d6056b5113ace49534ae | [
"MIT"
] | 8 | 2018-02-07T08:33:49.000Z | 2020-09-11T20:59:30.000Z | ex9_1_applications_agumentation.py | MyeongHaHwang/keraspp | 4090fcc86072cda816d1d6056b5113ace49534ae | [
"MIT"
] | 135 | 2017-12-15T05:41:47.000Z | 2021-12-15T12:21:09.000Z | """
CH 9.1 Applications/Image Augmentation
"""
from sklearn import model_selection
from keras import datasets
import keras
assert keras.backend.image_data_format() == 'channels_last'
from keraspp import aigen
class Machine(aigen.Machine_Generator):
def __init__(self):
(x_train, y_train), (x_test, y_test)... | 23.37931 | 87 | 0.690265 | from sklearn import model_selection
from keras import datasets
import keras
assert keras.backend.image_data_format() == 'channels_last'
from keraspp import aigen
class Machine(aigen.Machine_Generator):
def __init__(self):
(x_train, y_train), (x_test, y_test) = datasets.cifar10.load_data()
_, X, _... | true | true |
f723e1dd1990acf6f94ec2386a12f7b48ddc2589 | 274 | py | Python | core/index_db/index_object.py | AliRezaBeigy/Gitools | b7defd332bb144cb45962a351b1f56e941c8ca4b | [
"MIT"
] | 6 | 2021-01-06T05:18:06.000Z | 2022-03-17T06:44:29.000Z | core/index_db/index_object.py | AliRezaBeigy/Gitools | b7defd332bb144cb45962a351b1f56e941c8ca4b | [
"MIT"
] | null | null | null | core/index_db/index_object.py | AliRezaBeigy/Gitools | b7defd332bb144cb45962a351b1f56e941c8ca4b | [
"MIT"
] | 1 | 2021-04-15T20:51:26.000Z | 2021-04-15T20:51:26.000Z | class IndexObject:
hash: str
crc32: int
pack_end_offset: int
pack_start_offset: int
def __init__(self, hash: str, crc32: int, pack_start_offset: int):
self.hash = hash
self.crc32 = crc32
self.pack_start_offset = pack_start_offset | 27.4 | 70 | 0.667883 | class IndexObject:
hash: str
crc32: int
pack_end_offset: int
pack_start_offset: int
def __init__(self, hash: str, crc32: int, pack_start_offset: int):
self.hash = hash
self.crc32 = crc32
self.pack_start_offset = pack_start_offset | true | true |
f723e22ccbf007fd40e2124e7515473ede314c02 | 1,440 | py | Python | setup.py | dharif23/xtermcolors | fb35b9b7a04fbf7a0ea236bb94275240c6322b1a | [
"MIT"
] | null | null | null | setup.py | dharif23/xtermcolors | fb35b9b7a04fbf7a0ea236bb94275240c6322b1a | [
"MIT"
] | null | null | null | setup.py | dharif23/xtermcolors | fb35b9b7a04fbf7a0ea236bb94275240c6322b1a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Dalwar Hossain'
__email__ = 'dalwar.hossain@protonmail.com'
from setuptools import setup
def readme():
with open('README.md') as f:
return f.read()
setup(name='pyrainbowterm',
version='1.0',
description='pyrainbowterm - Smart cu... | 32.727273 | 103 | 0.603472 |
__author__ = 'Dalwar Hossain'
__email__ = 'dalwar.hossain@protonmail.com'
from setuptools import setup
def readme():
with open('README.md') as f:
return f.read()
setup(name='pyrainbowterm',
version='1.0',
description='pyrainbowterm - Smart custom print function with color and log infor... | true | true |
f723e3633555478d9d24ed98d7498972bfe2deda | 13,424 | py | Python | pyabsa/core/tc/prediction/text_classifier.py | yangheng95/PyABSA | f5b46047a58fa8054a0469486be3f1cada933814 | [
"MIT"
] | 199 | 2021-06-07T15:07:28.000Z | 2022-03-31T11:53:28.000Z | pyabsa/core/tc/prediction/text_classifier.py | yangheng95/PyABSA | f5b46047a58fa8054a0469486be3f1cada933814 | [
"MIT"
] | 98 | 2021-06-06T06:01:02.000Z | 2022-03-31T15:48:28.000Z | pyabsa/core/tc/prediction/text_classifier.py | yangheng95/PyABSA | f5b46047a58fa8054a0469486be3f1cada933814 | [
"MIT"
] | 55 | 2021-06-10T08:52:17.000Z | 2022-03-31T11:08:58.000Z | # -*- coding: utf-8 -*-
# file: text_classifier.py
# author: yangheng <yangheng@m.scnu.edu.cn>
# Copyright (C) 2020. All Rights Reserved.
import json
import os
import pickle
import random
import numpy
import torch
from findfile import find_file
from termcolor import colored
from torch.utils.data import DataLoader
from... | 45.505085 | 163 | 0.560489 |
import json
import os
import pickle
import random
import numpy
import torch
from findfile import find_file
from termcolor import colored
from torch.utils.data import DataLoader
from transformers import AutoTokenizer, AutoModel
from pyabsa.functional.dataset import detect_infer_dataset
from ..models import GloVeC... | true | true |
f723e39e9c8312aae14d30f2933e41983a1269e0 | 16,210 | py | Python | syfertext/language.py | AlexKer/SyferText | 021eea2255d9d8e1fc49c98c7b5f98b9e516ba21 | [
"Apache-2.0"
] | null | null | null | syfertext/language.py | AlexKer/SyferText | 021eea2255d9d8e1fc49c98c7b5f98b9e516ba21 | [
"Apache-2.0"
] | null | null | null | syfertext/language.py | AlexKer/SyferText | 021eea2255d9d8e1fc49c98c7b5f98b9e516ba21 | [
"Apache-2.0"
] | null | null | null | from .tokenizer import Tokenizer
from .vocab import Vocab
from .doc import Doc
from .pointers.doc_pointer import DocPointer
from .pipeline import SubPipeline
from syft.generic.object import AbstractObject
from syft.workers.base import BaseWorker
from syft.generic.string import String
from syft.generic.pointers.string_... | 39.440389 | 117 | 0.613017 | from .tokenizer import Tokenizer
from .vocab import Vocab
from .doc import Doc
from .pointers.doc_pointer import DocPointer
from .pipeline import SubPipeline
from syft.generic.object import AbstractObject
from syft.workers.base import BaseWorker
from syft.generic.string import String
from syft.generic.pointers.string_... | true | true |
f723e3b85ffbd830c43dccf93a9dd2bd55bc2e30 | 31,635 | py | Python | sdk/python/pulumi_google_native/apigee/v1/rate_plan.py | AaronFriel/pulumi-google-native | 75d1cda425e33d4610348972cd70bddf35f1770d | [
"Apache-2.0"
] | 44 | 2021-04-18T23:00:48.000Z | 2022-02-14T17:43:15.000Z | sdk/python/pulumi_google_native/apigee/v1/rate_plan.py | AaronFriel/pulumi-google-native | 75d1cda425e33d4610348972cd70bddf35f1770d | [
"Apache-2.0"
] | 354 | 2021-04-16T16:48:39.000Z | 2022-03-31T17:16:39.000Z | sdk/python/pulumi_google_native/apigee/v1/rate_plan.py | AaronFriel/pulumi-google-native | 75d1cda425e33d4610348972cd70bddf35f1770d | [
"Apache-2.0"
] | 8 | 2021-04-24T17:46:51.000Z | 2022-01-05T10:40:21.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 53.168067 | 724 | 0.676656 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . import outputs
from ._enums import *
from ._inputs import *
__all__ = ['RatePlanArgs', 'RatePlan']
@pulumi.input_type
class RatePlanArgs:
def __init__(__se... | true | true |
f723e43173495e3c39cb07e034e93d2ac42f8401 | 2,275 | py | Python | frappe/cache_manager.py | karthikeyan5/frappe | d2c652ef3a3cc6997eedcc3925e359e216b8a569 | [
"MIT"
] | null | null | null | frappe/cache_manager.py | karthikeyan5/frappe | d2c652ef3a3cc6997eedcc3925e359e216b8a569 | [
"MIT"
] | null | null | null | frappe/cache_manager.py | karthikeyan5/frappe | d2c652ef3a3cc6997eedcc3925e359e216b8a569 | [
"MIT"
] | null | null | null | # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
import frappe.defaults
from frappe.desk.notifications import (delete_notification_count_for,
clear_notifications)
common_default_keys = ["__default", "__global"]
... | 27.083333 | 94 | 0.745495 |
from __future__ import unicode_literals
import frappe
import frappe.defaults
from frappe.desk.notifications import (delete_notification_count_for,
clear_notifications)
common_default_keys = ["__default", "__global"]
def clear_user_cache(user=None):
cache = frappe.cache()
groups = ("bootinfo", "user_recent", "... | true | true |
f723e7c0843a98cbd38780ee04a037d43c171c68 | 15,765 | py | Python | dataset_loader.py | fqnchina/NeuralRouting | 333dc95cb2d9a779de88e2349883a0002111d1b3 | [
"MIT"
] | 58 | 2021-03-25T19:18:56.000Z | 2022-03-30T04:59:32.000Z | dataset_loader.py | fqnchina/NeuralRouting | 333dc95cb2d9a779de88e2349883a0002111d1b3 | [
"MIT"
] | null | null | null | dataset_loader.py | fqnchina/NeuralRouting | 333dc95cb2d9a779de88e2349883a0002111d1b3 | [
"MIT"
] | 6 | 2021-06-19T03:48:50.000Z | 2021-07-02T13:05:04.000Z | import numpy as np
import torch
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms as tfs
from PIL import Image
import os, cv2, copy, time
from config import *
# args.
image_height, image_width = opt.image_height, opt.image_width
intrinsics = opt.intrinsics
close_radius, f... | 44.159664 | 122 | 0.562195 | import numpy as np
import torch
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms as tfs
from PIL import Image
import os, cv2, copy, time
from config import *
image_height, image_width = opt.image_height, opt.image_width
intrinsics = opt.intrinsics
close_radius, far_radiu... | true | true |
f723e84d3365845116c25dda9340902ab173b6cd | 799 | py | Python | core/data/dataloader/__init__.py | HareshKarnan/awesome-semantic-segmentation-pytorch | 3c53fc004973abcb88882dcc8be899570c3053cf | [
"Apache-2.0"
] | null | null | null | core/data/dataloader/__init__.py | HareshKarnan/awesome-semantic-segmentation-pytorch | 3c53fc004973abcb88882dcc8be899570c3053cf | [
"Apache-2.0"
] | null | null | null | core/data/dataloader/__init__.py | HareshKarnan/awesome-semantic-segmentation-pytorch | 3c53fc004973abcb88882dcc8be899570c3053cf | [
"Apache-2.0"
] | null | null | null | """
This module provides data loaders and transformers for popular vision datasets.
"""
from .mscoco import COCOSegmentation
from .cityscapes import CitySegmentation
from .ade import ADE20KSegmentation
from .pascal_voc import VOCSegmentation
from .pascal_aug import VOCAugSegmentation
from .sbu_shadow import SBUSegmenta... | 28.535714 | 79 | 0.767209 | from .mscoco import COCOSegmentation
from .cityscapes import CitySegmentation
from .ade import ADE20KSegmentation
from .pascal_voc import VOCSegmentation
from .pascal_aug import VOCAugSegmentation
from .sbu_shadow import SBUSegmentation
from .ycb import YCBSegmentation
from .robocup import RobocupSegmentation
datasets... | true | true |
f723e8b52caef4e5fb333357c7a8f97adccc1b2a | 11,436 | py | Python | src/roslaunch2/package.py | CodeFinder2/roslaunch2 | 5c2aa58129671647aa8e5cbc0541caf280accffb | [
"BSD-3-Clause"
] | 10 | 2019-11-19T12:35:30.000Z | 2022-01-16T15:59:44.000Z | src/roslaunch2/package.py | CodeFinder2/roslaunch2 | 5c2aa58129671647aa8e5cbc0541caf280accffb | [
"BSD-3-Clause"
] | 1 | 2022-01-11T09:30:36.000Z | 2022-02-07T22:03:36.000Z | src/roslaunch2/package.py | CodeFinder2/roslaunch2 | 5c2aa58129671647aa8e5cbc0541caf280accffb | [
"BSD-3-Clause"
] | 3 | 2019-08-01T08:50:00.000Z | 2021-05-02T01:27:47.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: Adrian Böckenkamp
# License: BSD (https://opensource.org/licenses/BSD-3-Clause)
# Date: 08/06/2020
import rospkg
import os
import sys
import Pyro4
from . import logger
class Package:
"""
Encapsulates a ROS package and its ability to find files in... | 39.030717 | 119 | 0.612977 |
import rospkg
import os
import sys
import Pyro4
from . import logger
class Package:
__pkg_cache = {}
__dir_cache = {}
__find_cache = {}
@staticmethod
def invalidate_cache():
Package.__pkg_cache = {}
Package.__dir_cache = {}
Package.__find_cache = {}
@staticmet... | true | true |
f723e8f7914d47ae6d2455622f8a55aacd1c6ccf | 72 | py | Python | cibin/__init__.py | betochimasan/AntibodyCocktailEfficiency | 67850eb85d502af80b691b49001803f2e3091a0b | [
"BSD-3-Clause"
] | null | null | null | cibin/__init__.py | betochimasan/AntibodyCocktailEfficiency | 67850eb85d502af80b691b49001803f2e3091a0b | [
"BSD-3-Clause"
] | null | null | null | cibin/__init__.py | betochimasan/AntibodyCocktailEfficiency | 67850eb85d502af80b691b49001803f2e3091a0b | [
"BSD-3-Clause"
] | null | null | null | """
The Cibin package.
"""
__version__ = "0.0.1"
from .cibin import *
| 9 | 21 | 0.611111 |
__version__ = "0.0.1"
from .cibin import *
| true | true |
f723e91ac20eac5aead5f13782edc311af79e501 | 4,293 | py | Python | python/cairo/text_align_center.py | jeremiedecock/snippets | 4bd4e7f459eee610d5cf19f845299ca942ff4b64 | [
"MIT"
] | 23 | 2015-06-08T13:01:00.000Z | 2021-12-30T08:20:04.000Z | python/cairo/text_align_center.py | jeremiedecock/snippets | 4bd4e7f459eee610d5cf19f845299ca942ff4b64 | [
"MIT"
] | 1 | 2020-10-22T02:36:10.000Z | 2020-10-22T02:36:10.000Z | python/cairo/text_align_center.py | jeremiedecock/snippets | 4bd4e7f459eee610d5cf19f845299ca942ff4b64 | [
"MIT"
] | 7 | 2017-10-31T09:48:14.000Z | 2022-01-04T15:59:45.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2014 Jérémie DECOCK (http://www.jdhp.org)
# 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 witho... | 37.008621 | 89 | 0.699278 |
import cairo
import math
WIDTH, HEIGHT = 400, 400
def main():
surface = cairo.SVGSurface("text_align_center.svg", WIDTH, HEIGHT)
context = cairo.Context(surface)
... | true | true |
f723e929ff2525653af0e5fc4da9eb8c8a0a5165 | 532 | py | Python | deploy.py | oneofthezombies/cpp-enum-class-string-idl | e1188e6a94d5c7c6a4bc6a7d025b12f4d22c53e1 | [
"MIT"
] | 1 | 2021-05-08T08:34:09.000Z | 2021-05-08T08:34:09.000Z | deploy.py | oneofthezombies/argparse-best-practice | c29bffb014bb66d7694e4e27ad2911cc5abb3eef | [
"MIT"
] | null | null | null | deploy.py | oneofthezombies/argparse-best-practice | c29bffb014bb66d7694e4e27ad2911cc5abb3eef | [
"MIT"
] | null | null | null | from shutil import rmtree
from subprocess import run
from pathlib import Path
from itertools import chain
from more_itertools import consume
dirnames = ['build', 'dist']
paths = map(lambda path: Path(path), dirnames)
outputs = chain(paths, Path().glob('*.egg-info'))
exists = filter(lambda path: path.exists(), outputs... | 31.294118 | 71 | 0.721805 | from shutil import rmtree
from subprocess import run
from pathlib import Path
from itertools import chain
from more_itertools import consume
dirnames = ['build', 'dist']
paths = map(lambda path: Path(path), dirnames)
outputs = chain(paths, Path().glob('*.egg-info'))
exists = filter(lambda path: path.exists(), outputs... | true | true |
f723ea0c1c6678a854eaf1b914ce06a246ec9ada | 32,902 | py | Python | api/registrations/serializers.py | mattclarkcos/osf.io | 0e5ee8c0ff2a9bc7449061124ac8ce6d00f775ca | [
"Apache-2.0"
] | null | null | null | api/registrations/serializers.py | mattclarkcos/osf.io | 0e5ee8c0ff2a9bc7449061124ac8ce6d00f775ca | [
"Apache-2.0"
] | 4 | 2022-02-26T03:28:02.000Z | 2022-03-08T23:36:45.000Z | api/registrations/serializers.py | mattclarkcos/osf.io | 0e5ee8c0ff2a9bc7449061124ac8ce6d00f775ca | [
"Apache-2.0"
] | null | null | null | import pytz
import json
from unicodedata import normalize
from distutils.version import StrictVersion
from django.core.exceptions import ValidationError
from rest_framework import serializers as ser
from rest_framework import exceptions
from api.base.exceptions import Conflict, InvalidModelValueError, JSONAPIException... | 42.619171 | 133 | 0.687891 | import pytz
import json
from unicodedata import normalize
from distutils.version import StrictVersion
from django.core.exceptions import ValidationError
from rest_framework import serializers as ser
from rest_framework import exceptions
from api.base.exceptions import Conflict, InvalidModelValueError, JSONAPIException... | true | true |
f723eb375382b38526c20e9d0239da24728a5d3d | 698 | py | Python | tests/nested_foreign_keys/models.py | Yoann-Vie/esgi-hearthstone | 115d03426c7e8e80d89883b78ac72114c29bed12 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | tests/nested_foreign_keys/models.py | Yoann-Vie/esgi-hearthstone | 115d03426c7e8e80d89883b78ac72114c29bed12 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | tests/nested_foreign_keys/models.py | Yoann-Vie/esgi-hearthstone | 115d03426c7e8e80d89883b78ac72114c29bed12 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | from django.db import models
class Person(models.Model):
name = models.CharField(max_length=200)
class Movie(models.Model):
title = models.CharField(max_length=200)
director = models.ForeignKey(Person, models.CASCADE)
class Event(models.Model):
pass
class Screening(Event):
m... | 22.516129 | 79 | 0.717765 | from django.db import models
class Person(models.Model):
name = models.CharField(max_length=200)
class Movie(models.Model):
title = models.CharField(max_length=200)
director = models.ForeignKey(Person, models.CASCADE)
class Event(models.Model):
pass
class Screening(Event):
m... | true | true |
f723eb9b8474a649714e9207663dcbb042ef7f19 | 14,422 | py | Python | scipy/optimize/tests/test_linesearch.py | ischrot/scipy_rmt_bsc | 1dd8f7f0ee7ac1311ed1735ca6b6025150524418 | [
"BSD-3-Clause"
] | null | null | null | scipy/optimize/tests/test_linesearch.py | ischrot/scipy_rmt_bsc | 1dd8f7f0ee7ac1311ed1735ca6b6025150524418 | [
"BSD-3-Clause"
] | null | null | null | scipy/optimize/tests/test_linesearch.py | ischrot/scipy_rmt_bsc | 1dd8f7f0ee7ac1311ed1735ca6b6025150524418 | [
"BSD-3-Clause"
] | null | null | null | """
Tests for line search routines
"""
from numpy.testing import (assert_, assert_equal, assert_array_almost_equal,
assert_array_almost_equal_nulp, assert_warns,
suppress_warnings)
import scipy.optimize.linesearch as ls
import scipy.optimize.nonlin as nl #(LS)
from ... | 35.348039 | 123 | 0.533491 | from numpy.testing import (assert_, assert_equal, assert_array_almost_equal,
assert_array_almost_equal_nulp, assert_warns,
suppress_warnings)
import scipy.optimize.linesearch as ls
import scipy.optimize.nonlin as nl
from scipy.linalg import norm
from scipy.optimize... | true | true |
f723ece8e845f677ad57a09ea90a361f54d50c23 | 12,408 | bzl | Python | apple/internal/apple_toolchains.bzl | wendyliga/rules_apple | ac43c1e467564d9df6b3355ff93fcaf224f2c0f9 | [
"Apache-2.0"
] | null | null | null | apple/internal/apple_toolchains.bzl | wendyliga/rules_apple | ac43c1e467564d9df6b3355ff93fcaf224f2c0f9 | [
"Apache-2.0"
] | null | null | null | apple/internal/apple_toolchains.bzl | wendyliga/rules_apple | ac43c1e467564d9df6b3355ff93fcaf224f2c0f9 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 39.390476 | 100 | 0.651273 |
AppleMacToolsToolchainInfo = provider(
doc = """
Propagates information about an Apple toolchain to internal bundling rules that use the toolchain.
This provider exists as an internal detail for the rules to reference common, executable tools and
files used as script templates for the purposes of ex... | true | true |
f723ee4aca2ba51e913883657260206b3974214b | 597 | py | Python | psaw/decorators.py | LeartS/PSAW | fd0faac7205e10cc6fcb3654de8e2b23a0d79bf2 | [
"MIT"
] | null | null | null | psaw/decorators.py | LeartS/PSAW | fd0faac7205e10cc6fcb3654de8e2b23a0d79bf2 | [
"MIT"
] | null | null | null | psaw/decorators.py | LeartS/PSAW | fd0faac7205e10cc6fcb3654de8e2b23a0d79bf2 | [
"MIT"
] | null | null | null | from .exceptions import PSAWException
def requires_private_key(method):
def wrapper(self, *args, **kwargs):
if not self.private_key:
raise PSAWException(
'The {} method requires a private key'.format(method.__name__))
return method(self, *args, **kwargs)
return wrapp... | 33.166667 | 79 | 0.633166 | from .exceptions import PSAWException
def requires_private_key(method):
def wrapper(self, *args, **kwargs):
if not self.private_key:
raise PSAWException(
'The {} method requires a private key'.format(method.__name__))
return method(self, *args, **kwargs)
return wrapp... | true | true |
f723ee57e5b3ea5abd16c6bfccb377f6f8af7698 | 532 | py | Python | stats/attendance.py | lxchen2019/Python-Baseball | 0498830e92c67de8221aac1777651ae141df0ec6 | [
"MIT"
] | null | null | null | stats/attendance.py | lxchen2019/Python-Baseball | 0498830e92c67de8221aac1777651ae141df0ec6 | [
"MIT"
] | null | null | null | stats/attendance.py | lxchen2019/Python-Baseball | 0498830e92c67de8221aac1777651ae141df0ec6 | [
"MIT"
] | null | null | null | import pandas as pd
import matplotlib.pyplot as plt
from data import games
attendance = games.loc[(games['type'] == 'info') & (games['multi2'] == 'attendance'), ['year', 'multi3']]
attendance.columns = ['year', 'attendance']
attendance.loc[:, 'attendance'] = pd.to_numeric(attendance.loc[:, 'attendance'])
attendance.... | 33.25 | 105 | 0.680451 | import pandas as pd
import matplotlib.pyplot as plt
from data import games
attendance = games.loc[(games['type'] == 'info') & (games['multi2'] == 'attendance'), ['year', 'multi3']]
attendance.columns = ['year', 'attendance']
attendance.loc[:, 'attendance'] = pd.to_numeric(attendance.loc[:, 'attendance'])
attendance.... | true | true |
f723ef0ead92ce0867c0219f60d16635c90e2cd6 | 2,755 | py | Python | ch1/recipe4/load_save_model.py | xinglu/Tensorflow-2.0-Computer-Vision-Cookbook | d02c57d566f9df8b5980d58fc51a1194faef442c | [
"MIT"
] | 1 | 2021-11-27T05:44:01.000Z | 2021-11-27T05:44:01.000Z | ch1/recipe4/load_save_model.py | ArjunVarma39/Tensorflow-2.0-Computer-Vision-Cookbook | 92ea6713f664cff9eccaaccea8ac756f808e2066 | [
"MIT"
] | null | null | null | ch1/recipe4/load_save_model.py | ArjunVarma39/Tensorflow-2.0-Computer-Vision-Cookbook | 92ea6713f664cff9eccaaccea8ac756f808e2066 | [
"MIT"
] | 1 | 2021-01-21T04:36:33.000Z | 2021-01-21T04:36:33.000Z | import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import LabelBinarizer
from tensorflow.keras.datasets import mnist
from tensorflow.keras.layers import *
from tensorflow.keras.models import *
def load_data():
(X_train, y_train), (X_test, y_test) = mnist.load_data()... | 34.012346 | 91 | 0.684211 | import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import LabelBinarizer
from tensorflow.keras.datasets import mnist
from tensorflow.keras.layers import *
from tensorflow.keras.models import *
def load_data():
(X_train, y_train), (X_test, y_test) = mnist.load_data()... | true | true |
f723f0b24682ef7fb196a22b5764bea459ee3007 | 1,103 | py | Python | String-Algorithms/String-Algorithms-master/One Edit Away/oneEditAway.py | SrijaniSom/dsa-code-store | 148292c8f963214629f271ec8601e73d3d0e145e | [
"MIT"
] | 3 | 2021-02-19T07:09:46.000Z | 2021-10-04T10:12:45.000Z | String-Algorithms/String-Algorithms-master/One Edit Away/oneEditAway.py | SrijaniSom/dsa-code-store | 148292c8f963214629f271ec8601e73d3d0e145e | [
"MIT"
] | 6 | 2021-02-21T19:35:18.000Z | 2021-05-06T11:51:37.000Z | String-Algorithms/String-Algorithms-master/One Edit Away/oneEditAway.py | SrijaniSom/dsa-code-store | 148292c8f963214629f271ec8601e73d3d0e145e | [
"MIT"
] | 6 | 2021-02-21T19:28:03.000Z | 2021-10-04T03:35:57.000Z | class solution:
def oneEditAwayInsert(self,input1,input2):
index1 = 0
index2 = 0
while((index2 < len(input2)) and (index1 < len(input1))):
if(input1[index1] != input2[index2]):
if(index1 != index2):
return False
index2+=1
... | 29.810811 | 65 | 0.537625 | class solution:
def oneEditAwayInsert(self,input1,input2):
index1 = 0
index2 = 0
while((index2 < len(input2)) and (index1 < len(input1))):
if(input1[index1] != input2[index2]):
if(index1 != index2):
return False
index2+=1
... | true | true |
f723f1da4d9a432f7832da330a3205c3fef79a2c | 6,577 | py | Python | python/ccxt/async/coinexchange.py | hippylover/ccxt | db304e95b699c1971ad37b9053ae71fcb5dc3b03 | [
"MIT"
] | 2 | 2018-02-28T02:51:59.000Z | 2018-02-28T03:25:51.000Z | python/ccxt/async/coinexchange.py | hippylover/ccxt | db304e95b699c1971ad37b9053ae71fcb5dc3b03 | [
"MIT"
] | null | null | null | python/ccxt/async/coinexchange.py | hippylover/ccxt | db304e95b699c1971ad37b9053ae71fcb5dc3b03 | [
"MIT"
] | 9 | 2018-02-20T18:24:00.000Z | 2019-06-18T14:23:11.000Z | # -*- coding: utf-8 -*-
from ccxt.async.base.exchange import Exchange
import math
from ccxt.base.errors import ExchangeError
class coinexchange (Exchange):
def describe(self):
return self.deep_extend(super(coinexchange, self).describe(), {
'id': 'coinexchange',
'name': 'CoinExcha... | 35.360215 | 126 | 0.466626 |
from ccxt.async.base.exchange import Exchange
import math
from ccxt.base.errors import ExchangeError
class coinexchange (Exchange):
def describe(self):
return self.deep_extend(super(coinexchange, self).describe(), {
'id': 'coinexchange',
'name': 'CoinExchange',
'coun... | false | true |
f723f2da7cb69cc97d7d2508483485aef439d3c6 | 5,384 | py | Python | 1-50/p13.py | YiWeiShen/Project-Euler-Hints | a79cacab075dd98d393516f083aaa7ffc6115a06 | [
"MIT"
] | 1 | 2019-02-25T13:00:31.000Z | 2019-02-25T13:00:31.000Z | 1-50/p13.py | YiWeiShen/Project-Euler-Hints | a79cacab075dd98d393516f083aaa7ffc6115a06 | [
"MIT"
] | null | null | null | 1-50/p13.py | YiWeiShen/Project-Euler-Hints | a79cacab075dd98d393516f083aaa7ffc6115a06 | [
"MIT"
] | null | null | null | l = []
a = '37107287533902102798797998220837590246510135740250\
46376937677490009712648124896970078050417018260538\
74324986199524741059474233309513058123726617309629\
91942213363574161572522430563301811072406154908250\
23067588207539346171171980310421047513778063246676\
89261670696623633820136378418383684178734361726... | 47.646018 | 56 | 0.944279 | l = []
a = '37107287533902102798797998220837590246510135740250\
46376937677490009712648124896970078050417018260538\
74324986199524741059474233309513058123726617309629\
91942213363574161572522430563301811072406154908250\
23067588207539346171171980310421047513778063246676\
89261670696623633820136378418383684178734361726... | true | true |
f723f3fb8c08361f204ed3b00ea1c886a4107a59 | 1,457 | py | Python | botutils/searchforlinks.py | yashprakash13/Honeysuckle | d8adb83a63318a8c4994d18aea6fd28116b46f4e | [
"MIT"
] | 2 | 2020-08-11T17:23:05.000Z | 2021-02-20T04:02:33.000Z | botutils/searchforlinks.py | yashprakash13/Honeysuckle | d8adb83a63318a8c4994d18aea6fd28116b46f4e | [
"MIT"
] | null | null | null | botutils/searchforlinks.py | yashprakash13/Honeysuckle | d8adb83a63318a8c4994d18aea6fd28116b46f4e | [
"MIT"
] | 1 | 2020-08-15T05:29:14.000Z | 2020-08-15T05:29:14.000Z | import re
import requests
from bs4 import BeautifulSoup
from botutils.constants import IS_URL_REGEX
def get_ffn_url_from_query(query):
ffn_list = []
href = []
url = 'https://www.google.com/search?q=' + \
query+"+fanfiction"
page = requests.get(url)
soup = BeautifulSoup(page.content, 'h... | 22.075758 | 80 | 0.614276 | import re
import requests
from bs4 import BeautifulSoup
from botutils.constants import IS_URL_REGEX
def get_ffn_url_from_query(query):
ffn_list = []
href = []
url = 'https://www.google.com/search?q=' + \
query+"+fanfiction"
page = requests.get(url)
soup = BeautifulSoup(page.content, 'h... | true | true |
f723f47402f819e72e9efeddd056d1ccea3fb2f6 | 1,107 | py | Python | bach/tests/unit/bach/test_series_json.py | objectiv/objectiv-analytics | 86ec1508f71c2d61ea7d67479800e4dc417a46e1 | [
"Apache-2.0"
] | 23 | 2021-11-10T21:37:42.000Z | 2022-03-30T11:46:19.000Z | bach/tests/unit/bach/test_series_json.py | objectiv/objectiv-analytics | 86ec1508f71c2d61ea7d67479800e4dc417a46e1 | [
"Apache-2.0"
] | 163 | 2021-11-10T10:11:26.000Z | 2022-03-31T16:04:27.000Z | bach/tests/unit/bach/test_series_json.py | objectiv/objectiv-analytics | 86ec1508f71c2d61ea7d67479800e4dc417a46e1 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2022 Objectiv B.V.
"""
import pytest
from bach.series.series_json import JsonBigQueryAccessorImpl
from tests.unit.bach.util import get_fake_df
@pytest.mark.skip_postgres
def test_bq_get_slice_partial_expr(dialect):
# Here we test the _get_slice_partial_expr function of the BigQuery specific JsonBi... | 36.9 | 105 | 0.712737 | import pytest
from bach.series.series_json import JsonBigQueryAccessorImpl
from tests.unit.bach.util import get_fake_df
@pytest.mark.skip_postgres
def test_bq_get_slice_partial_expr(dialect):
df = get_fake_df(
dialect=dialect,
index_names=['i'],
data_names=['a'],
dtype=... | true | true |
f723f53cdb2ac0facc06438330246f32fcc5c7e7 | 3,101 | py | Python | pupil/models/clustering.py | hadi-gharibi/pupil | 9d266572cc1ebf659e87206be6e5f1548959d510 | [
"Apache-2.0"
] | 2 | 2022-03-31T23:17:14.000Z | 2022-03-31T23:24:58.000Z | pupil/models/clustering.py | hadi-gharibi/pupil | 9d266572cc1ebf659e87206be6e5f1548959d510 | [
"Apache-2.0"
] | null | null | null | pupil/models/clustering.py | hadi-gharibi/pupil | 9d266572cc1ebf659e87206be6e5f1548959d510 | [
"Apache-2.0"
] | null | null | null | from abc import ABC, abstractmethod
from typing import Dict, Protocol, Tuple
import faiss
import numpy as np
from pupil.types import NDArray2D
from sklearn.cluster import AgglomerativeClustering
class Clustering(Protocol):
n_clusters: int
def fit(self, X: NDArray2D):
...
def predict(self, X: ND... | 28.981308 | 132 | 0.603354 | from abc import ABC, abstractmethod
from typing import Dict, Protocol, Tuple
import faiss
import numpy as np
from pupil.types import NDArray2D
from sklearn.cluster import AgglomerativeClustering
class Clustering(Protocol):
n_clusters: int
def fit(self, X: NDArray2D):
...
def predict(self, X: ND... | true | true |
f723f5a286cb6bd6f00ddea9012b0aaff76a5524 | 6,044 | py | Python | sdks/python/apache_beam/testing/benchmarks/nexmark/queries/query3.py | eyal0/beam | 9c6922976cc2a5c6a2ef836c1986ff769cda99a5 | [
"Apache-2.0"
] | 2 | 2017-12-19T18:34:54.000Z | 2019-05-14T21:50:06.000Z | sdks/python/apache_beam/testing/benchmarks/nexmark/queries/query3.py | eyal0/beam | 9c6922976cc2a5c6a2ef836c1986ff769cda99a5 | [
"Apache-2.0"
] | 80 | 2020-01-16T09:55:09.000Z | 2020-10-03T13:43:07.000Z | sdks/python/apache_beam/testing/benchmarks/nexmark/queries/query3.py | eyal0/beam | 9c6922976cc2a5c6a2ef836c1986ff769cda99a5 | [
"Apache-2.0"
] | 1 | 2020-11-11T18:45:54.000Z | 2020-11-11T18:45:54.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 38.012579 | 89 | 0.720218 |
from __future__ import absolute_import
import logging
import apache_beam as beam
from apache_beam.testing.benchmarks.nexmark.models import nexmark_model
from apache_beam.testing.benchmarks.nexmark.queries import nexmark_query_util
from apache_beam.testing.benchmarks.nexmark.queries.nexmark_query_uti... | true | true |
f723f5e67a95794ea25c2e636d620a2789ac60ad | 48,091 | py | Python | core/controllers/admin.py | Ragify/oppia | a530c7e4d5274b646afc7dd7040d13c7ed45b829 | [
"Apache-2.0"
] | 4 | 2021-09-16T16:46:53.000Z | 2022-02-06T13:00:14.000Z | core/controllers/admin.py | Ragify/oppia | a530c7e4d5274b646afc7dd7040d13c7ed45b829 | [
"Apache-2.0"
] | null | null | null | core/controllers/admin.py | Ragify/oppia | a530c7e4d5274b646afc7dd7040d13c7ed45b829 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 38.814366 | 80 | 0.587823 |
from __future__ import absolute_import
from __future__ import unicode_literals
import io
import logging
import random
from core import feconf
from core import python_utils
from core import utils
from core.constants import constants
from core.controllers import acl_decorators
from core.controllers impor... | true | true |
f723f6aed494f61892583333010aad58dbc25f9a | 1,503 | py | Python | test/test_maintenance_configuration_api.py | cvent/octopus-deploy-api-client | 0e03e842e1beb29b132776aee077df570b88366a | [
"Apache-2.0"
] | null | null | null | test/test_maintenance_configuration_api.py | cvent/octopus-deploy-api-client | 0e03e842e1beb29b132776aee077df570b88366a | [
"Apache-2.0"
] | null | null | null | test/test_maintenance_configuration_api.py | cvent/octopus-deploy-api-client | 0e03e842e1beb29b132776aee077df570b88366a | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Octopus Server API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 2019.6.7+Branch.tags-2019.6.7.Sha.aa18dc6809953218c66f57eff7d26481d9b23d6a
Generated by: https://github.com/swagger-api... | 31.978723 | 129 | 0.795742 |
from __future__ import absolute_import
import unittest
import octopus_deploy_swagger_client
from octopus_deploy_client.maintenance_configuration_api import MaintenanceConfigurationApi
from octopus_deploy_swagger_client.rest import ApiException
class TestMaintenanceConfigurationApi(unittest.TestCase):
def... | true | true |
f723f6d3146fbf9c9696d5956391430c0797a221 | 6,843 | py | Python | src/azure-cli/setup.py | t-bzhan/azure-cli | d64b25204b661438e9284f261bc5a11f3221c837 | [
"MIT"
] | null | null | null | src/azure-cli/setup.py | t-bzhan/azure-cli | d64b25204b661438e9284f261bc5a11f3221c837 | [
"MIT"
] | null | null | null | src/azure-cli/setup.py | t-bzhan/azure-cli | d64b25204b661438e9284f261bc5a11f3221c837 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ---------------------------------------------... | 34.044776 | 103 | 0.604998 |
from __future__ import print_function
from codecs import open
from setuptools import setup, find_packages
import sys
try:
from azure_cli_bdist_wheel import cmdclass
except ImportError:
from distutils import log as logger
logger.warn("Wheel is not available, disabling bdist_wheel hook")
cmdclass... | true | true |
f723f6f2ec0f62ea9f018768408724d303030146 | 1,583 | py | Python | valid_subsequence.py | GerardCod/algoexpert-python | 35d7f635f68e0d28eaead815f653bf749aa275cb | [
"Apache-2.0"
] | null | null | null | valid_subsequence.py | GerardCod/algoexpert-python | 35d7f635f68e0d28eaead815f653bf749aa275cb | [
"Apache-2.0"
] | null | null | null | valid_subsequence.py | GerardCod/algoexpert-python | 35d7f635f68e0d28eaead815f653bf749aa275cb | [
"Apache-2.0"
] | null | null | null | def validateSubSequence(array, sequence):
"""
### Description
validateSubSequence -> validates if a sequence of elements is a subsequence of a list.
### Parameters
- array: the list where it will validate the subsequence.
- sequence: the potential subsequence of elements
... | 29.867925 | 94 | 0.598863 | def validateSubSequence(array, sequence):
arrIdx = 0
seqIdx = 0
while arrIdx < len(array) and seqIdx < len(sequence):
if array[arrIdx] == sequence[seqIdx]:
seqIdx += 1
arrIdx += 1
return seqIdx == len(sequence)
def validateSubSequenceFor(array, sequence):
... | true | true |
f723f81e9a3f4e12dffa9c9a8c28e3e333ab9a3c | 3,092 | py | Python | fhirbug/Fhir/Resources/address.py | VerdantAI/fhirbug | 8a8e2555c0edfeee0a7edbc8d67f2fcb2edd3c2d | [
"MIT"
] | 8 | 2019-01-06T18:11:20.000Z | 2022-02-24T02:06:55.000Z | fhirbug/Fhir/Resources/address.py | VerdantAI/fhirbug | 8a8e2555c0edfeee0a7edbc8d67f2fcb2edd3c2d | [
"MIT"
] | 5 | 2019-01-25T14:15:35.000Z | 2021-06-01T23:22:41.000Z | fhirbug/Fhir/Resources/address.py | VerdantAI/fhirbug | 8a8e2555c0edfeee0a7edbc8d67f2fcb2edd3c2d | [
"MIT"
] | 3 | 2020-10-14T23:09:29.000Z | 2021-08-09T19:27:31.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Address) on 2019-01-25.
# 2019, SMART Health IT.
##
from . import element
class Address(element.Element):
""" An address expressed using postal conventions (as opposed to GPS or other... | 32.547368 | 104 | 0.583441 |
from . import element
class Address(element.Element):
resource_type = "Address"
def __init__(self, jsondict=None, strict=True, **kwargs):
self.city = None
self.country = None
self.district = None
self.line = None
self.period = None
self.postalCode ... | true | true |
f723f8a8d4760f751862af7dd8140ab1cad4f937 | 755 | py | Python | setup.py | salesforce/bite | 0619bc6d87b81ec65cf311906da3889043176ead | [
"BSD-3-Clause"
] | 6 | 2020-12-09T01:57:13.000Z | 2021-10-09T01:50:21.000Z | setup.py | salesforce/bite | 0619bc6d87b81ec65cf311906da3889043176ead | [
"BSD-3-Clause"
] | 1 | 2021-02-16T14:50:09.000Z | 2021-02-23T07:29:15.000Z | setup.py | salesforce/bite | 0619bc6d87b81ec65cf311906da3889043176ead | [
"BSD-3-Clause"
] | null | null | null | from setuptools import setup
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="bite",
version="0.1",
author="Samson Tan",
author_email="samson.tan@salesforce.com",
description="A tokenizer that splits words into bases and inflections.",
long_descriptio... | 30.2 | 76 | 0.65298 | from setuptools import setup
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="bite",
version="0.1",
author="Samson Tan",
author_email="samson.tan@salesforce.com",
description="A tokenizer that splits words into bases and inflections.",
long_descriptio... | true | true |
f723f8c5703335b1a0fa5a181861df8ecc2a13f8 | 6,240 | py | Python | python/istio_api/mixer/v1/config/client/service_pb2.py | mt-inside/api | 3197d4dee332beb55f830899f37091c9899833f9 | [
"Apache-2.0"
] | 3 | 2020-11-30T15:35:37.000Z | 2022-01-06T14:17:18.000Z | python/istio_api/mixer/v1/config/client/service_pb2.py | mt-inside/api | 3197d4dee332beb55f830899f37091c9899833f9 | [
"Apache-2.0"
] | 54 | 2020-06-23T17:34:04.000Z | 2022-03-31T02:04:06.000Z | python/istio_api/mixer/v1/config/client/service_pb2.py | mt-inside/api | 3197d4dee332beb55f830899f37091c9899833f9 | [
"Apache-2.0"
] | 12 | 2020-07-14T23:59:57.000Z | 2022-03-22T09:59:18.000Z | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: mixer/v1/config/client/service.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
f... | 41.6 | 624 | 0.747276 |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db ... | true | true |
f723f948cdc428c8f98ae5492744213241a82570 | 3,751 | py | Python | nest_csa_fan.py | danhje/neural-network-connection-algorithms-tester | 9183d8ba0cccf4bc98284d1c859471d1eba901a3 | [
"MIT"
] | null | null | null | nest_csa_fan.py | danhje/neural-network-connection-algorithms-tester | 9183d8ba0cccf4bc98284d1c859471d1eba901a3 | [
"MIT"
] | null | null | null | nest_csa_fan.py | danhje/neural-network-connection-algorithms-tester | 9183d8ba0cccf4bc98284d1c859471d1eba901a3 | [
"MIT"
] | null | null | null | '''
@author: Daniel Hjertholm
Tests for fan-in / -out networks created by the CSA implementation in NEST.
'''
import numpy.random as rnd
import random
import nest
import csa
from testsuite.fan_test import FanTester
class NEST_FanTester(FanTester):
'''
Tests for fan-in / -out networks created by the CSA imp... | 30.008 | 79 | 0.596641 | '''
@author: Daniel Hjertholm
Tests for fan-in / -out networks created by the CSA implementation in NEST.
'''
import numpy.random as rnd
import random
import nest
import csa
from testsuite.fan_test import FanTester
class NEST_FanTester(FanTester):
'''
Tests for fan-in / -out networks created by the CSA imp... | false | true |
f723fa96b4b622359c95f9d0ad4cdd27364d7401 | 3,267 | py | Python | tests/test_paper_collection.py | h1-the-swan/paper_collection | f07ad5cd8c40ddd75df2031b15c49eee60f1d914 | [
"MIT"
] | null | null | null | tests/test_paper_collection.py | h1-the-swan/paper_collection | f07ad5cd8c40ddd75df2031b15c49eee60f1d914 | [
"MIT"
] | 2 | 2020-03-31T11:20:29.000Z | 2020-03-31T15:20:21.000Z | tests/test_paper_collection.py | h1-the-swan/paper_collection | f07ad5cd8c40ddd75df2031b15c49eee60f1d914 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Tests for `paper_collection` package."""
import unittest
from paper_collection import paper_collection
import pandas as pd
import numpy as np
class TestPaper_collection(unittest.TestCase):
"""Tests for `paper_collection` package."""
def setUp(self):
"""Set up test fixtur... | 38.435294 | 95 | 0.585859 |
import unittest
from paper_collection import paper_collection
import pandas as pd
import numpy as np
class TestPaper_collection(unittest.TestCase):
def setUp(self):
self.df_papers = pd.read_csv('tests/jw_papers_mag2019.tsv', sep='\t')
self.df_papers.drop_duplicates(subset=['PaperId'], inpla... | true | true |
f723faadd5d49357ab40cc0e11d377652ed79a23 | 541 | py | Python | scripts/idc/sortsymbols.py | camden314/CacaoSDK | 57b7e0654595eb7a432ef1faec9b239a3854cf45 | [
"MIT"
] | 4 | 2021-01-26T10:00:43.000Z | 2021-08-06T21:35:15.000Z | scripts/idc/sortsymbols.py | camden314/CacaoSDK | 57b7e0654595eb7a432ef1faec9b239a3854cf45 | [
"MIT"
] | 2 | 2021-07-26T01:55:43.000Z | 2021-07-26T17:42:20.000Z | scripts/idc/sortsymbols.py | camden314/CacaoSDK | 57b7e0654595eb7a432ef1faec9b239a3854cf45 | [
"MIT"
] | 1 | 2021-06-01T17:40:01.000Z | 2021-06-01T17:40:01.000Z | import re
l = []
with open("functionsthunk.txt", "r") as f:
s = f.readlines()
for k, m in zip(s[0::2], s[1::2]):
if 'non-virtual' not in k:
l.append((k, m))
def sfun(a):
m = re.search(r"(?:non-virtual thunk to )?(.+?\(.*\)(?: const)?\n.+\n\n)", a)
print(a)
return m.group(1)
with open("functions.tx... | 24.590909 | 81 | 0.502773 | import re
l = []
with open("functionsthunk.txt", "r") as f:
s = f.readlines()
for k, m in zip(s[0::2], s[1::2]):
if 'non-virtual' not in k:
l.append((k, m))
def sfun(a):
m = re.search(r"(?:non-virtual thunk to )?(.+?\(.*\)(?: const)?\n.+\n\n)", a)
print(a)
return m.group(1)
with open("functions.tx... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.