hexsha
stringlengths
40
40
size
int64
2
1.02M
ext
stringclasses
10 values
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
4
245
max_stars_repo_name
stringlengths
6
130
max_stars_repo_head_hexsha
stringlengths
40
40
max_stars_repo_licenses
listlengths
1
10
max_stars_count
int64
1
191k
⌀
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
⌀
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
⌀
max_issues_repo_path
stringlengths
4
245
max_issues_repo_name
stringlengths
6
130
max_issues_repo_head_hexsha
stringlengths
40
40
max_issues_repo_licenses
listlengths
1
10
max_issues_count
int64
1
67k
⌀
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
⌀
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
⌀
max_forks_repo_path
stringlengths
4
245
max_forks_repo_name
stringlengths
6
130
max_forks_repo_head_hexsha
stringlengths
40
40
max_forks_repo_licenses
listlengths
1
10
max_forks_count
int64
1
105k
⌀
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
⌀
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
⌀
content
stringlengths
2
1.02M
avg_line_length
float64
1
958k
max_line_length
int64
1
987k
alphanum_fraction
float64
0
1
content_no_comment
stringlengths
0
1.01M
is_comment_constant_removed
bool
2 classes
is_sharp_comment_removed
bool
1 class
f7739254651d5f969c1753cafd1a1d0c4cfb7427
452
py
Python
swsg/file_paths.py
derdon/swsg
93f685a47bb55bfb84d4d1ccb129c22ad697463c
[ "WTFPL" ]
1
2017-10-20T03:37:14.000Z
2017-10-20T03:37:14.000Z
swsg/file_paths.py
derdon/swsg
93f685a47bb55bfb84d4d1ccb129c22ad697463c
[ "WTFPL" ]
null
null
null
swsg/file_paths.py
derdon/swsg
93f685a47bb55bfb84d4d1ccb129c22ad697463c
[ "WTFPL" ]
null
null
null
from os import getenv, path XDG_DATA_HOME = getenv( 'XDG_DATA_HOME', path.expanduser(path.join('~', '.local', 'share'))) XDG_CONFIG_HOME = getenv( 'XDG_CONFIG_HOME', path.expanduser(path.join('~', '.config'))) GLOBAL_CONFIGFILE = path.join(XDG_CONFIG_HOME, 'swsg') PROJECT_DATA_DIR = path.join(XDG_DATA_HOME, 's...
41.090909
75
0.745575
from os import getenv, path XDG_DATA_HOME = getenv( 'XDG_DATA_HOME', path.expanduser(path.join('~', '.local', 'share'))) XDG_CONFIG_HOME = getenv( 'XDG_CONFIG_HOME', path.expanduser(path.join('~', '.config'))) GLOBAL_CONFIGFILE = path.join(XDG_CONFIG_HOME, 'swsg') PROJECT_DATA_DIR = path.join(XDG_DATA_HOME, 's...
true
true
f77392f27e1e082efecb580485c769a439bdd9c3
303
py
Python
path_finders/path_finder.py
dulek/alt-tester
d3925e28b2b01ca25706546646b921de90fcd5c8
[ "MIT" ]
null
null
null
path_finders/path_finder.py
dulek/alt-tester
d3925e28b2b01ca25706546646b921de90fcd5c8
[ "MIT" ]
null
null
null
path_finders/path_finder.py
dulek/alt-tester
d3925e28b2b01ca25706546646b921de90fcd5c8
[ "MIT" ]
null
null
null
from abc import ABCMeta, abstractmethod class PathFinder(object): __metaclass__ = ABCMeta def __init__(self, G, P): self.G = G self.P = P @abstractmethod def heuristic(self, v, src, dest): pass @abstractmethod def calc(self, src, dest): pass
16.833333
39
0.60066
from abc import ABCMeta, abstractmethod class PathFinder(object): __metaclass__ = ABCMeta def __init__(self, G, P): self.G = G self.P = P @abstractmethod def heuristic(self, v, src, dest): pass @abstractmethod def calc(self, src, dest): pass
true
true
f77394c34ed3bb8f48c61e31425f1ec7e566d904
5,422
py
Python
lx_step.py
zz217/lx-step
90ef2fcdbc30ba51bd5f7348a06bde0d6cb5ee62
[ "MIT" ]
null
null
null
lx_step.py
zz217/lx-step
90ef2fcdbc30ba51bd5f7348a06bde0d6cb5ee62
[ "MIT" ]
null
null
null
lx_step.py
zz217/lx-step
90ef2fcdbc30ba51bd5f7348a06bde0d6cb5ee62
[ "MIT" ]
null
null
null
# -*- coding: utf8 -*- import requests import hashlib import json import time import random requests.packages.urllib3.disable_warnings def md5(code): res=hashlib.md5() res.update(code.encode("utf8")) return res.hexdigest() def get_information(mobile,password): header = { 'Content-Type': 'applic...
34.316456
709
0.598303
import requests import hashlib import json import time import random requests.packages.urllib3.disable_warnings def md5(code): res=hashlib.md5() res.update(code.encode("utf8")) return res.hexdigest() def get_information(mobile,password): header = { 'Content-Type': 'application/json; charset=utf...
true
true
f77395e736b80e7c13e8463a8f61278afd41feed
737
py
Python
serve/triton/constant.py
shiyu22/towhee
3e7b24aefb20f3e6452da115bf7e47e6261d65eb
[ "Apache-2.0" ]
null
null
null
serve/triton/constant.py
shiyu22/towhee
3e7b24aefb20f3e6452da115bf7e47e6261d65eb
[ "Apache-2.0" ]
null
null
null
serve/triton/constant.py
shiyu22/towhee
3e7b24aefb20f3e6452da115bf7e47e6261d65eb
[ "Apache-2.0" ]
null
null
null
# Copyright 2021 Zilliz. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
32.043478
74
0.755767
EMPTY_OPS = ['dummy_input', 'end'] NNOPERATOR = 'NNOperator' PYOPERATOR = 'PyOperator' PREPROCESS = 'preprocess' POSTPROCESS = 'postprocess'
true
true
f77397223ba6a48c786a46e792a29bf675103b22
23,122
py
Python
integration-testing/client/CasperClient/casper_client/casper_client.py
gurinderu/CasperLabs
b043158c25eb83a13596e93befef76e2ac5bff9d
[ "Apache-2.0" ]
null
null
null
integration-testing/client/CasperClient/casper_client/casper_client.py
gurinderu/CasperLabs
b043158c25eb83a13596e93befef76e2ac5bff9d
[ "Apache-2.0" ]
null
null
null
integration-testing/client/CasperClient/casper_client/casper_client.py
gurinderu/CasperLabs
b043158c25eb83a13596e93befef76e2ac5bff9d
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python3 """ CasperLabs Client API library and command line tool. """ import sys import time import argparse import grpc import functools from pyblake2 import blake2b import ed25519 import base64 import struct import json from operator import add from functools import reduce # ~/CasperLabs/protobuf/io/ca...
43.380863
242
0.579708
import sys import time import argparse import grpc import functools from pyblake2 import blake2b import ed25519 import base64 import struct import json from operator import add from functools import reduce from .control_pb2_grpc import ControlServiceStub from . import control_pb2 as control from . import casper_pb2 a...
true
true
f77397997cf6bb8568564804e6fb458bd73f83ce
10,955
py
Python
wagtail/admin/views/generic/models.py
fairhopeweb/wagtail
fe658f021f2cd43bde4a16d1c4d9fa292ec547f3
[ "BSD-3-Clause" ]
1
2022-02-09T05:25:30.000Z
2022-02-09T05:25:30.000Z
wagtail/admin/views/generic/models.py
fairhopeweb/wagtail
fe658f021f2cd43bde4a16d1c4d9fa292ec547f3
[ "BSD-3-Clause" ]
null
null
null
wagtail/admin/views/generic/models.py
fairhopeweb/wagtail
fe658f021f2cd43bde4a16d1c4d9fa292ec547f3
[ "BSD-3-Clause" ]
null
null
null
from django import VERSION as DJANGO_VERSION from django.db import transaction from django.forms import Form from django.http import HttpResponseRedirect from django.shortcuts import redirect from django.urls import reverse from django.utils.translation import gettext as _ from django.utils.translation import gettext_l...
34.127726
96
0.645367
from django import VERSION as DJANGO_VERSION from django.db import transaction from django.forms import Form from django.http import HttpResponseRedirect from django.shortcuts import redirect from django.urls import reverse from django.utils.translation import gettext as _ from django.utils.translation import gettext_l...
true
true
f77398bddedfd6aab195540cfb0a939ae824b1a0
8,034
py
Python
tensorflow/python/keras/initializers_test.py
uve/tensorflow
e08079463bf43e5963acc41da1f57e95603f8080
[ "Apache-2.0" ]
null
null
null
tensorflow/python/keras/initializers_test.py
uve/tensorflow
e08079463bf43e5963acc41da1f57e95603f8080
[ "Apache-2.0" ]
null
null
null
tensorflow/python/keras/initializers_test.py
uve/tensorflow
e08079463bf43e5963acc41da1f57e95603f8080
[ "Apache-2.0" ]
null
null
null
# Copyright 2016 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...
32.658537
81
0.63169
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.python import keras from tensorflow.python import tf2 from tensorflow.python.framework import test_util from tensorflow.python.ops import array_ops from tensorflo...
true
true
f773996246c4be175f752fdeb1566317fcc7c093
4,910
py
Python
tempest/cmd/run_stress.py
vmahuli/tempest
f70319f5eda72b8c8a913ae1002ec531324e4116
[ "Apache-2.0" ]
null
null
null
tempest/cmd/run_stress.py
vmahuli/tempest
f70319f5eda72b8c8a913ae1002ec531324e4116
[ "Apache-2.0" ]
null
null
null
tempest/cmd/run_stress.py
vmahuli/tempest
f70319f5eda72b8c8a913ae1002ec531324e4116
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python # Copyright 2013 Quanta Research Cambridge, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # U...
38.359375
78
0.575356
import argparse import inspect import json import sys from testtools import testsuite try: from unittest import loader except ImportError: from unittest2 import loader from tempest.openstack.common import log as logging from tempest.stress import driver LOG = logging.getLogger(__name__) def discover_s...
true
true
f773999a7b73204e248e227e6bde1973c014e5a9
3,632
py
Python
custom_components/weenect/sensor.py
eifinger/hass-weenect
b0adad61d33927a530f54ec1d632cc2365fdcadf
[ "MIT" ]
2
2021-07-15T11:25:55.000Z
2021-11-30T15:38:33.000Z
custom_components/weenect/sensor.py
eifinger/hass-weenect
b0adad61d33927a530f54ec1d632cc2365fdcadf
[ "MIT" ]
89
2021-04-18T19:53:53.000Z
2022-03-30T06:18:11.000Z
custom_components/weenect/sensor.py
eifinger/hass-weenect
b0adad61d33927a530f54ec1d632cc2365fdcadf
[ "MIT" ]
1
2021-06-25T22:31:32.000Z
2021-06-25T22:31:32.000Z
"""Sensor platform for weenect.""" from __future__ import annotations from datetime import datetime from typing import List from homeassistant.components.sensor import ( SensorDeviceClass, SensorEntity, SensorEntityDescription, ) from homeassistant.config_entries import ConfigEntry from homeassistant.core...
31.582609
93
0.679791
from __future__ import annotations from datetime import datetime from typing import List from homeassistant.components.sensor import ( SensorDeviceClass, SensorEntity, SensorEntityDescription, ) from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant, callback fro...
true
true
f7739a27329723d7c5a7e451bfd629197620055e
43,212
py
Python
pirates/quest/DistributedQuestGiver.py
ksmit799/POTCO-PS
520d38935ae8df4b452c733a82c94dddac01e275
[ "Apache-2.0" ]
8
2017-01-24T04:33:29.000Z
2020-11-01T08:36:24.000Z
pirates/quest/DistributedQuestGiver.py
ksmit799/Pirates-Online-Remake
520d38935ae8df4b452c733a82c94dddac01e275
[ "Apache-2.0" ]
1
2017-03-02T18:05:17.000Z
2017-03-14T06:47:10.000Z
pirates/quest/DistributedQuestGiver.py
ksmit799/Pirates-Online-Remake
520d38935ae8df4b452c733a82c94dddac01e275
[ "Apache-2.0" ]
11
2017-03-02T18:46:07.000Z
2020-11-01T08:36:26.000Z
from panda3d.core import * from direct.showbase.ShowBaseGlobal import * from direct.directnotify.DirectNotifyGlobal import directNotify from direct.distributed.ClockDelta import * from direct.interval.IntervalGlobal import * from direct.showbase.PythonUtil import getShortestRotation from otp.avatar import Avatar from o...
38.547725
262
0.57528
from panda3d.core import * from direct.showbase.ShowBaseGlobal import * from direct.directnotify.DirectNotifyGlobal import directNotify from direct.distributed.ClockDelta import * from direct.interval.IntervalGlobal import * from direct.showbase.PythonUtil import getShortestRotation from otp.avatar import Avatar from o...
false
true
f7739b152712e26961c0e2ae3b99bc0c3b991254
5,329
py
Python
bot/venv/lib/python3.7/site-packages/scipy/ndimage/_ni_docstrings.py
manaccac/sc2_bot
3aa8b3711378b71fd0a44662cdd7148846e39530
[ "MIT" ]
353
2020-12-10T10:47:17.000Z
2022-03-31T23:08:29.000Z
bot/venv/lib/python3.7/site-packages/scipy/ndimage/_ni_docstrings.py
manaccac/sc2_bot
3aa8b3711378b71fd0a44662cdd7148846e39530
[ "MIT" ]
80
2020-12-10T09:54:22.000Z
2022-03-30T22:08:45.000Z
bot/venv/lib/python3.7/site-packages/scipy/ndimage/_ni_docstrings.py
manaccac/sc2_bot
3aa8b3711378b71fd0a44662cdd7148846e39530
[ "MIT" ]
63
2020-12-10T17:10:34.000Z
2022-03-28T16:27:07.000Z
"""Docstring components common to several ndimage functions.""" from scipy._lib import doccer __all__ = ['docfiller'] _input_doc = ( """input : array_like The input array.""") _axis_doc = ( """axis : int, optional The axis of `input` along which to calculate. Default is -1.""") _output_doc = ( """output : ar...
41.310078
74
0.67949
from scipy._lib import doccer __all__ = ['docfiller'] _input_doc = ( """input : array_like The input array.""") _axis_doc = ( """axis : int, optional The axis of `input` along which to calculate. Default is -1.""") _output_doc = ( """output : array or dtype, optional The array in which to place the outpu...
true
true
f7739c21bfe7195cc8510985b2f0b87f59d63534
1,043
py
Python
data/model/oci/blob.py
anwarchk/quay
23c5120790c619174e7d36784ca5aab7f4eece5c
[ "Apache-2.0" ]
1
2021-03-02T21:15:04.000Z
2021-03-02T21:15:04.000Z
data/model/oci/blob.py
anwarchk/quay
23c5120790c619174e7d36784ca5aab7f4eece5c
[ "Apache-2.0" ]
20
2019-12-26T17:32:34.000Z
2022-03-21T22:18:06.000Z
data/model/oci/blob.py
anwarchk/quay
23c5120790c619174e7d36784ca5aab7f4eece5c
[ "Apache-2.0" ]
1
2020-05-31T16:28:40.000Z
2020-05-31T16:28:40.000Z
from data.database import ImageStorage, ManifestBlob from data.model import BlobDoesNotExist from data.model.storage import get_storage_by_uuid, InvalidImageException from data.model.blob import get_repository_blob_by_digest as legacy_get def get_repository_blob_by_digest(repository, blob_digest): """ Find the conte...
38.62963
78
0.703739
from data.database import ImageStorage, ManifestBlob from data.model import BlobDoesNotExist from data.model.storage import get_storage_by_uuid, InvalidImageException from data.model.blob import get_repository_blob_by_digest as legacy_get def get_repository_blob_by_digest(repository, blob_digest): try: storage =...
true
true
f7739c3b0dfb2fb7b0cbd35e9908d69179687655
27,420
py
Python
UCI_ML_Functions.py
JanBrabec/UCI-ML-API
59f6c680ac914df55e93e05545eb198887510943
[ "MIT" ]
null
null
null
UCI_ML_Functions.py
JanBrabec/UCI-ML-API
59f6c680ac914df55e93e05545eb198887510943
[ "MIT" ]
null
null
null
UCI_ML_Functions.py
JanBrabec/UCI-ML-API
59f6c680ac914df55e93e05545eb198887510943
[ "MIT" ]
null
null
null
# Functions to read, analyze, and download from UCI ML portal # ========================================== # Function to read UCI ML datasets table # ========================================== def read_dataset_table( url="https://archive.ics.uci.edu/ml/datasets.php", msg_flag=True ): """ Reads the table of...
35.472186
253
0.567433
def read_dataset_table( url="https://archive.ics.uci.edu/ml/datasets.php", msg_flag=True ): import pandas as pd try: if msg_flag: print("Reading the dataset table from UCI ML repo...") datasets = pd.read_html(url) if msg_flag: print("Finished reading the tab...
true
true
f7739d1b02948c059f6b92fbe7e92e18b044d85a
895
py
Python
IPA_CONVERSION_SOFTWARE.py
GurjotSinghMahi/PUNJABI-IPA-CONVERTER
81a803598e538a7fc2aec75ceef35d11f098873d
[ "MIT" ]
2
2018-08-19T03:45:42.000Z
2019-03-26T13:41:26.000Z
IPA_CONVERSION_SOFTWARE.py
GurjotSinghMahi/PUNJABI-IPA-CONVERTER
81a803598e538a7fc2aec75ceef35d11f098873d
[ "MIT" ]
null
null
null
IPA_CONVERSION_SOFTWARE.py
GurjotSinghMahi/PUNJABI-IPA-CONVERTER
81a803598e538a7fc2aec75ceef35d11f098873d
[ "MIT" ]
2
2018-08-19T03:45:43.000Z
2022-01-11T05:40:19.000Z
#!/usr/bin/env python # -*- coding: utf-8 -*- """ DEVELOPER: GURJOT SINGH MAHI E-MAIL: GURJOTMAHI28@GMAIL.COM WRITTEN USING: PYTHON 3.6 THE PUNJABI IPA CONVERSION SOFTWARE PROVIDE THE CAPABILITY TO CONVERT THE PUNJABI WORDS OR CHARACTERS TO ITS EQUIVALENT IPA CHARACTERS. THIS PIECE OF CODE WAS WRITTEN AS A ...
29.833333
82
0.744134
import os from tkinter import * from main_window import window root = Tk() root.geometry("1000x600+30+60") imgicon = PhotoImage(file=os.path.join('pipalogo.gif')) root.tk.call('wm', 'iconphoto', root._w, imgicon) root.title("PUNJABI IPA CONVERTER") window(root) root.mainloop()
true
true
f7739f19c80b6bf1ec4c5bea857ec19c3ea82f14
2,958
py
Python
iscc_cli/fpcalc.py
Sprillow/iscc-cli
86f82494a6fe300a79eacec2f101aace83e98563
[ "MIT" ]
15
2019-06-01T08:00:10.000Z
2021-08-11T22:18:40.000Z
iscc_cli/fpcalc.py
Sprillow/iscc-cli
86f82494a6fe300a79eacec2f101aace83e98563
[ "MIT" ]
46
2019-05-31T21:29:33.000Z
2022-02-09T09:06:38.000Z
iscc_cli/fpcalc.py
Sprillow/iscc-cli
86f82494a6fe300a79eacec2f101aace83e98563
[ "MIT" ]
4
2019-09-06T16:43:39.000Z
2022-01-06T18:20:47.000Z
# -*- coding: utf-8 -*- """A thin cross plattform installer and wrapper around chromaprint fpcalc.""" import os import platform import shutil import tarfile import zipfile import subprocess import stat import click import iscc_cli from iscc_cli.utils import download_file FPCALC_VERSION = "1.5.0" FPCALC_URL_BASE = "ht...
32.866667
90
0.64165
import os import platform import shutil import tarfile import zipfile import subprocess import stat import click import iscc_cli from iscc_cli.utils import download_file FPCALC_VERSION = "1.5.0" FPCALC_URL_BASE = "https://github.com/acoustid/chromaprint/releases/download/v{}/".format( FPCALC_VERSION ) FPCALC_OS_M...
true
true
f7739f3bab79ee760fb3b7b9c75efa1d93e0f3ea
3,629
py
Python
Collections-a-installer/community-general-2.4.0/plugins/modules/remote_management/oneview/oneview_fc_network_facts.py
d-amien-b/simple-getwordpress
da90d515a0aa837b633d50db4d91d22b031c04a2
[ "MIT" ]
17
2017-06-07T23:15:01.000Z
2021-08-30T14:32:36.000Z
Collections-a-installer/community-general-2.4.0/plugins/modules/remote_management/oneview/oneview_fc_network_facts.py
d-amien-b/simple-getwordpress
da90d515a0aa837b633d50db4d91d22b031c04a2
[ "MIT" ]
9
2017-06-25T03:31:52.000Z
2021-05-17T23:43:12.000Z
Collections-a-installer/community-general-2.4.0/plugins/modules/remote_management/oneview/oneview_fc_network_facts.py
d-amien-b/simple-getwordpress
da90d515a0aa837b633d50db4d91d22b031c04a2
[ "MIT" ]
3
2018-05-26T21:31:22.000Z
2019-09-28T17:00:45.000Z
#!/usr/bin/python # Copyright (c) 2016-2017 Hewlett Packard Enterprise Development LP # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' --- module: oneview_fc_network_...
32.693694
123
0.711766
from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' --- module: oneview_fc_network_info short_description: Retrieve the information about one or more of the OneView Fibre Channel Networks description: - Retrieve the information about one or more of the Fibre...
true
true
f773a22b1c75b10013f5b6704e4c288f3bbc36ec
3,480
py
Python
code/feature_extraction/umls_dir/interface_umls.py
BreakingMedicalRecords/landingpage
6189530e471acc23e523f1c4d6e401a1e53f04ee
[ "Unlicense" ]
240
2015-02-28T01:34:54.000Z
2022-03-27T23:25:38.000Z
code/feature_extraction/umls_dir/interface_umls.py
BreakingMedicalRecords/landingpage
6189530e471acc23e523f1c4d6e401a1e53f04ee
[ "Unlicense" ]
21
2015-03-20T19:15:03.000Z
2020-08-14T20:19:26.000Z
code/feature_extraction/umls_dir/interface_umls.py
BreakingMedicalRecords/landingpage
6189530e471acc23e523f1c4d6e401a1e53f04ee
[ "Unlicense" ]
125
2015-04-16T17:54:54.000Z
2021-12-30T09:06:42.000Z
# # Interface to UMLS Databases and concept trie # # # import copy import sqlite3 import create_sqliteDB import os import create_trie import difflib import string import sys features_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) if features_dir not in sys.path: sys.path.append(features_dir) ...
25.588235
140
0.599425
import copy import sqlite3 import create_sqliteDB import os import create_trie import difflib import string import sys features_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) if features_dir not in sys.path: sys.path.append(features_dir) from read_config import enabled_modules enabled = enab...
false
true
f773a358c4e73c69aca4f13bfc83cdd7004492bc
8,248
py
Python
tools/python/maps_generator/generator/stages.py
Polas/omim
03558b418b338f506fbf3aa72ddf15187a2005ee
[ "Apache-2.0" ]
1
2020-11-10T01:13:12.000Z
2020-11-10T01:13:12.000Z
tools/python/maps_generator/generator/stages.py
Polas/omim
03558b418b338f506fbf3aa72ddf15187a2005ee
[ "Apache-2.0" ]
1
2018-11-26T15:44:46.000Z
2018-11-27T10:55:36.000Z
tools/python/maps_generator/generator/stages.py
Polas/omim
03558b418b338f506fbf3aa72ddf15187a2005ee
[ "Apache-2.0" ]
null
null
null
"""" This file contains some decorators that define stages. There are two main types of stages: 1. stage - a high level stage 2. country_stage - a stage that applies to countries files(*.mwm). country_stage might be inside stage. There are country stages inside mwm_stage. mwm_stage is only one stage that conta...
31.601533
88
0.632032
import datetime import logging import os import time from abc import ABC from abc import abstractmethod from collections import defaultdict from typing import AnyStr from typing import Callable from typing import List from typing import Optional from typing import Type from typing import Union from .status import Stat...
true
true
f773a3787a279db7878b63593b0a8198c99ba135
15,136
py
Python
python/tutorials/03-matrix-multiplication.py
h-vetinari/triton
d9dd97492f228020573b39a9cec14ee3b8776957
[ "MIT" ]
146
2015-12-29T03:42:45.000Z
2020-02-05T14:50:55.000Z
python/tutorials/03-matrix-multiplication.py
h-vetinari/triton
d9dd97492f228020573b39a9cec14ee3b8776957
[ "MIT" ]
28
2015-12-26T01:38:22.000Z
2018-11-18T05:20:26.000Z
python/tutorials/03-matrix-multiplication.py
h-vetinari/triton
d9dd97492f228020573b39a9cec14ee3b8776957
[ "MIT" ]
52
2016-02-26T17:27:28.000Z
2020-01-20T03:13:40.000Z
""" Matrix Multiplication ====================== In this tutorial, you will write a 25-lines high-performance FP16 matrix multiplication kernel that achieves performance on par with cuBLAS. You will specifically learn about: - Block-level matrix multiplications - Multi-dimensional pointer arithmetic - Program re-order...
42.516854
194
0.652814
# group_size_m = min(num_pid_m - first_pid_m, GROUP_SIZE_M) # # *within groups*, programs are ordered in a column-major order # # row-id of the program in the *launch grid* # pid_m = first_pid_m + (pid % group_size_m) # # col-id of the program in the *launch grid* # pid_n = (pid % num_pid_in_group) ...
true
true
f773a419531031c45cc85a2f2bdac4f5bc825d95
585
py
Python
src/temptest.py
ASH1998/SuZu
d925b54d990d2dee75e60bb26adb57afd089b4a5
[ "Apache-2.0" ]
2
2019-10-02T07:18:59.000Z
2019-10-02T07:19:43.000Z
src/temptest.py
ASH1998/SuZu
d925b54d990d2dee75e60bb26adb57afd089b4a5
[ "Apache-2.0" ]
null
null
null
src/temptest.py
ASH1998/SuZu
d925b54d990d2dee75e60bb26adb57afd089b4a5
[ "Apache-2.0" ]
null
null
null
from pynput import keyboard import time def on_press(key): try: print('alphanumeric key {0} pressed'.format( key.char)) except AttributeError: print('special key {0} pressed'.format( key)) def on_release(key): print('{0} released'.format( key)) if key == keyboard.Key.esc: # Stop listener return Fa...
17.727273
46
0.700855
from pynput import keyboard import time def on_press(key): try: print('alphanumeric key {0} pressed'.format( key.char)) except AttributeError: print('special key {0} pressed'.format( key)) def on_release(key): print('{0} released'.format( key)) if key == keyboard.Key.esc: return False with keyboa...
true
true
f773a61b3249b2220a0ede04a28624c825ec0ef1
716
py
Python
src/manage.py
mobilecoinofficial/mobot
4872e4308beb5305d88dcace94394aaa251f65e1
[ "MIT" ]
6
2021-07-28T13:49:16.000Z
2022-02-16T22:08:03.000Z
src/manage.py
mobilecoinofficial/mobot
4872e4308beb5305d88dcace94394aaa251f65e1
[ "MIT" ]
10
2021-08-18T15:18:34.000Z
2021-09-27T21:40:24.000Z
mobot/manage.py
sugargoat/mobot-1
407ac7fa477a1274bacc718c3080d94c35d40d5c
[ "MIT" ]
3
2021-07-28T01:17:06.000Z
2021-09-20T21:19:50.000Z
# Copyright (c) 2021 MobileCoin. All rights reserved. #!/usr/bin/env python """Django's command-line utility for administrative tasks.""" import os import sys def main(): """Run administrative tasks.""" os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mobot.settings') try: from django.core.manage...
28.64
73
0.682961
import os import sys def main(): os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mobot.settings') try: from django.core.management import execute_from_command_line except ImportError as exc: raise ImportError( "Couldn't import Django. Are you sure it's installed and " ...
true
true
f773a749ddc11bc5ce379f01338c7758f7972b2e
5,414
py
Python
tests/test_tobor_full.py
happyCoderJDFJJ/pyrfuniverse
8ddb6e0d8f113015ba820a327388a528a8b215c7
[ "Apache-2.0" ]
null
null
null
tests/test_tobor_full.py
happyCoderJDFJJ/pyrfuniverse
8ddb6e0d8f113015ba820a327388a528a8b215c7
[ "Apache-2.0" ]
null
null
null
tests/test_tobor_full.py
happyCoderJDFJJ/pyrfuniverse
8ddb6e0d8f113015ba820a327388a528a8b215c7
[ "Apache-2.0" ]
null
null
null
from pyrfuniverse.envs import RFUniverseBaseEnv from pyrfuniverse.utils import RFUniverseToborController import pybullet as p import math class FullToborEnv(RFUniverseBaseEnv): def __init__(self, executable_file=None): super().__init__( executable_file=executable_file, camera_chann...
26.028846
97
0.557628
from pyrfuniverse.envs import RFUniverseBaseEnv from pyrfuniverse.utils import RFUniverseToborController import pybullet as p import math class FullToborEnv(RFUniverseBaseEnv): def __init__(self, executable_file=None): super().__init__( executable_file=executable_file, camera_chann...
true
true
f773a7d10f264e9bda6e4ff1b40cfa2e4ce5430f
1,785
py
Python
base/mapreducer.py
elsigh/browserscope
f0b3670d4692742d5f2e6cf605bce9b1a4b8ca1b
[ "Apache-2.0" ]
22
2015-10-26T15:20:37.000Z
2022-03-11T06:38:17.000Z
base/mapreducer.py
IIKovalenko/browserscope
f0b3670d4692742d5f2e6cf605bce9b1a4b8ca1b
[ "Apache-2.0" ]
10
2016-01-22T18:46:19.000Z
2019-07-19T12:49:51.000Z
base/mapreducer.py
IIKovalenko/browserscope
f0b3670d4692742d5f2e6cf605bce9b1a4b8ca1b
[ "Apache-2.0" ]
12
2015-10-17T09:40:44.000Z
2019-06-08T19:54:36.000Z
#!/usr/bin/python2.5 # # Copyright 2009 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
28.790323
74
0.731653
__author__ = 'elsigh@google.com (Lindsey Simon)' from base import shardedcounter from mapreduce import operation as op from google.appengine.ext import db def ResultParentCountSet(entity): shardedcounter.increment(entity.category) def UserTestBeaconCount(entity): entity.beacon_count = int( shardedcoun...
true
true
f773a8d15e566378c347f0fb171abb54047bfeb7
796
py
Python
examples/rpc_async.py
marconfus/slixmpp
bcf186f42dc31d360e0a0af8a4b3aaf1e0b212aa
[ "BSD-3-Clause" ]
null
null
null
examples/rpc_async.py
marconfus/slixmpp
bcf186f42dc31d360e0a0af8a4b3aaf1e0b212aa
[ "BSD-3-Clause" ]
1
2021-02-24T07:58:40.000Z
2021-02-24T07:58:40.000Z
examples/rpc_async.py
marconfus/slixmpp
bcf186f42dc31d360e0a0af8a4b3aaf1e0b212aa
[ "BSD-3-Clause" ]
null
null
null
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Slixmpp: The Slick XMPP Library Copyright (C) 2011 Dann Martens This file is part of Slixmpp. See the file LICENSE for copying permission. """ from slixmpp.plugins.xep_0009.remote import Endpoint, remote, Remote, \ ANY_ALL, Future import time c...
16.583333
71
0.644472
""" Slixmpp: The Slick XMPP Library Copyright (C) 2011 Dann Martens This file is part of Slixmpp. See the file LICENSE for copying permission. """ from slixmpp.plugins.xep_0009.remote import Endpoint, remote, Remote, \ ANY_ALL, Future import time class Boomerang(Endpoint): def FQN(self): ...
false
true
f773a95dd57b5e097d9a47fe29b5d62627ea83bf
34,812
py
Python
tests/test_torch_agent.py
jasonleeinf/ParlAI
1f7f6d5b7481195b0214e835bb5d782db768d71c
[ "MIT" ]
1
2020-07-21T14:47:48.000Z
2020-07-21T14:47:48.000Z
tests/test_torch_agent.py
jasonleeinf/ParlAI
1f7f6d5b7481195b0214e835bb5d782db768d71c
[ "MIT" ]
null
null
null
tests/test_torch_agent.py
jasonleeinf/ParlAI
1f7f6d5b7481195b0214e835bb5d782db768d71c
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import unittest from parlai.core.agents import Agent from collections import deque SKIP_TESTS = False try: from pa...
42.557457
83
0.558543
import unittest from parlai.core.agents import Agent from collections import deque SKIP_TESTS = False try: from parlai.core.torch_agent import TorchAgent, Output import torch except ImportError: SKIP_TESTS = True class MockDict(Agent): null_token = '__null__' NULL_IDX = 0 start_token = '_...
true
true
f773ab491d9522be542283fd7275cdb52ce2c3ab
3,061
py
Python
kivytest_version2_12_windows/kivy/garden/__init__.py
Absimpl/Abstream
24585bf48e69ca5df62c4c1ba22de5190b7f8423
[ "MIT" ]
317
2015-07-30T07:47:41.000Z
2022-03-30T00:38:39.000Z
kivytest_version2_12_windows/kivy/garden/__init__.py
Absimpl/Abstream
24585bf48e69ca5df62c4c1ba22de5190b7f8423
[ "MIT" ]
42
2015-07-30T10:32:46.000Z
2021-11-23T02:44:47.000Z
kivytest_version2_12_windows/kivy/garden/__init__.py
Absimpl/Abstream
24585bf48e69ca5df62c4c1ba22de5190b7f8423
[ "MIT" ]
69
2015-08-04T03:27:30.000Z
2021-12-27T09:53:26.000Z
''' Garden ====== .. versionadded:: 1.7.0 .. versionchanged:: 1.8.0 Garden is a project to centralize addons for Kivy maintained by users. You can find more information at `Kivy Garden <http://kivy-garden.github.io/>`_. All the garden packages are centralized on the `kivy-garden Github <https://github.com/kivy-garde...
27.827273
79
0.691604
__path__ = 'kivy.garden' import sys import imp from os.path import dirname, join, realpath, exists, abspath from kivy import kivy_home_dir import kivy garden_system_dir = join(kivy_home_dir, 'garden') garden_kivy_dir = abspath(join(dirname(kivy.__file__), 'garden')) if getattr(sys, 'frozen', False) and getattr(sys,...
true
true
f773ac07dcc95077ace2aceb6fa85e792f4493fa
2,140
py
Python
tools/pnnx/tests/test_F_avg_pool1d.py
CeasarLee/ncnn
178825d14a16c4059820d9f054a8d857df671027
[ "BSD-3-Clause" ]
null
null
null
tools/pnnx/tests/test_F_avg_pool1d.py
CeasarLee/ncnn
178825d14a16c4059820d9f054a8d857df671027
[ "BSD-3-Clause" ]
null
null
null
tools/pnnx/tests/test_F_avg_pool1d.py
CeasarLee/ncnn
178825d14a16c4059820d9f054a8d857df671027
[ "BSD-3-Clause" ]
null
null
null
# Tencent is pleased to support the open source community by making ncnn available. # # Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. # # Licensed under the BSD 3-Clause License (the "License"); you may not use this file except # in compliance with the License. You may obtain a copy o...
35.081967
107
0.674766
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super(Model, self).__init__() def forward(self, x): x = F.avg_pool1d(x, kernel_size=3) x = F.avg_pool1d(x, kernel_size=4, stride=2, padding=2) x = F.avg_p...
true
true
f773ac47105b1b376f22d372ec34901dbf726f79
7,024
py
Python
ogr/factory.py
shepherdjay/ogr
87bc55d3f013a1b4c09695ecfaf6706f739f1890
[ "MIT" ]
10
2021-02-03T13:50:01.000Z
2021-12-09T00:04:53.000Z
ogr/factory.py
shepherdjay/ogr
87bc55d3f013a1b4c09695ecfaf6706f739f1890
[ "MIT" ]
280
2020-08-03T09:07:46.000Z
2022-03-31T13:44:04.000Z
ogr/factory.py
shepherdjay/ogr
87bc55d3f013a1b4c09695ecfaf6706f739f1890
[ "MIT" ]
15
2020-08-03T09:05:01.000Z
2022-02-16T12:12:43.000Z
# Copyright Contributors to the Packit project. # SPDX-License-Identifier: MIT import functools from typing import Dict, Type, Optional, Set, Iterable from ogr.abstract import GitService, GitProject from ogr.exceptions import OgrException from ogr.parsing import parse_git_repo _SERVICE_MAPPING: Dict[str, Type[GitSer...
30.406926
82
0.631264
import functools from typing import Dict, Type, Optional, Set, Iterable from ogr.abstract import GitService, GitProject from ogr.exceptions import OgrException from ogr.parsing import parse_git_repo _SERVICE_MAPPING: Dict[str, Type[GitService]] = {} def use_for_service(service: str, _func=None): def decorator...
true
true
f773ace3b58507dbc24a246b45707fceeb8809df
415
py
Python
.history/py/UserInput_20201230130313.py
minefarmer/Comprehensive-Python
f97b9b83ec328fc4e4815607e6a65de90bb8de66
[ "Unlicense" ]
null
null
null
.history/py/UserInput_20201230130313.py
minefarmer/Comprehensive-Python
f97b9b83ec328fc4e4815607e6a65de90bb8de66
[ "Unlicense" ]
null
null
null
.history/py/UserInput_20201230130313.py
minefarmer/Comprehensive-Python
f97b9b83ec328fc4e4815607e6a65de90bb8de66
[ "Unlicense" ]
null
null
null
# person = input("Enter your name: ") # Carl # print("Hello ", person) # Hello Carl # x = input("Enter a number: ") # 8 # y = input("Enter another number: ") # 7 # z = x + y # print(z) # 87 ## this was the result of concatenation person = input("Enter your name: ") # Rich print("Hello ", person) x = input...
21.842105
58
0.580723
person = input("Enter your name: ") print("Hello ", person) x = input("Enter a number: ") y = input("Enter another number: ") z = print(int(x) +int(y))
true
true
f773ad906a3258d6be6edc9cd7b5807310f7e788
139
py
Python
back-end/curso-em-video/python3/Mundo I/Desafios/1F - (Deixando Tudo Pronto).py
gustavocamalionti/cursos-e-linguagens
615db91aff13db5678a783aac69df11231c925e8
[ "MIT" ]
null
null
null
back-end/curso-em-video/python3/Mundo I/Desafios/1F - (Deixando Tudo Pronto).py
gustavocamalionti/cursos-e-linguagens
615db91aff13db5678a783aac69df11231c925e8
[ "MIT" ]
null
null
null
back-end/curso-em-video/python3/Mundo I/Desafios/1F - (Deixando Tudo Pronto).py
gustavocamalionti/cursos-e-linguagens
615db91aff13db5678a783aac69df11231c925e8
[ "MIT" ]
null
null
null
#Desafio 001: Crie um programa que escreva "Olá, Mundo!" na tela. import colorama colorama.init() print('\033[30;47mHello, World!\033[m ')
27.8
65
0.726619
import colorama colorama.init() print('\033[30;47mHello, World!\033[m ')
true
true
f773ade148532804b558d369322393ae281ee80f
89
py
Python
app/members/apps.py
mooja/ssip3
d42daee2b3b9d692a1fda4163bc6f0c6e970b79b
[ "MIT" ]
9
2019-03-24T21:56:52.000Z
2022-03-14T04:21:48.000Z
app/members/apps.py
mooja/ssip3
d42daee2b3b9d692a1fda4163bc6f0c6e970b79b
[ "MIT" ]
189
2018-07-22T19:42:05.000Z
2021-05-24T21:37:48.000Z
app/members/apps.py
mooja/ssip3
d42daee2b3b9d692a1fda4163bc6f0c6e970b79b
[ "MIT" ]
31
2021-09-30T19:49:54.000Z
2021-10-05T17:32:42.000Z
from django.apps import AppConfig class MembersConfig(AppConfig): name = 'members'
14.833333
33
0.752809
from django.apps import AppConfig class MembersConfig(AppConfig): name = 'members'
true
true
f773ae110a1d04b9fa24b332cb99ab7c75b7d020
3,084
py
Python
lib/flowbber/plugins/aggregators/expander.py
eduar-m/flowbber
f150911d35beecf8f23348e56f06b9133d13171a
[ "Apache-2.0" ]
1
2018-08-21T13:14:47.000Z
2018-08-21T13:14:47.000Z
lib/flowbber/plugins/aggregators/expander.py
eduar-m/flowbber
f150911d35beecf8f23348e56f06b9133d13171a
[ "Apache-2.0" ]
13
2017-09-15T01:14:18.000Z
2020-06-09T21:20:09.000Z
lib/flowbber/plugins/aggregators/expander.py
eduar-m/flowbber
f150911d35beecf8f23348e56f06b9133d13171a
[ "Apache-2.0" ]
6
2017-10-04T16:49:24.000Z
2019-07-03T20:38:23.000Z
# -*- coding: utf-8 -*- # # Copyright (C) 2017-2018 KuraLabs S.R.L # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
20.025974
72
0.530804
from flowbber.logging import get_logger from flowbber.components import Aggregator log = get_logger(__name__) class ExpanderAggregator(Aggregator): def declare_config(self, config): config.add_option( 'key', optional=False, schema={ 'type': 'string',...
true
true
f773ae743246aed017e61480e94e0b9c6f93e878
1,075
py
Python
code/density.py
rmit-ir/al-ef
abffe57ae171cd846ca29b5e1b5a9f337c948912
[ "Apache-2.0" ]
1
2017-08-31T15:54:55.000Z
2017-08-31T15:54:55.000Z
code/density.py
rmit-ir/al-ef
abffe57ae171cd846ca29b5e1b5a9f337c948912
[ "Apache-2.0" ]
null
null
null
code/density.py
rmit-ir/al-ef
abffe57ae171cd846ca29b5e1b5a9f337c948912
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python import numpy def jaccquard_similarity(a, b): if len(b) == 0 or len(a) == 0: return 0.0 return len(set(a).intersection(b))*1./len(set(a).union(set(b))) def similarityMatrix(features): a = numpy.zeros((len(features), len(features)), dtype=numpy.float) ids = list(fe...
25.595238
67
0.587907
import numpy def jaccquard_similarity(a, b): if len(b) == 0 or len(a) == 0: return 0.0 return len(set(a).intersection(b))*1./len(set(a).union(set(b))) def similarityMatrix(features): a = numpy.zeros((len(features), len(features)), dtype=numpy.float) ids = list(features.keys()) id2ro...
true
true
f773afea4c5a78c749d23a40f7c3bf8c20dfb802
13,483
py
Python
taming/modules/transformer/mingpt.py
adeptflax/image2image
8c7c531176d261789f90a27125b31d6241bc9c27
[ "MIT" ]
4
2021-06-17T15:44:38.000Z
2022-02-19T00:55:49.000Z
taming/modules/transformer/mingpt.py
adeptflax/image2image
8c7c531176d261789f90a27125b31d6241bc9c27
[ "MIT" ]
null
null
null
taming/modules/transformer/mingpt.py
adeptflax/image2image
8c7c531176d261789f90a27125b31d6241bc9c27
[ "MIT" ]
null
null
null
""" taken from: https://github.com/karpathy/minGPT/ GPT model: - the initial stem consists of a combination of token encoding and a positional encoding - the meat of it is a uniform sequence of Transformer blocks - each Transformer is a sequential combination of a 1-hidden-layer MLP block and a self-attention block...
39.309038
107
0.607877
import math import logging import torch import torch.nn as nn from torch.nn import functional as F logger = logging.getLogger(__name__) class GPTConfig: embd_pdrop = 0.1 resid_pdrop = 0.1 attn_pdrop = 0.1 def __init__(self, vocab_size, block_size, **kwargs): self.vocab_size = vocab_size ...
true
true
f773b0394ac6c80bbfde4ce0f89bd36543a44e87
14,035
py
Python
sdk/python/pulumi_aws/ec2/get_subnet.py
alexbowers/pulumi-aws
7dbdb03b1e4f7c0d51d5b5d17233ff4465c3eff5
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
sdk/python/pulumi_aws/ec2/get_subnet.py
alexbowers/pulumi-aws
7dbdb03b1e4f7c0d51d5b5d17233ff4465c3eff5
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
sdk/python/pulumi_aws/ec2/get_subnet.py
alexbowers/pulumi-aws
7dbdb03b1e4f7c0d51d5b5d17233ff4465c3eff5
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** 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...
42.274096
447
0.687139
import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import _utilities from . import outputs from ._inputs import * __all__ = [ 'GetSubnetResult', 'AwaitableGetSubnetResult', 'get_subnet', ] @pulumi.output_type class GetSubnetRes...
true
true
f773b0abe32f090f62aee81689c1e85998798503
364
py
Python
tests/test_add_contact.py
mihushynmaksym/PythonTrainingV2
7be62d5578035d39035e60faa4e1fa8f67d77beb
[ "Apache-2.0" ]
null
null
null
tests/test_add_contact.py
mihushynmaksym/PythonTrainingV2
7be62d5578035d39035e60faa4e1fa8f67d77beb
[ "Apache-2.0" ]
null
null
null
tests/test_add_contact.py
mihushynmaksym/PythonTrainingV2
7be62d5578035d39035e60faa4e1fa8f67d77beb
[ "Apache-2.0" ]
null
null
null
from model.contact import Contact def test_create_new_contact(app, db, json_contact): contact = json_contact old_contacts = db.get_contact_list() app.contact.create(contact) new_contacts = db.get_contact_list() old_contacts.append(contact) assert sorted(old_contacts, key=Contact.id_or_max) == ...
33.090909
101
0.766484
from model.contact import Contact def test_create_new_contact(app, db, json_contact): contact = json_contact old_contacts = db.get_contact_list() app.contact.create(contact) new_contacts = db.get_contact_list() old_contacts.append(contact) assert sorted(old_contacts, key=Contact.id_or_max) == ...
true
true
f773b13e3101da6d593701bdd2eab389aa38f11e
1,613
py
Python
xlsxwriter/test/comparison/test_chart_legend02.py
shareablee/XlsxWriter
3cfcbe18fbc4526158ffbb5e7bb5227f78e3f5f9
[ "BSD-2-Clause-FreeBSD" ]
null
null
null
xlsxwriter/test/comparison/test_chart_legend02.py
shareablee/XlsxWriter
3cfcbe18fbc4526158ffbb5e7bb5227f78e3f5f9
[ "BSD-2-Clause-FreeBSD" ]
null
null
null
xlsxwriter/test/comparison/test_chart_legend02.py
shareablee/XlsxWriter
3cfcbe18fbc4526158ffbb5e7bb5227f78e3f5f9
[ "BSD-2-Clause-FreeBSD" ]
null
null
null
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org # from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTest): """...
26.442623
79
0.568506
from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTest): def setUp(self): self.maxDiff = None filename = 'chart_legend01.xlsx' test_dir = 'xlsxwriter/test/comparison/' self.got_filename = test_dir ...
true
true
f773b148b2addcb35ccf8f83e9e2ee817fc3e234
51,544
py
Python
src/transformers/modeling_xlm.py
12190143/transformers
6faca88ee0c472de8207e648b0999a1ee01ff127
[ "Apache-2.0" ]
480
2019-10-14T02:22:34.000Z
2022-03-29T18:07:00.000Z
src/transformers/modeling_xlm.py
hmason/transformers
ab90353f1abfd15f8d21f99395658d060679a08c
[ "Apache-2.0" ]
20
2019-10-15T16:18:05.000Z
2022-02-27T21:23:55.000Z
src/transformers/modeling_xlm.py
hmason/transformers
ab90353f1abfd15f8d21f99395658d060679a08c
[ "Apache-2.0" ]
42
2019-10-14T21:29:59.000Z
2021-12-28T15:25:58.000Z
# coding=utf-8 # Copyright 2019-present, Facebook, Inc and the HuggingFace Inc. team. # # 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 # # Un...
45.939394
197
0.643373
import itertools import logging import math import numpy as np import torch from torch import nn from torch.nn import CrossEntropyLoss, MSELoss from torch.nn import functional as F from .activations import gelu from .configuration_xlm import XLMConfig from .file_utils import add_start_docstrings, add_start_docstrin...
true
true
f773b152a09e3730a4d6dba80a0effb49da90e95
230
py
Python
leadmanager/leads/serialiazers.py
abbasKareem/Lead-Manager
9fcf1deda29a5cafd0705997bbf7515b129e3411
[ "MIT" ]
null
null
null
leadmanager/leads/serialiazers.py
abbasKareem/Lead-Manager
9fcf1deda29a5cafd0705997bbf7515b129e3411
[ "MIT" ]
null
null
null
leadmanager/leads/serialiazers.py
abbasKareem/Lead-Manager
9fcf1deda29a5cafd0705997bbf7515b129e3411
[ "MIT" ]
null
null
null
from rest_framework import serializers from .models import Lead class LeadSerializer(serializers.ModelSerializer): class Meta: model = Lead fields = ('id', 'name', 'email', 'message', 'created_at')
20.909091
65
0.66087
from rest_framework import serializers from .models import Lead class LeadSerializer(serializers.ModelSerializer): class Meta: model = Lead fields = ('id', 'name', 'email', 'message', 'created_at')
true
true
f773b16c451db6b99c1cdd54e7508ed9c9ccbb07
621
py
Python
3. BEGAN (Boundary Equilibrium GAN)/celeba.py
hee9joon/Face-Generation
caa9b4e0bb61e77ee6d32fc8687bad63f998ec9c
[ "MIT" ]
14
2020-10-06T11:58:02.000Z
2022-02-21T13:20:32.000Z
6. VAE-GAN (Variational Autoencoder GAN)/celeba.py
ShambhaviCodes/Face-Generation
caa9b4e0bb61e77ee6d32fc8687bad63f998ec9c
[ "MIT" ]
null
null
null
6. VAE-GAN (Variational Autoencoder GAN)/celeba.py
ShambhaviCodes/Face-Generation
caa9b4e0bb61e77ee6d32fc8687bad63f998ec9c
[ "MIT" ]
4
2021-03-07T06:47:23.000Z
2021-11-27T06:01:58.000Z
from torch.utils.data import DataLoader from torchvision.datasets import ImageFolder import torchvision.transforms as transforms from config import * def get_celeba_loader(path, batch_size): """CelebA Loader""" transform = transforms.Compose([ transforms.Resize((config.crop_size, config.crop_size)), ...
32.684211
99
0.731079
from torch.utils.data import DataLoader from torchvision.datasets import ImageFolder import torchvision.transforms as transforms from config import * def get_celeba_loader(path, batch_size): transform = transforms.Compose([ transforms.Resize((config.crop_size, config.crop_size)), transforms.ToTen...
true
true
f773b20520c3973ee2423370347adeaa0333dee2
315
py
Python
tests/application/conftest.py
gramhagen/obeya
cc0f2ea48d4014c2da5de094a32cf84f64bb274d
[ "Apache-2.0" ]
8
2017-01-03T08:49:26.000Z
2017-05-23T18:25:05.000Z
tests/application/conftest.py
gramhagen/obeya
cc0f2ea48d4014c2da5de094a32cf84f64bb274d
[ "Apache-2.0" ]
null
null
null
tests/application/conftest.py
gramhagen/obeya
cc0f2ea48d4014c2da5de094a32cf84f64bb274d
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- """Pytest setup """ import pytest from application.app_factory import build_app from application.models import db @pytest.yield_fixture(scope="session") def app(): """Flask application fixture """ _app = build_app(env='test') db.create_all() yield _app db.drop_all()
18.529412
45
0.679365
import pytest from application.app_factory import build_app from application.models import db @pytest.yield_fixture(scope="session") def app(): _app = build_app(env='test') db.create_all() yield _app db.drop_all()
true
true
f773b22d94b86b49fda67880c972365906a36757
37
py
Python
src/remember/domain/exceptions.py
thebe111/remember
a802ea158ee03fcde496fa2ac80bf414540fe4fa
[ "MIT" ]
null
null
null
src/remember/domain/exceptions.py
thebe111/remember
a802ea158ee03fcde496fa2ac80bf414540fe4fa
[ "MIT" ]
null
null
null
src/remember/domain/exceptions.py
thebe111/remember
a802ea158ee03fcde496fa2ac80bf414540fe4fa
[ "MIT" ]
null
null
null
class StoreError(Exception): ...
12.333333
28
0.648649
class StoreError(Exception): ...
true
true
f773b4a48e2419643039e656d7000765c9a9402c
5,211
py
Python
python/cugraph/graph/test_graph.py
raydouglass/cugraph
228a4e1abc95b9b15ab211d9e397cc61913275e5
[ "Apache-2.0" ]
null
null
null
python/cugraph/graph/test_graph.py
raydouglass/cugraph
228a4e1abc95b9b15ab211d9e397cc61913275e5
[ "Apache-2.0" ]
null
null
null
python/cugraph/graph/test_graph.py
raydouglass/cugraph
228a4e1abc95b9b15ab211d9e397cc61913275e5
[ "Apache-2.0" ]
null
null
null
# Copyright (c) 2019, NVIDIA CORPORATION. # 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 i...
31.391566
78
0.674343
import numpy as np import pytest from scipy.io import mmread import cugraph import cudf def read_mtx_file(mm_file): print('Reading ' + str(mm_file) + '...') return mmread(mm_file).asfptype() def compare_series(series_1, series_2): if (len(series_1) != len(series_2)): print("Series do not match...
true
true
f773b4e99cbd01ed23ea380527bd3033cf35866d
4,511
py
Python
src/gausskernel/dbmind/tools/anomaly_detection/detector/service/detection_app.py
Yanci0/openGauss-server
b2ff10be1367c77f2fda396d6c12ffa3c25874c7
[ "MulanPSL-1.0" ]
360
2020-06-30T14:47:34.000Z
2022-03-31T15:21:53.000Z
src/gausskernel/dbmind/tools/anomaly_detection/detector/service/detection_app.py
Yanci0/openGauss-server
b2ff10be1367c77f2fda396d6c12ffa3c25874c7
[ "MulanPSL-1.0" ]
4
2020-06-30T15:09:16.000Z
2020-07-14T06:20:03.000Z
src/gausskernel/dbmind/tools/anomaly_detection/detector/service/detection_app.py
futurewei-cloud/chogori-opengauss
f43410e1643c887819e718d9baceb9e853ad9574
[ "MulanPSL-1.0" ]
133
2020-06-30T14:47:36.000Z
2022-03-25T15:29:00.000Z
""" Copyright (c) 2020 Huawei Technologies Co.,Ltd. openGauss is licensed under Mulan PSL v2. You can use this software according to the terms and conditions of the Mulan PSL v2. You may obtain a copy of Mulan PSL v2 at: http://license.coscl.org.cn/MulanPSL2 THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WI...
37.907563
116
0.633784
import logging import os import re from flask import Flask from flask_restful import Api import config import global_vars from cert import get_server_ssl_context from .app import App from .resource import receiver service_logger = logging.getLogger('service') def check_params(): if not config.has_section('data...
true
true
f773b55f3ad67bff714c058f4151f9a0e994a750
1,504
py
Python
sdl2/_sdl_init.py
py-sdl/py-sdl2
38ba051a39b86ccd2c5a95125c8d7cfea3ddb691
[ "CC0-1.0" ]
12
2022-02-10T17:04:08.000Z
2022-03-30T21:05:12.000Z
sdl2/_sdl_init.py
py-sdl/py-sdl2
38ba051a39b86ccd2c5a95125c8d7cfea3ddb691
[ "CC0-1.0" ]
4
2022-02-08T14:16:24.000Z
2022-03-18T01:32:00.000Z
sdl2/_sdl_init.py
py-sdl/py-sdl2
38ba051a39b86ccd2c5a95125c8d7cfea3ddb691
[ "CC0-1.0" ]
1
2022-03-21T22:23:34.000Z
2022-03-21T22:23:34.000Z
from ctypes import c_int from .dll import _bind, SDLFunc, AttributeDict from .stdinc import Uint32 __all__ = [ # Constants "SDL_INIT_TIMER", "SDL_INIT_AUDIO", "SDL_INIT_VIDEO", "SDL_INIT_JOYSTICK", "SDL_INIT_HAPTIC", "SDL_INIT_GAMECONTROLLER", "SDL_INIT_EVENTS", "SDL_INIT_SENSOR", "SDL_INIT_NOPARACHUTE...
28.923077
78
0.761303
from ctypes import c_int from .dll import _bind, SDLFunc, AttributeDict from .stdinc import Uint32 __all__ = [ "SDL_INIT_TIMER", "SDL_INIT_AUDIO", "SDL_INIT_VIDEO", "SDL_INIT_JOYSTICK", "SDL_INIT_HAPTIC", "SDL_INIT_GAMECONTROLLER", "SDL_INIT_EVENTS", "SDL_INIT_SENSOR", "SDL_INIT_NOPARACHUTE", "SDL_INIT...
true
true
f773b600c0c0907547fed3d3d2821dbaf040cb5d
2,411
py
Python
qa/rpc-tests/sigma_zapwalletmints.py
ConsulTent/firo
c8f28bf3afe4ec29463a5facf3feed762e2d9133
[ "MIT" ]
582
2016-09-26T00:08:04.000Z
2020-10-25T19:07:24.000Z
qa/rpc-tests/sigma_zapwalletmints.py
ConsulTent/firo
c8f28bf3afe4ec29463a5facf3feed762e2d9133
[ "MIT" ]
570
2016-09-28T07:29:53.000Z
2020-10-26T10:24:19.000Z
qa/rpc-tests/sigma_zapwalletmints.py
ConsulTent/firo
c8f28bf3afe4ec29463a5facf3feed762e2d9133
[ "MIT" ]
409
2016-09-21T12:37:31.000Z
2020-10-18T14:54:17.000Z
#!/usr/bin/env python3 import time from decimal import * from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * #`zapwalletmints` conf setting test case # Description: `zapwalletmints` configuration setting was added. What this does is clears the WalletDB of HD mints # (ne...
32.146667
114
0.667773
import time from decimal import * from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * class SigmaZapWalletMintsTest(BitcoinTestFramework): def __init__(self): super().__init__() self.num_nodes = 4 self.setup_clean_chain = False def setup_...
true
true
f773b7a78bde2c30d0bc3a59eb69dbe157939b3f
542
py
Python
logactivity/migrations/0002_auto_20180122_1424.py
lovingawareness/parature-search
482e7bd6ceaf0f66b41ab2a5bda680e9eaa23693
[ "Apache-2.0" ]
null
null
null
logactivity/migrations/0002_auto_20180122_1424.py
lovingawareness/parature-search
482e7bd6ceaf0f66b41ab2a5bda680e9eaa23693
[ "Apache-2.0" ]
15
2017-11-30T04:10:52.000Z
2018-08-01T14:29:27.000Z
logactivity/migrations/0002_auto_20180122_1424.py
tothebeat/parature-search
482e7bd6ceaf0f66b41ab2a5bda680e9eaa23693
[ "Apache-2.0" ]
null
null
null
# Generated by Django 2.0 on 2018-01-22 20:24 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('logactivity', '0001_initial'), ] operations = [ migrations.AddField( model_name='record', name='query_string', ...
22.583333
58
0.577491
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('logactivity', '0001_initial'), ] operations = [ migrations.AddField( model_name='record', name='query_string', field=models.TextField(null=True), ...
true
true
f773b806b0a9576e6eb1f38510f4aa9c0913dcc5
3,161
py
Python
data_fetcher/downloader.py
sarthak25/Predictive-Business-Modelling-using-LSTM
b8e2b047efc8cffbd9b726394d543b0ed4314daa
[ "MIT" ]
2
2020-07-27T03:37:31.000Z
2020-08-18T11:46:07.000Z
data_fetcher/downloader.py
sarthak25/Predictive-Business-Modelling-using-LSTM
b8e2b047efc8cffbd9b726394d543b0ed4314daa
[ "MIT" ]
null
null
null
data_fetcher/downloader.py
sarthak25/Predictive-Business-Modelling-using-LSTM
b8e2b047efc8cffbd9b726394d543b0ed4314daa
[ "MIT" ]
null
null
null
# To make print working for Python2/3 from __future__ import print_function # Use six to import urllib so it is working for Python2/3 from six.moves import urllib # If you don't want to use six, please comment out the line above # and use the line below instead (for Python3 only). #import urllib.request, urllib.parse...
30.104762
100
0.706738
from __future__ import print_function from six.moves import urllib # and use the line below instead (for Python3 only). #import urllib.request, urllib.parse, urllib.error import time # Build the cookie handler cookier = urllib.request.HTTPCookieProcessor() opener = urllib.request.build_opener(cookier) urllib.reque...
true
true
f773b80e332ac7ee79e4cf17cf611df0fbfe61cd
4,102
py
Python
tests/test_s3copy.py
lsst-sqre/ltd-conveyor
713cdd3325a45a96261eea07933df3ce37998d85
[ "MIT" ]
null
null
null
tests/test_s3copy.py
lsst-sqre/ltd-conveyor
713cdd3325a45a96261eea07933df3ce37998d85
[ "MIT" ]
8
2017-02-02T21:50:24.000Z
2022-03-11T18:45:43.000Z
tests/test_s3copy.py
lsst-sqre/ltd-conveyor
713cdd3325a45a96261eea07933df3ce37998d85
[ "MIT" ]
null
null
null
"""Tests for s3copy. These tests required the following environment variables: ``LTD_TEST_AWS_ID`` AWS access key ID ``LTD_TEST_AWS_SECRET`` AWS secret access key ``LTD_TEST_BUCKET`` Name of an S3 bucket that already exists and can be used for testing. The tests will be skipped if they are not availabl...
27.904762
74
0.645051
from __future__ import annotations import os import uuid from typing import TYPE_CHECKING import boto3 import pytest from ltdconveyor.s3 import copy_dir, delete_dir from ltdconveyor.testutils import upload_test_files if TYPE_CHECKING: from _pytest.fixtures import FixtureRequest @pytest.mark.skipif( os.ge...
true
true
f773b824e13da80d823d7555ec7c7dcd89ac63bd
1,265
py
Python
tests/unit/manager/default/test_notification_wrapper.py
satroutr/poppy
27417f86854d9e0a04726acc263ef0a2ce9f8f6e
[ "Apache-2.0" ]
3
2017-07-05T20:09:59.000Z
2018-11-27T22:02:57.000Z
tests/unit/manager/default/test_notification_wrapper.py
satroutr/poppy
27417f86854d9e0a04726acc263ef0a2ce9f8f6e
[ "Apache-2.0" ]
24
2017-04-18T15:14:04.000Z
2019-03-20T19:09:07.000Z
tests/unit/manager/default/test_notification_wrapper.py
satroutr/poppy
27417f86854d9e0a04726acc263ef0a2ce9f8f6e
[ "Apache-2.0" ]
8
2017-04-03T13:24:27.000Z
2021-11-08T20:28:10.000Z
# Copyright (c) 2015 Rackspace, 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 wr...
34.189189
76
0.690119
import mock from poppy.manager.base import notifications from tests.unit import base class TestProviderWrapper(base.TestCase): def setUp(self): super(TestProviderWrapper, self).setUp() self.notifications_wrapper_obj = notifications.NotificationWrapper() def test_create(self): mock_...
true
true
f773b872647ebb96eedab8aa77c562b88b115a19
485
py
Python
_modules/datetimeutil.py
picturae/salt-modules
99e4432b2368009927f3460d4d6ee2e103c12319
[ "Apache-2.0" ]
null
null
null
_modules/datetimeutil.py
picturae/salt-modules
99e4432b2368009927f3460d4d6ee2e103c12319
[ "Apache-2.0" ]
null
null
null
_modules/datetimeutil.py
picturae/salt-modules
99e4432b2368009927f3460d4d6ee2e103c12319
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- ''' The datetime utility module provides functions to gather date and time information ''' from datetime import datetime def strftime(format=''): '''Return a string representing the date and time, controlled by an explicit format string. For a complete list of formatting directives, s...
24.25
85
0.701031
from datetime import datetime def strftime(format=''): output = datetime.now().strftime(format) return output
true
true
f773b8dc4351dd8846d4301dc0d9da9cddd6a6e8
12,172
py
Python
pyasn1_modules/rfc4211.py
inexio/pyasn1-modules
13b84f74541ec442037273ddf8ba62bbba2cd974
[ "BSD-2-Clause" ]
2
2020-12-29T07:13:05.000Z
2021-02-07T15:32:26.000Z
pyasn1_modules/rfc4211.py
inexio/pyasn1-modules
13b84f74541ec442037273ddf8ba62bbba2cd974
[ "BSD-2-Clause" ]
3
2020-12-22T23:21:43.000Z
2021-04-06T16:24:39.000Z
pyasn1_modules/rfc4211.py
inexio/pyasn1-modules
13b84f74541ec442037273ddf8ba62bbba2cd974
[ "BSD-2-Clause" ]
1
2021-01-17T17:45:03.000Z
2021-01-17T17:45:03.000Z
# coding: utf-8 # # This file is part of pyasn1-modules software. # # Created by Stanisław Pitucha with asn1ate tool. # Modified by Russ Housley to add support for opentypes. # Copyright (c) 2005-2020, Ilya Etingof <etingof@gmail.com> # License: http://snmplabs.com/pyasn1/license.html # # Internet X.509 Public Key Infr...
30.582915
130
0.725353
from pyasn1.type import char from pyasn1.type import constraint from pyasn1.type import namedtype from pyasn1.type import namedval from pyasn1.type import tag from pyasn1.type import univ from pyasn1_modules import rfc5280 from pyasn1_modules import rfc5652 MAX = float('inf') def _buildOid(*components): output ...
true
true
f773b908458c9b5698d01dbdb68426b23ae2f736
5,416
py
Python
gym_electric_motor/visualization/motor_dashboard_plots/state_plot.py
54hanxiucao/gym-electric-motor
911432388b00675e8a93f4a7937fdc575f106f22
[ "MIT" ]
1
2021-03-29T07:47:32.000Z
2021-03-29T07:47:32.000Z
gym_electric_motor/visualization/motor_dashboard_plots/state_plot.py
54hanxiucao/gym-electric-motor
911432388b00675e8a93f4a7937fdc575f106f22
[ "MIT" ]
null
null
null
gym_electric_motor/visualization/motor_dashboard_plots/state_plot.py
54hanxiucao/gym-electric-motor
911432388b00675e8a93f4a7937fdc575f106f22
[ "MIT" ]
null
null
null
import numpy as np from .base_plots import TimePlot class StatePlot(TimePlot): """Plot to display the environments states and their references.""" _default_limit_line_cfg = { 'color': 'red', 'linestyle': '--', 'linewidth': 1 } # Labels for each state variable. state_labe...
37.351724
115
0.598597
import numpy as np from .base_plots import TimePlot class StatePlot(TimePlot): _default_limit_line_cfg = { 'color': 'red', 'linestyle': '--', 'linewidth': 1 } state_labels = { 'omega': r'$\omega$/(1/s)', 'torque': '$T$/Nm', 'i': '$i$/A', 'i_a'...
true
true
f773bb18fe2f088d7f2d471087066e2c7489ea04
6,582
py
Python
site_tracker/tracker/serializers.py
paganism/tracker
31cc88a695a7c44875b91635383366feb9cdb08d
[ "MIT" ]
null
null
null
site_tracker/tracker/serializers.py
paganism/tracker
31cc88a695a7c44875b91635383366feb9cdb08d
[ "MIT" ]
3
2020-06-28T10:58:22.000Z
2021-04-08T20:43:46.000Z
site_tracker/tracker/serializers.py
paganism/tracker
31cc88a695a7c44875b91635383366feb9cdb08d
[ "MIT" ]
null
null
null
from rest_framework import serializers from .models import Issue, Status, Priority, Project, Tracker, Comment from users.models import CustomUser class UserSerializer(serializers.ModelSerializer): class Meta: model = CustomUser fields = ('pk', 'username', 'first_name', 'email', 'last_name', 'is_ac...
34.825397
84
0.670009
from rest_framework import serializers from .models import Issue, Status, Priority, Project, Tracker, Comment from users.models import CustomUser class UserSerializer(serializers.ModelSerializer): class Meta: model = CustomUser fields = ('pk', 'username', 'first_name', 'email', 'last_name', 'is_ac...
true
true
f773bca241b9f45ccf1ef59af1b6d415c77b170b
253
py
Python
calender/calender/doctype/stars_name/stars_name.py
bahaaabed/AumAlqura
9d12d7917225d9e82b4a480c3bc8f7acf8edab77
[ "MIT" ]
null
null
null
calender/calender/doctype/stars_name/stars_name.py
bahaaabed/AumAlqura
9d12d7917225d9e82b4a480c3bc8f7acf8edab77
[ "MIT" ]
null
null
null
calender/calender/doctype/stars_name/stars_name.py
bahaaabed/AumAlqura
9d12d7917225d9e82b4a480c3bc8f7acf8edab77
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # Copyright (c) 2022, bahaa and contributors # For license information, please see license.txt from __future__ import unicode_literals # import frappe from frappe.model.document import Document class StarsName(Document): pass
23
49
0.770751
from __future__ import unicode_literals from frappe.model.document import Document class StarsName(Document): pass
true
true
f773bd428c930b5bf2af06ec4c0019f85fe5126e
1,949
py
Python
src/mnist_fully_network/mnist_practice/mnist_data_info.py
belivem/Study
7e4633b988985735100f2ddd17ae62b8348dbb8e
[ "Apache-2.0" ]
null
null
null
src/mnist_fully_network/mnist_practice/mnist_data_info.py
belivem/Study
7e4633b988985735100f2ddd17ae62b8348dbb8e
[ "Apache-2.0" ]
null
null
null
src/mnist_fully_network/mnist_practice/mnist_data_info.py
belivem/Study
7e4633b988985735100f2ddd17ae62b8348dbb8e
[ "Apache-2.0" ]
null
null
null
import os import sys import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data mnist_path = "/Users/liyanan/Documents/Test/Tensorflow/data/mnist_data/" #print mnist data def mnistInfo(): batch_size = 100 #read mnist data mnist = input_data.read_data_sets(mnist_path,one_hot =...
27.842857
113
0.673679
import os import sys import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data mnist_path = "/Users/liyanan/Documents/Test/Tensorflow/data/mnist_data/" def mnistInfo(): batch_size = 100 mnist = input_data.read_data_sets(mnist_path,one_hot = True) print("Training dat...
true
true
f773bd9e61e87dbcc3eaef1687e787cce1456f1f
29
py
Python
test3/bao.py
hetuvsluoshu/private
a3eb8f4149820af896ea34d619ea8946059ebd1b
[ "MIT" ]
null
null
null
test3/bao.py
hetuvsluoshu/private
a3eb8f4149820af896ea34d619ea8946059ebd1b
[ "MIT" ]
null
null
null
test3/bao.py
hetuvsluoshu/private
a3eb8f4149820af896ea34d619ea8946059ebd1b
[ "MIT" ]
null
null
null
jdiasfdsafdaknbm dsa fd sa
4.142857
16
0.793103
jdiasfdsafdaknbm dsa fd sa
true
true
f773be585de7b796721e7425097ef5eff9fbe1ab
1,737
py
Python
scanpy/tests/test_binary.py
gamazeps/scanpy
a1949935dc4b45b64ddad1a53c2a7679395cf2ed
[ "BSD-3-Clause" ]
1
2019-07-05T18:49:06.000Z
2019-07-05T18:49:06.000Z
scanpy/tests/test_binary.py
gamazeps/scanpy
a1949935dc4b45b64ddad1a53c2a7679395cf2ed
[ "BSD-3-Clause" ]
null
null
null
scanpy/tests/test_binary.py
gamazeps/scanpy
a1949935dc4b45b64ddad1a53c2a7679395cf2ed
[ "BSD-3-Clause" ]
null
null
null
import os import re from pathlib import Path from subprocess import PIPE from typing import List import pytest from _pytest.capture import CaptureFixture from _pytest.monkeypatch import MonkeyPatch import scanpy from scanpy.cli import main HERE = Path(__file__).parent @pytest.fixture def set_path(monkeypatch: Mon...
30.473684
115
0.699482
import os import re from pathlib import Path from subprocess import PIPE from typing import List import pytest from _pytest.capture import CaptureFixture from _pytest.monkeypatch import MonkeyPatch import scanpy from scanpy.cli import main HERE = Path(__file__).parent @pytest.fixture def set_path(monkeypatch: Mon...
true
true
f773c0878c14148fcb597b1d14127b339f752dba
254
py
Python
version.py
FlippingBinary/wqxlib-python
5aa1d41384928f1faca47d5984485e2efa93174c
[ "MIT" ]
null
null
null
version.py
FlippingBinary/wqxlib-python
5aa1d41384928f1faca47d5984485e2efa93174c
[ "MIT" ]
null
null
null
version.py
FlippingBinary/wqxlib-python
5aa1d41384928f1faca47d5984485e2efa93174c
[ "MIT" ]
null
null
null
# WQX API version wqx_v = "3.0" # Major version: breaking changes major_v = "0" # Minor version: new features minor_v = "6" # Patch version: bug fixes / no interface changes patch_v = "0" __version__ = f"{wqx_v}.{major_v}.{minor_v}.{patch_v}"
23.090909
55
0.669291
wqx_v = "3.0" major_v = "0" minor_v = "6" patch_v = "0" __version__ = f"{wqx_v}.{major_v}.{minor_v}.{patch_v}"
true
true
f773c0d14ff4754812ad5f36b8cf8c3322b3dfc0
26,683
py
Python
src/sentry/migrations/0097_auto__del_affecteduserbygroup__del_unique_affecteduserbygroup_project_.py
NickPresta/sentry
ed3e6034ef560e18f392ba30071de860557b7b43
[ "BSD-3-Clause" ]
2
2015-10-14T12:45:32.000Z
2016-01-27T03:24:43.000Z
src/sentry/migrations/0097_auto__del_affecteduserbygroup__del_unique_affecteduserbygroup_project_.py
NickPresta/sentry
ed3e6034ef560e18f392ba30071de860557b7b43
[ "BSD-3-Clause" ]
null
null
null
src/sentry/migrations/0097_auto__del_affecteduserbygroup__del_unique_affecteduserbygroup_project_.py
NickPresta/sentry
ed3e6034ef560e18f392ba30071de860557b7b43
[ "BSD-3-Clause" ]
null
null
null
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Removing unique constraint on 'TrackedUser', fields ['project', 'ident'] db.delete_unique('sentry_trackedu...
82.354938
223
0.560732
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): db.delete_unique('sentry_trackeduser', ['project_id', 'ident']) db.delete_unique('sentry_affecteduserbygroup', ['pr...
true
true
f773c1e84d9745343c4b06778f2f9ebae7b325bf
815
py
Python
code/send_query_client_func.py
DvaMishkiLapa/diplom_se_2019
b6f95d10b8dd76f4b402b11bb448b88572624473
[ "Apache-2.0" ]
null
null
null
code/send_query_client_func.py
DvaMishkiLapa/diplom_se_2019
b6f95d10b8dd76f4b402b11bb448b88572624473
[ "Apache-2.0" ]
null
null
null
code/send_query_client_func.py
DvaMishkiLapa/diplom_se_2019
b6f95d10b8dd76f4b402b11bb448b88572624473
[ "Apache-2.0" ]
null
null
null
def send_query(self, args): data = json.dumps({"requests": args, 'token': self.token}) try: response = requests.post(host, data=data).json() except requests.exceptions.ConnectionError: return False try: if response['error_code'] == 403: self.authorization(self.user, s...
37.045455
70
0.596319
def send_query(self, args): data = json.dumps({"requests": args, 'token': self.token}) try: response = requests.post(host, data=data).json() except requests.exceptions.ConnectionError: return False try: if response['error_code'] == 403: self.authorization(self.user, s...
true
true
f773c2491da79aa249c3611498fbfbc4cd96fe7c
1,749
py
Python
didcomm/secrets/secrets_resolver.py
alex-polosky/didcomm-python
955866024c9f6191df9c5a898cc77e1979781eae
[ "Apache-2.0" ]
8
2021-09-04T19:28:18.000Z
2021-12-22T16:00:18.000Z
didcomm/secrets/secrets_resolver.py
alex-polosky/didcomm-python
955866024c9f6191df9c5a898cc77e1979781eae
[ "Apache-2.0" ]
4
2021-07-27T23:44:33.000Z
2021-10-13T13:29:39.000Z
didcomm/secrets/secrets_resolver.py
alex-polosky/didcomm-python
955866024c9f6191df9c5a898cc77e1979781eae
[ "Apache-2.0" ]
7
2021-07-22T08:19:13.000Z
2022-01-04T14:46:38.000Z
from abc import ABC, abstractmethod from dataclasses import dataclass from typing import List, Optional from didcomm.common.types import DID_URL, VerificationMethodType, VerificationMaterial @dataclass class Secret: """ A secret (private key) abstraction. Attributes: kid (str): a key ID identify...
34.294118
153
0.69068
from abc import ABC, abstractmethod from dataclasses import dataclass from typing import List, Optional from didcomm.common.types import DID_URL, VerificationMethodType, VerificationMaterial @dataclass class Secret: kid: DID_URL type: VerificationMethodType verification_material: VerificationMaterial ...
true
true
f773c2a45f0b88c3d820ed4f7a4354b85a7125c6
5,883
py
Python
threedi_modelchecker/threedi_database.py
nens/threedi-modelchecker
028d0c5847532526d3e1cb6ba3dd6a6d7494d648
[ "MIT" ]
null
null
null
threedi_modelchecker/threedi_database.py
nens/threedi-modelchecker
028d0c5847532526d3e1cb6ba3dd6a6d7494d648
[ "MIT" ]
88
2019-08-08T12:23:15.000Z
2022-03-28T09:45:14.000Z
threedi_modelchecker/threedi_database.py
nens/threedi-modelchecker
028d0c5847532526d3e1cb6ba3dd6a6d7494d648
[ "MIT" ]
null
null
null
from contextlib import contextmanager from pathlib import Path from sqlalchemy import create_engine from sqlalchemy import event from sqlalchemy.engine import Engine from sqlalchemy.event import listen from sqlalchemy.orm import sessionmaker import shutil import sqlite3 import tempfile __all__ = ["ThreediDatabase"] ...
35.017857
107
0.620432
from contextlib import contextmanager from pathlib import Path from sqlalchemy import create_engine from sqlalchemy import event from sqlalchemy.engine import Engine from sqlalchemy.event import listen from sqlalchemy.orm import sessionmaker import shutil import sqlite3 import tempfile __all__ = ["ThreediDatabase"] ...
true
true
f773c30eacc42df3384e7edda049419c0e3a7e37
61,497
py
Python
tensorflow/python/kernel_tests/cwise_ops_test.py
filippovitale/tensorflow
fe9b5008ff63a70e4092cdc7968b1327a9470f77
[ "Apache-2.0" ]
null
null
null
tensorflow/python/kernel_tests/cwise_ops_test.py
filippovitale/tensorflow
fe9b5008ff63a70e4092cdc7968b1327a9470f77
[ "Apache-2.0" ]
null
null
null
tensorflow/python/kernel_tests/cwise_ops_test.py
filippovitale/tensorflow
fe9b5008ff63a70e4092cdc7968b1327a9470f77
[ "Apache-2.0" ]
1
2018-10-11T21:47:03.000Z
2018-10-11T21:47:03.000Z
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
37.361482
95
0.584711
from __future__ import absolute_import from __future__ import division from __future__ import print_function import math import numpy as np import tensorflow as tf _ADD = lambda x, y: x + y _SUB = lambda x, y: x - y _MUL = lambda x, y: x * y _POW = lambda x, y: x ** y _TRUEDIV = lambda x, y: x / y _FLOORDIV = lamb...
true
true
f773c3d0ca9d5af12e0c858b43f75b720d75667d
1,014
py
Python
pythonsdl2/power/build.py
broughtong/Python-SDL2
65d44e6641866e72e89adca60211ebc72fd6fadf
[ "Zlib" ]
null
null
null
pythonsdl2/power/build.py
broughtong/Python-SDL2
65d44e6641866e72e89adca60211ebc72fd6fadf
[ "Zlib" ]
null
null
null
pythonsdl2/power/build.py
broughtong/Python-SDL2
65d44e6641866e72e89adca60211ebc72fd6fadf
[ "Zlib" ]
null
null
null
from cffi import FFI ffibuilder = FFI() # cdef() expects a single string declaring the C types, functions and # globals needed to use the shared object. It must be in valid C syntax. ffibuilder.cdef(""" typedef enum { SDL_POWERSTATE_UNKNOWN, /**< cannot determine power status */ SDL_POWERSTATE_ON_BATTERY...
32.709677
79
0.715976
from cffi import FFI ffibuilder = FFI() ffibuilder.cdef(""" typedef enum { SDL_POWERSTATE_UNKNOWN, /**< cannot determine power status */ SDL_POWERSTATE_ON_BATTERY, /**< Not plugged in, running on the battery */ SDL_POWERSTATE_NO_BATTERY, /**< Plugged in, no battery available */ SDL_POWERSTATE...
true
true
f773c48617dc6aab0ea515133698a4bb05528d8a
10,028
py
Python
data/data.py
carboncoo/UNITER
dfe007c2cea55430a847fd1cf318e88ae8ffe88f
[ "MIT" ]
612
2020-01-28T00:34:23.000Z
2022-03-31T00:40:06.000Z
data/data.py
carboncoo/UNITER
dfe007c2cea55430a847fd1cf318e88ae8ffe88f
[ "MIT" ]
90
2020-02-18T10:54:40.000Z
2022-03-17T07:36:35.000Z
data/data.py
carboncoo/UNITER
dfe007c2cea55430a847fd1cf318e88ae8ffe88f
[ "MIT" ]
114
2020-01-31T03:03:25.000Z
2022-03-17T15:53:51.000Z
""" Copyright (c) Microsoft Corporation. Licensed under the MIT license. Dataset interfaces """ from collections import defaultdict from contextlib import contextmanager import io import json from os.path import exists import numpy as np import torch from torch.utils.data import Dataset, ConcatDataset import horovod....
32.038339
78
0.572497
from collections import defaultdict from contextlib import contextmanager import io import json from os.path import exists import numpy as np import torch from torch.utils.data import Dataset, ConcatDataset import horovod.torch as hvd from tqdm import tqdm import lmdb from lz4.frame import compress, decompress import...
true
true
f773c6cf2774fe612cefbefdc2c58c78cd5c7a4f
1,954
py
Python
renku/cli/_git.py
jsam/renku-python
37730aa497724860b691ea2a3bd3e3d5993d1a93
[ "Apache-2.0" ]
2
2019-03-09T17:56:57.000Z
2019-07-03T15:20:22.000Z
renku/cli/_git.py
jsam/renku-python
37730aa497724860b691ea2a3bd3e3d5993d1a93
[ "Apache-2.0" ]
null
null
null
renku/cli/_git.py
jsam/renku-python
37730aa497724860b691ea2a3bd3e3d5993d1a93
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- # # Copyright 2017-2018 - Swiss Data Science Center (SDSC) # A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and # Eidgenössische Technische Hochschule Zürich (ETHZ). # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in c...
31.015873
75
0.718526
import click GIT_KEY = 'renku.git' GIT_ISOLATION = 'renku.worktree' def set_git_home(value): ctx = click.get_current_context() ctx.meta[GIT_KEY] = value def get_git_home(path='.'): ctx = click.get_current_context(silent=True) if ctx and GIT_KEY in ctx.meta: return ctx.meta[GIT_KEY] fr...
true
true
f773c7514fb880bf6098e82a07f0283634f6b147
418
py
Python
examples/standalone_hook.py
zynga-jpetersen/detect-secrets-server
e9f60d683d816d02d740f25fa1799a2a755c9cb3
[ "Apache-2.0" ]
110
2018-04-13T02:41:40.000Z
2021-11-08T10:29:57.000Z
examples/standalone_hook.py
zynga-jpetersen/detect-secrets-server
e9f60d683d816d02d740f25fa1799a2a755c9cb3
[ "Apache-2.0" ]
50
2018-08-21T10:36:06.000Z
2021-04-13T00:42:05.000Z
examples/standalone_hook.py
zynga-jpetersen/detect-secrets-server
e9f60d683d816d02d740f25fa1799a2a755c9cb3
[ "Apache-2.0" ]
40
2018-07-06T22:03:38.000Z
2021-09-09T16:21:32.000Z
#!/usr/bin/env python3.6 """ This is an example bare-bone script that you can use as an argument for setting up an output hook. >>> $ detect-secrets-server scan yelp/detect-secrets ... --output-hook examples/standalone_hook.py """ import json import sys def main(): print('repo:', sys.argv[1]) print(json....
20.9
72
0.684211
import json import sys def main(): print('repo:', sys.argv[1]) print(json.dumps(json.loads(sys.argv[2]), indent=2, sort_keys=True)) if __name__ == '__main__': main()
true
true
f773c7c2cc51c19ba595e45515db548e2e39ee9e
2,944
py
Python
util_base/data_list_oracle.py
wm-bupt/STSN-for-oracle-recognition
f220aec0ba93d48231a228001f2c380c72304d06
[ "Apache-2.0" ]
null
null
null
util_base/data_list_oracle.py
wm-bupt/STSN-for-oracle-recognition
f220aec0ba93d48231a228001f2c380c72304d06
[ "Apache-2.0" ]
null
null
null
util_base/data_list_oracle.py
wm-bupt/STSN-for-oracle-recognition
f220aec0ba93d48231a228001f2c380c72304d06
[ "Apache-2.0" ]
null
null
null
#from __future__ import print_function, division import torch import numpy as np import random from PIL import Image from torch.utils.data import Dataset import os import os.path def make_dataset(image_list, labels): if labels: len_ = len(image_list) images = [(image_list[i].strip(), labe...
33.078652
105
0.58288
import torch import numpy as np import random from PIL import Image from torch.utils.data import Dataset import os import os.path def make_dataset(image_list, labels): if labels: len_ = len(image_list) images = [(image_list[i].strip(), labels[i, :]) for i in range(len_)] else: ...
true
true
f773c95e9462c89b06552f3f7fdd8fab7310d090
6,409
py
Python
core/tests/test_qm.py
Kumbong/Quine_Mccluskey_python
5f431e2f6ce8518d720332fb2b3e45bb85caab87
[ "MIT" ]
29
2019-06-14T17:50:35.000Z
2021-09-04T12:29:36.000Z
core/tests/test_qm.py
Kumbong/Quine_Mccluskey_python
5f431e2f6ce8518d720332fb2b3e45bb85caab87
[ "MIT" ]
5
2019-06-17T15:04:30.000Z
2019-07-13T23:54:09.000Z
core/tests/test_qm.py
Kumbong/Quine_Mccluskey_python
5f431e2f6ce8518d720332fb2b3e45bb85caab87
[ "MIT" ]
16
2019-06-24T22:48:21.000Z
2021-05-04T04:36:11.000Z
from unittest import TestCase, main from core.qm.qm import QM class TestQM(TestCase): def setup(self): pass def test_convert_binary(self): #test if the strings are the actual binary representations #for each of the strings minterms = [1,2,3,4,5,6,15] qm = QM(m...
37.046243
154
0.587143
from unittest import TestCase, main from core.qm.qm import QM class TestQM(TestCase): def setup(self): pass def test_convert_binary(self): minterms = [1,2,3,4,5,6,15] qm = QM(minterms) conversion = qm.to_binary(minterms) expected_conversion = [...
true
true
f773c9f13861c594de7439bfb7132ce92e9c516b
39,530
py
Python
openstack/tests/unit/cloud/test_create_server.py
gouthampacha/openstacksdk
f4dd6fe5fd21fb866b43330ecbbafee5cf553ded
[ "Apache-2.0" ]
null
null
null
openstack/tests/unit/cloud/test_create_server.py
gouthampacha/openstacksdk
f4dd6fe5fd21fb866b43330ecbbafee5cf553ded
[ "Apache-2.0" ]
null
null
null
openstack/tests/unit/cloud/test_create_server.py
gouthampacha/openstacksdk
f4dd6fe5fd21fb866b43330ecbbafee5cf553ded
[ "Apache-2.0" ]
null
null
null
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
41.048806
78
0.475613
import base64 from unittest import mock import uuid from openstack import connection from openstack.cloud import exc from openstack.cloud import meta from openstack.tests import fakes from openstack.tests.unit import base class TestCreateServer(base.TestCase): def test_create_server_with_get_exception(self): ...
true
true
f773ca8e6498b0c71abc38d18cb96cefcd477378
10,631
py
Python
electroncash/utils/macos.py
christroutner/Electron-Cash
d5217ed3e878bd56977181f022f9e5c43f449241
[ "MIT" ]
208
2017-07-25T19:52:15.000Z
2018-09-21T13:44:58.000Z
electroncash/utils/macos.py
christroutner/Electron-Cash
d5217ed3e878bd56977181f022f9e5c43f449241
[ "MIT" ]
1,478
2018-09-24T09:30:13.000Z
2022-03-29T15:48:17.000Z
electroncash/utils/macos.py
christroutner/Electron-Cash
d5217ed3e878bd56977181f022f9e5c43f449241
[ "MIT" ]
159
2018-09-24T12:56:47.000Z
2022-03-28T23:52:17.000Z
#!/usr/bin/env python3 # # macos.py - utility functions, mainly functions that call into CoreFoundation # and Foundation # # Copyright © 2018 Alexander Schlarb # Copyright © 2019 Calin Culianu <calin.culianu@gmail.com> # # License: MIT import sys if sys.platform != 'darwin': raise ImportError("This file can only...
43.929752
196
0.743956
import sys if sys.platform != 'darwin': raise ImportError("This file can only be used on macOS or iOS") from ctypes import (cdll, c_bool, c_char, c_ubyte, c_uint, c_void_p, c_char_p, c_ssize_t, POINTER, util, cast, create_string_buffer, sizeof, Structure, byref) from enum ...
true
true
f773cb0a8af8db0ffcb78c4d4ee7246f22df5dc4
1,005
py
Python
qiskit/providers/basicaer/__init__.py
biplab37/qiskit-aakash
e10b204887606f1f75bdfde182bb0c6d0a322c68
[ "Apache-2.0" ]
22
2019-08-15T04:39:15.000Z
2022-03-06T05:17:04.000Z
qiskit/providers/basicaer/__init__.py
biplab37/qiskit-aakash
e10b204887606f1f75bdfde182bb0c6d0a322c68
[ "Apache-2.0" ]
2
2020-10-26T07:12:12.000Z
2021-12-09T16:22:51.000Z
qiskit/providers/basicaer/__init__.py
biplab37/qiskit-aakash
e10b204887606f1f75bdfde182bb0c6d0a322c68
[ "Apache-2.0" ]
9
2019-09-05T05:33:00.000Z
2021-10-09T16:04:53.000Z
# -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2017, 2018. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any...
37.222222
77
0.79005
from .basicaerprovider import BasicAerProvider from .basicaerjob import BasicAerJob from .qasm_simulator import QasmSimulatorPy from .dm_simulator import DmSimulatorPy from .statevector_simulator import StatevectorSimulatorPy from .unitary_simulator import UnitarySimulatorPy from .exceptions import BasicAerError Ba...
true
true
f773cbfc92edde954d20f0aebf448bbbc36ac20f
1,591
py
Python
Algorithms_easy/1165. Single-Row Keyboard.py
VinceW0/Leetcode_Python_solutions
09e9720afce21632372431606ebec4129eb79734
[ "Xnet", "X11" ]
4
2020-08-11T20:45:15.000Z
2021-03-12T00:33:34.000Z
Algorithms_easy/1165. Single-Row Keyboard.py
VinceW0/Leetcode_Python_solutions
09e9720afce21632372431606ebec4129eb79734
[ "Xnet", "X11" ]
null
null
null
Algorithms_easy/1165. Single-Row Keyboard.py
VinceW0/Leetcode_Python_solutions
09e9720afce21632372431606ebec4129eb79734
[ "Xnet", "X11" ]
null
null
null
""" 1165. Single-Row Keyboard Easy There is a special keyboard with all keys in a single row. Given a string keyboard of length 26 indicating the layout of the keyboard (indexed from 0 to 25), initially your finger is at index 0. To type a character, you have to move your finger to the index of the desired character....
31.82
295
0.650534
class Solution: def calculateTime(self, keyboard: str, word: str) -> int: cur_idx, res = 0, 0 for w in word: nxt_idx = keyboard.index(w) res += abs(nxt_idx - cur_idx) cur_idx = nxt_idx return res class Solution: def calculateTime(self, keyboard: str,...
true
true
f773cc3114de1045642d5f3e9df1809735b09f73
1,290
py
Python
caffe2/python/helpers/nonlinearity.py
shigengtian/caffe2
e19489d6acd17fea8ca98cd8e4b5b680e23a93c5
[ "Apache-2.0" ]
40
2021-06-01T07:37:59.000Z
2022-03-25T01:42:09.000Z
caffe2/python/helpers/nonlinearity.py
shigengtian/caffe2
e19489d6acd17fea8ca98cd8e4b5b680e23a93c5
[ "Apache-2.0" ]
14
2021-06-01T11:52:46.000Z
2022-03-25T02:13:08.000Z
caffe2/python/helpers/nonlinearity.py
shigengtian/caffe2
e19489d6acd17fea8ca98cd8e4b5b680e23a93c5
[ "Apache-2.0" ]
7
2021-07-20T19:34:26.000Z
2022-03-13T21:07:36.000Z
## @package nonlinearity # Module caffe2.python.helpers.nonlinearity from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from caffe2.python import core def prelu(model, blob_in, blob_out, num_channels=1, slope_init=None,...
29.318182
76
0.653488
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from caffe2.python import core def prelu(model, blob_in, blob_out, num_channels=1, slope_init=None, **kwargs): slope_init = ( slope_init if slope_...
true
true
f773cd1857af7ebab73de8639b335b4290625186
482
py
Python
cannlytics/lims/samples.py
mindthegrow/cannlytics
c266bc1169bef75214985901cd3165f415ad9ba7
[ "MIT" ]
7
2021-05-31T15:30:22.000Z
2022-02-05T14:12:31.000Z
cannlytics/lims/samples.py
mindthegrow/cannlytics
c266bc1169bef75214985901cd3165f415ad9ba7
[ "MIT" ]
17
2021-06-09T01:04:27.000Z
2022-03-18T14:48:12.000Z
cannlytics/lims/samples.py
mindthegrow/cannlytics
c266bc1169bef75214985901cd3165f415ad9ba7
[ "MIT" ]
5
2021-06-07T13:52:33.000Z
2021-08-04T00:09:39.000Z
""" Sample Management | Cannlytics Author: Keegan Skeate <keegan@cannlytics.com> Created: 6/23/2021 Updated: 6/23/2021 License: MIT License <https://opensource.org/licenses/MIT> Manage your laboratory samples. """ def get_sample_pictures(): """Get sample pictures taken and stored on a lab computer.""" ...
20.083333
65
0.688797
def get_sample_pictures(): return NotImplementedError if __name__ == '__main__': get_sample_pictures()
true
true
f773cdd9f020fd3bb88ad79e58edc8e204e90f8a
6,266
py
Python
ironic/drivers/modules/cimc/management.py
armohamm/ironic
21093ca886ed736a7a25bf5e71e05d41e132fd2f
[ "Apache-2.0" ]
2
2019-06-17T21:37:53.000Z
2020-07-11T03:58:39.000Z
ironic/drivers/modules/cimc/management.py
armohamm/ironic
21093ca886ed736a7a25bf5e71e05d41e132fd2f
[ "Apache-2.0" ]
5
2019-08-14T06:46:03.000Z
2021-12-13T20:01:25.000Z
ironic/drivers/modules/cimc/management.py
armohamm/ironic
21093ca886ed736a7a25bf5e71e05d41e132fd2f
[ "Apache-2.0" ]
6
2019-06-13T12:49:33.000Z
2021-04-17T16:33:19.000Z
# Copyright 2015, Cisco Systems. # # 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 wri...
37.076923
79
0.625758
from oslo_utils import importutils from ironic.common import boot_devices from ironic.common import exception from ironic.drivers import base from ironic.drivers.modules.cimc import common imcsdk = importutils.try_import('ImcSdk') CIMC_TO_IRONIC_BOOT_DEVICE = { 'storage-read-write': boot_devices.DISK, 'lan...
true
true
f773ce65d77ff3b4a85a117989a62bf03f0cd748
2,122
py
Python
aries_cloudagent/protocols/issue_credential/v1_0/handlers/credential_proposal_handler.py
euroledger/aries-cloudagent-python
caf457276b19df374c16c2890e1c7e4914f46254
[ "Apache-2.0" ]
null
null
null
aries_cloudagent/protocols/issue_credential/v1_0/handlers/credential_proposal_handler.py
euroledger/aries-cloudagent-python
caf457276b19df374c16c2890e1c7e4914f46254
[ "Apache-2.0" ]
null
null
null
aries_cloudagent/protocols/issue_credential/v1_0/handlers/credential_proposal_handler.py
euroledger/aries-cloudagent-python
caf457276b19df374c16c2890e1c7e4914f46254
[ "Apache-2.0" ]
null
null
null
"""Credential proposal message handler.""" from .....messaging.base_handler import ( BaseHandler, BaseResponder, HandlerException, RequestContext, ) from ..manager import CredentialManager from ..messages.credential_proposal import CredentialProposal from .....utils.tracing import trace_event, get_ti...
31.671642
87
0.653629
from .....messaging.base_handler import ( BaseHandler, BaseResponder, HandlerException, RequestContext, ) from ..manager import CredentialManager from ..messages.credential_proposal import CredentialProposal from .....utils.tracing import trace_event, get_timer class CredentialProposalHandler(BaseH...
true
true
f773ce7322efe5d5849550f425eb75c15f0efa00
1,868
py
Python
tests/functional/test_skip_on_spawning_platform.py
bdrung/pytest-skip-markers
69b9be27b1969a7b59666afefcb63bf1fdf66b31
[ "Apache-2.0" ]
null
null
null
tests/functional/test_skip_on_spawning_platform.py
bdrung/pytest-skip-markers
69b9be27b1969a7b59666afefcb63bf1fdf66b31
[ "Apache-2.0" ]
null
null
null
tests/functional/test_skip_on_spawning_platform.py
bdrung/pytest-skip-markers
69b9be27b1969a7b59666afefcb63bf1fdf66b31
[ "Apache-2.0" ]
null
null
null
# Copyright 2021-2022 VMware, Inc. # SPDX-License-Identifier: Apache-2.0 # """ Test the ``@pytest.mark.skip_on_spawning_platform`` marker. """ import sys from unittest import mock import pytest pytestmark = [ pytest.mark.skipif( sys.platform.startswith("win") and sys.version_info >= (3, 8) ...
27.470588
110
0.655782
import sys from unittest import mock import pytest pytestmark = [ pytest.mark.skipif( sys.platform.startswith("win") and sys.version_info >= (3, 8) and sys.version_info < (3, 10), reason="PyTest's capture and pytester.runpytest_inprocess looks broken on Windows and Py(>3.8,<3.10)",...
true
true
f773ce85c5fedcfec690cb26a560d202979b7253
3,949
py
Python
tests/test.py
flounderK/JobSearch
1c7f87e3a6d6bf6b8abf33e535f08c2622d0eb23
[ "MIT" ]
null
null
null
tests/test.py
flounderK/JobSearch
1c7f87e3a6d6bf6b8abf33e535f08c2622d0eb23
[ "MIT" ]
null
null
null
tests/test.py
flounderK/JobSearch
1c7f87e3a6d6bf6b8abf33e535f08c2622d0eb23
[ "MIT" ]
null
null
null
import unittest from context import patternScore search_regex = """[Pp]ython (?<![A-Za-z])[Ss]cript(s|ing)* [Ll][Ii][Nn][Uu][Xx] ([Jj][Aa][Vv][Aa](?![Ss])) (([Dd]ata|[Ii]nformation|[Cc]yber|[Nn]etwork)(.))*[Ss]ecurity (([Ss][Qq][Ll])|([Ss]tructured.[Qq]uery.[Ll]anguage)) [Dd]ev(elopment)*.{0,1}[Oo]p(s|erations) ([Bb][...
49.3625
1,371
0.773614
import unittest from context import patternScore search_regex = """[Pp]ython (?<![A-Za-z])[Ss]cript(s|ing)* [Ll][Ii][Nn][Uu][Xx] ([Jj][Aa][Vv][Aa](?![Ss])) (([Dd]ata|[Ii]nformation|[Cc]yber|[Nn]etwork)(.))*[Ss]ecurity (([Ss][Qq][Ll])|([Ss]tructured.[Qq]uery.[Ll]anguage)) [Dd]ev(elopment)*.{0,1}[Oo]p(s|erations) ([Bb][...
true
true
f773cf906d7770e9be12f16e0778011d03d4b203
2,144
py
Python
fatuv/handle.py
kasicass/fatuv
f1baf61ffffa5f753460fbdfadc7c079a3302d0d
[ "MIT" ]
6
2019-06-15T17:39:52.000Z
2020-01-13T09:07:18.000Z
fatuv/handle.py
kasicass/fatuv
f1baf61ffffa5f753460fbdfadc7c079a3302d0d
[ "MIT" ]
null
null
null
fatuv/handle.py
kasicass/fatuv
f1baf61ffffa5f753460fbdfadc7c079a3302d0d
[ "MIT" ]
3
2019-01-18T09:14:07.000Z
2020-04-03T09:19:13.000Z
from __future__ import print_function from _fatcore import ffi, lib from .error import HandleError from . import error from .internal import get_strerror from .loop import Loop uv_get_pyobj = lib.fatuv_get_pyobj uv_set_pyobj = lib.fatuv_set_pyobj uv_close = lib.fatuv_close uv_is_active = lib.fatuv_is_active u...
22.333333
64
0.737407
from __future__ import print_function from _fatcore import ffi, lib from .error import HandleError from . import error from .internal import get_strerror from .loop import Loop uv_get_pyobj = lib.fatuv_get_pyobj uv_set_pyobj = lib.fatuv_set_pyobj uv_close = lib.fatuv_close uv_is_active = lib.fatuv_is_active u...
true
true
f773cfc6009224178da262dbbedeca9bc0a3a21c
8,069
py
Python
process_data.py
jojonki/AttentionNetworks-for-QA
16f469c0719bf30c42695a1b4df6bbd84db8ea49
[ "Apache-2.0" ]
156
2017-11-25T08:01:26.000Z
2022-02-18T20:27:55.000Z
process_data.py
jojonki/AttentionNetworks-for-QA
16f469c0719bf30c42695a1b4df6bbd84db8ea49
[ "Apache-2.0" ]
9
2017-12-04T05:32:35.000Z
2021-11-15T15:46:30.000Z
process_data.py
jojonki/AttentionNetworks-for-QA
16f469c0719bf30c42695a1b4df6bbd84db8ea49
[ "Apache-2.0" ]
38
2017-12-25T08:34:06.000Z
2021-03-04T07:10:31.000Z
import os import numpy as np import json import pickle from nltk.tokenize import word_tokenize import random import torch from torch.autograd import Variable # TODO global NULL = "-NULL-" UNK = "-UNK-" ENT = "-ENT-" def save_pickle(d, path): print('save pickle to', path) with open(path, mode='wb') as f: ...
33.481328
145
0.565374
import os import numpy as np import json import pickle from nltk.tokenize import word_tokenize import random import torch from torch.autograd import Variable NULL = "-NULL-" UNK = "-UNK-" ENT = "-ENT-" def save_pickle(d, path): print('save pickle to', path) with open(path, mode='wb') as f: pickle.dum...
true
true
f773d13316456f0bf2b7bb8aed26db55948e4eb9
871
py
Python
test/test_air_quality_packet.py
ulfmagnetics/signage_air_quality
b5a01f29e019e531e0b79bc2df059675ffdeebc2
[ "MIT" ]
null
null
null
test/test_air_quality_packet.py
ulfmagnetics/signage_air_quality
b5a01f29e019e531e0b79bc2df059675ffdeebc2
[ "MIT" ]
null
null
null
test/test_air_quality_packet.py
ulfmagnetics/signage_air_quality
b5a01f29e019e531e0b79bc2df059675ffdeebc2
[ "MIT" ]
null
null
null
import time import unittest from signage_air_quality.air_quality_packet import AirQualityPacket class TestAirQualityPacket(unittest.TestCase): def test_to_bytes(self): now = time.strptime("Mon Jan 13 21:00:00 2020") timestamp = int(time.mktime(now)) packet = AirQualityPacket(56, 'O3', time...
34.84
67
0.669346
import time import unittest from signage_air_quality.air_quality_packet import AirQualityPacket class TestAirQualityPacket(unittest.TestCase): def test_to_bytes(self): now = time.strptime("Mon Jan 13 21:00:00 2020") timestamp = int(time.mktime(now)) packet = AirQualityPacket(56, 'O3', time...
true
true
f773d144bf2f53389ca367d6b9c6083b2d3a44eb
3,121
py
Python
position_fetcher.py
TUhybridlab/vj-servo-controller
685a93d4b0daddc847ae0177528c527e0d840cc3
[ "MIT" ]
null
null
null
position_fetcher.py
TUhybridlab/vj-servo-controller
685a93d4b0daddc847ae0177528c527e0d840cc3
[ "MIT" ]
null
null
null
position_fetcher.py
TUhybridlab/vj-servo-controller
685a93d4b0daddc847ae0177528c527e0d840cc3
[ "MIT" ]
null
null
null
import logging import logging.config import re from multiprocessing import Process, Queue from serial import Serial from serial.serialutil import SerialException # Serial communication with Arduino SERIAL_NAME = '/dev/ttyUSB0' SERIAL_BAUDRATE =115200 # Regex for a message REGEX_MSG = '^#[0-9]+ [0-9]$' MSG_TRUE = '1' ...
28.372727
94
0.600769
import logging import logging.config import re from multiprocessing import Process, Queue from serial import Serial from serial.serialutil import SerialException SERIAL_NAME = '/dev/ttyUSB0' SERIAL_BAUDRATE =115200 REGEX_MSG = '^#[0-9]+ [0-9]$' MSG_TRUE = '1' class FetchedPosition(object): def __init__(self, po...
true
true
f773d1c70f76605417402de0ff515cd43e8805f9
7,635
py
Python
compiler/testdata/expected/python.tornado/actual_base/f_BaseFoo.py
chrisgustavsen-wf/frugal
1140f5ff6a37b248e387d09a7779c7b25a4a92ee
[ "Apache-2.0" ]
null
null
null
compiler/testdata/expected/python.tornado/actual_base/f_BaseFoo.py
chrisgustavsen-wf/frugal
1140f5ff6a37b248e387d09a7779c7b25a4a92ee
[ "Apache-2.0" ]
null
null
null
compiler/testdata/expected/python.tornado/actual_base/f_BaseFoo.py
chrisgustavsen-wf/frugal
1140f5ff6a37b248e387d09a7779c7b25a4a92ee
[ "Apache-2.0" ]
null
null
null
# # Autogenerated by Frugal Compiler (3.14.1) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # from datetime import timedelta from threading import Lock import sys from frugal.exceptions import TApplicationExceptionType from frugal.exceptions import TTransportExceptionType from frugal.middlewa...
32.628205
192
0.634054
from datetime import timedelta from threading import Lock import sys from frugal.exceptions import TApplicationExceptionType from frugal.exceptions import TTransportExceptionType from frugal.middleware import Method from frugal.tornado.processor import FBaseProcessor from frugal.tornado.processor import FProcessorF...
false
true
f773d29d112a9cf109119a1097b18028376f8079
727
py
Python
zephyr/archive.py
doanac/ci-scripts
6f8d5f02e377835e6be621d4e13b045815af57b5
[ "Apache-2.0" ]
1
2020-12-05T19:59:01.000Z
2020-12-05T19:59:01.000Z
zephyr/archive.py
doanac/ci-scripts
6f8d5f02e377835e6be621d4e13b045815af57b5
[ "Apache-2.0" ]
84
2019-03-11T19:08:30.000Z
2022-03-22T01:54:44.000Z
zephyr/archive.py
doanac/ci-scripts
6f8d5f02e377835e6be621d4e13b045815af57b5
[ "Apache-2.0" ]
10
2019-02-06T18:13:12.000Z
2021-08-10T10:36:31.000Z
#!/usr/bin/python3 # Find all the zephyr build artifacts required for sanitycheck to be able # to run on another system and tgz them up. import os import tarfile ARCHIVE_FILES = ( 'build.ninja', 'CMakeCache.txt', '.config', 'zephyr.hex', 'generated_dts_board.conf', 'rules.ninja', ) def scan...
20.194444
73
0.61348
import os import tarfile ARCHIVE_FILES = ( 'build.ninja', 'CMakeCache.txt', '.config', 'zephyr.hex', 'generated_dts_board.conf', 'rules.ninja', ) def scantree(path): for entry in os.scandir(path): if entry.is_dir(follow_symlinks=False): yield from scantree(entry.path...
true
true
f773d2ca90c691ceb499e10eaa6688df02cb80a0
6,106
py
Python
qa/rpc-tests/proxy_test.py
ChiliCoinProject/ChiliCoin
d38fdef93eeba49464bb18047ab5d4ed061d78d9
[ "MIT" ]
null
null
null
qa/rpc-tests/proxy_test.py
ChiliCoinProject/ChiliCoin
d38fdef93eeba49464bb18047ab5d4ed061d78d9
[ "MIT" ]
null
null
null
qa/rpc-tests/proxy_test.py
ChiliCoinProject/ChiliCoin
d38fdef93eeba49464bb18047ab5d4ed061d78d9
[ "MIT" ]
null
null
null
#!/usr/bin/env python2 # Copyright (c) 2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. import socket import traceback, sys from binascii import hexlify import time, os from socks5 import Socks5Conf...
41.821918
145
0.653456
import socket import traceback, sys from binascii import hexlify import time, os from socks5 import Socks5Configuration, Socks5Command, Socks5Server, AddressType from test_framework import BitcoinTestFramework from util import * class ProxyTest(BitcoinTestFramework): def __init__(self): se...
true
true
f773d3d6e1305d476c05e95f6aa7d03b28f45070
23,035
py
Python
summary/sumy/sklearn/decomposition/pca.py
WangWenjun559/MITS
8d7ace2b3b2a58fb33af225c2997106d9402aaf5
[ "Apache-2.0" ]
6
2015-07-12T16:17:58.000Z
2017-06-23T04:00:43.000Z
summary/sumy/sklearn/decomposition/pca.py
WangWenjun559/MITS
8d7ace2b3b2a58fb33af225c2997106d9402aaf5
[ "Apache-2.0" ]
null
null
null
summary/sumy/sklearn/decomposition/pca.py
WangWenjun559/MITS
8d7ace2b3b2a58fb33af225c2997106d9402aaf5
[ "Apache-2.0" ]
4
2017-04-19T09:05:26.000Z
2020-05-20T21:54:25.000Z
""" Principal Component Analysis """ # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Olivier Grisel <olivier.grisel@ensta.org> # Mathieu Blondel <mathieu@mblondel.org> # Denis A. Engemann <d.engemann@fz-juelich.de> # Michael Eickenberg <michael.eickenberg@inria.fr> # # Lice...
33.627737
79
0.612199
from math import log, sqrt import numpy as np from scipy import linalg from scipy.special import gammaln from ..base import BaseEstimator, TransformerMixin from ..utils import check_random_state, as_float_array from ..utils import check_array from ..utils.extmath import fast_dot, fast_logdet, randomized_svd from .....
true
true
f773d40451c00585b23e066a18b948a3392f8788
1,088
py
Python
accounts/forms.py
sreekanth1990/djangoproject.com
69ab8573aadcc79e9da610ddad7b4e0c69a550d3
[ "BSD-3-Clause" ]
1,440
2015-01-05T13:06:12.000Z
2022-03-30T23:09:24.000Z
accounts/forms.py
sreekanth1990/djangoproject.com
69ab8573aadcc79e9da610ddad7b4e0c69a550d3
[ "BSD-3-Clause" ]
711
2015-01-01T19:42:33.000Z
2022-03-29T08:36:29.000Z
accounts/forms.py
sreekanth1990/djangoproject.com
69ab8573aadcc79e9da610ddad7b4e0c69a550d3
[ "BSD-3-Clause" ]
887
2015-01-01T03:17:20.000Z
2022-03-23T09:15:26.000Z
from django import forms from .models import Profile class ProfileForm(forms.ModelForm): """ A form for editing user profiles. Assumes that the Profile instance passed in has an associated User object. The view (see views.py) takes care of that. """ name = forms.CharField( required=F...
27.897436
83
0.606618
from django import forms from .models import Profile class ProfileForm(forms.ModelForm): name = forms.CharField( required=False, widget=forms.TextInput(attrs={'placeholder': 'Name'}) ) email = forms.EmailField( required=False, widget=forms.TextInput(attrs={'placeholder': '...
true
true
f773d474ac405829fc67b618ae6807fbf11a8b6b
8,513
py
Python
tests/base/test_directing.py
repsistance/keripy
655c5625b5593844c405e7da5d4b089153b64efb
[ "Apache-2.0" ]
null
null
null
tests/base/test_directing.py
repsistance/keripy
655c5625b5593844c405e7da5d4b089153b64efb
[ "Apache-2.0" ]
null
null
null
tests/base/test_directing.py
repsistance/keripy
655c5625b5593844c405e7da5d4b089153b64efb
[ "Apache-2.0" ]
null
null
null
# -*- encoding: utf-8 -*- """ tests.db.dbing module """ import logging import os from hio.base import doing from hio.core.tcp import clienting, serving from keri import help # logger support from keri.base import basing, keeping, directing from keri.core import eventing, coring from keri.db import dbing from keri....
37.337719
89
0.655233
import logging import os from hio.base import doing from hio.core.tcp import clienting, serving from keri import help from keri.base import basing, keeping, directing from keri.core import eventing, coring from keri.db import dbing from keri.demo import demoing def test_directing_basic(): help.ogler.resetLeve...
true
true
f773d481f837f453212375ce1a63921cd625d1c7
11,457
py
Python
debian/python-nova/usr/lib/python2.7/dist-packages/nova/api/openstack/compute/contrib/floating_ips.py
bopopescu/stacklab-nova
4ab1698659b663ef222255610d1a5c042706dd65
[ "Apache-2.0" ]
null
null
null
debian/python-nova/usr/lib/python2.7/dist-packages/nova/api/openstack/compute/contrib/floating_ips.py
bopopescu/stacklab-nova
4ab1698659b663ef222255610d1a5c042706dd65
[ "Apache-2.0" ]
null
null
null
debian/python-nova/usr/lib/python2.7/dist-packages/nova/api/openstack/compute/contrib/floating_ips.py
bopopescu/stacklab-nova
4ab1698659b663ef222255610d1a5c042706dd65
[ "Apache-2.0" ]
1
2020-07-24T08:31:57.000Z
2020-07-24T08:31:57.000Z
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack LLC. # Copyright (c) 2011 X.commerce, a business unit of eBay Inc. # Copyright 2011 Grid Dynamics # Copyright 2011 Eldar Nugaev, Kirill Shileev, Ilya Alekseyev # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not ...
35.915361
79
0.644671
import webob from nova.api.openstack import extensions from nova.api.openstack import wsgi from nova.api.openstack import xmlutil from nova import compute from nova.compute import utils as compute_utils from nova import exception from nova import network from nova.openstack.common import log as logging from nova imp...
false
true
f773d57aa74b4992ccc7a738ae5e36925acad880
1,310
py
Python
models/brian2/utils_net.py
caglorithm/stimulus_neural_populations
58567901bed6f6bc17fc2975435138c33bb6be66
[ "BSD-2-Clause" ]
12
2019-06-04T07:39:49.000Z
2021-12-08T17:34:37.000Z
models/brian2/utils_net.py
caglorithm/stimulus_neural_populations
58567901bed6f6bc17fc2975435138c33bb6be66
[ "BSD-2-Clause" ]
null
null
null
models/brian2/utils_net.py
caglorithm/stimulus_neural_populations
58567901bed6f6bc17fc2975435138c33bb6be66
[ "BSD-2-Clause" ]
6
2019-06-04T14:12:04.000Z
2022-03-22T15:31:02.000Z
import numpy as np # try to import numba # or define dummy decorator try: from numba import autojit except: def autojit(func): return func # util functions for network simulation def smooth_trace(trace, scale): scale = int(scale) if scale == 1 or scale == 0: return trace slen = int(...
31.95122
93
0.616031
import numpy as np try: from numba import autojit except: def autojit(func): return func def smooth_trace(trace, scale): scale = int(scale) if scale == 1 or scale == 0: return trace slen = int(len(trace) / scale) if slen == 0: return trace return np.array([np.mean(tr...
true
true
f773d5fa4011bf7a62026f6fc35882c9ac05f702
7,459
py
Python
benchmarks/toolkit/datasets.py
SergioRAgostinho/cvxpnpl
eaa568594df0adcf0c70cc5288b24e5dc1fa9d2f
[ "Apache-2.0" ]
51
2019-07-25T18:42:44.000Z
2022-03-06T06:24:07.000Z
benchmarks/toolkit/datasets.py
SergioRAgostinho/cvxpnpl
eaa568594df0adcf0c70cc5288b24e5dc1fa9d2f
[ "Apache-2.0" ]
6
2019-05-08T17:03:54.000Z
2021-06-29T13:56:22.000Z
benchmarks/toolkit/datasets.py
SergioRAgostinho/cvxpnpl
eaa568594df0adcf0c70cc5288b24e5dc1fa9d2f
[ "Apache-2.0" ]
9
2019-08-13T15:56:47.000Z
2022-01-19T09:48:22.000Z
from collections import namedtuple import json import os from os.path import join as pjoin from pathlib import Path import numpy as np from plymit import Ply from PIL import Image from .renderer import Renderer Model = namedtuple( "Model", [ "id", "points", "normals", "color",...
28.688462
90
0.48894
from collections import namedtuple import json import os from os.path import join as pjoin from pathlib import Path import numpy as np from plymit import Ply from PIL import Image from .renderer import Renderer Model = namedtuple( "Model", [ "id", "points", "normals", "color",...
true
true
f773d601546f077ba519b55a8462147763a6dc00
5,933
py
Python
skactiveml/pool/tests/test_information_maximization.py
LukasLuehrs/scikit-activeml
04d7107272ef0438070808475599131d8726f547
[ "BSD-3-Clause" ]
null
null
null
skactiveml/pool/tests/test_information_maximization.py
LukasLuehrs/scikit-activeml
04d7107272ef0438070808475599131d8726f547
[ "BSD-3-Clause" ]
null
null
null
skactiveml/pool/tests/test_information_maximization.py
LukasLuehrs/scikit-activeml
04d7107272ef0438070808475599131d8726f547
[ "BSD-3-Clause" ]
null
null
null
import unittest import numpy as np from sklearn.gaussian_process import GaussianProcessRegressor from skactiveml.pool import ( MutualInformationGainMaximization, KLDivergenceMaximization, ) from skactiveml.pool.tests.provide_test_pool_regression import ( provide_test_regression_query_strategy_init_random_...
34.494186
74
0.756278
import unittest import numpy as np from sklearn.gaussian_process import GaussianProcessRegressor from skactiveml.pool import ( MutualInformationGainMaximization, KLDivergenceMaximization, ) from skactiveml.pool.tests.provide_test_pool_regression import ( provide_test_regression_query_strategy_init_random_...
true
true
f773d6639368f0da9eb4bce845dafa5c26407742
2,870
py
Python
road_compare/main.py
narthur/road-compare
43cfab297162477637b898aee8ebad4d3920e962
[ "MIT" ]
null
null
null
road_compare/main.py
narthur/road-compare
43cfab297162477637b898aee8ebad4d3920e962
[ "MIT" ]
null
null
null
road_compare/main.py
narthur/road-compare
43cfab297162477637b898aee8ebad4d3920e962
[ "MIT" ]
null
null
null
from pyminder.goal import Goal from natlibpy.factory import Factory import datetime import json from road_compare.requests import Requests from road_compare.python import Python class Main: _factory: Factory _python: Python _requests: Requests def __init__(self, factory: Factory, python: Python, requ...
32.247191
103
0.641812
from pyminder.goal import Goal from natlibpy.factory import Factory import datetime import json from road_compare.requests import Requests from road_compare.python import Python class Main: _factory: Factory _python: Python _requests: Requests def __init__(self, factory: Factory, python: Python, requ...
true
true
f773d7a5f94dc484d20bca0e8bbd43a81a51c1ca
25,677
py
Python
efficientdet/utils.py
kcrumb/automl
8cc08ade25d99d0dcc977da46ae2642dadccf826
[ "Apache-2.0" ]
1
2021-01-21T11:53:44.000Z
2021-01-21T11:53:44.000Z
efficientdet/utils.py
azayz/automl
6e0cb70003c05dbbba45a7d741ec975423042f0e
[ "Apache-2.0" ]
null
null
null
efficientdet/utils.py
azayz/automl
6e0cb70003c05dbbba45a7d741ec975423042f0e
[ "Apache-2.0" ]
null
null
null
# Copyright 2020 Google Research. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
37.375546
127
0.691202
import contextlib import os import re from typing import Text, Tuple, Union from absl import logging import numpy as np import tensorflow.compat.v1 as tf import tensorflow.compat.v2 as tf2 from tensorflow.python.tpu import tpu_function def srelu_fn(x): with tf.name_scope('srelu'): beta = tf.Variable(20.0, name...
true
true
f773d80a9375aaec1b716aefb8291f506e2e7b59
20
py
Python
flask_tube/base.py
fengluo/flask-tube
35ab75d1506c6a30b1bb543d1f34c6bbb84b7cb1
[ "MIT" ]
null
null
null
flask_tube/base.py
fengluo/flask-tube
35ab75d1506c6a30b1bb543d1f34c6bbb84b7cb1
[ "MIT" ]
null
null
null
flask_tube/base.py
fengluo/flask-tube
35ab75d1506c6a30b1bb543d1f34c6bbb84b7cb1
[ "MIT" ]
null
null
null
import ujson as json
20
20
0.85
import ujson as json
true
true
f773d87e533a8841e805ed6871ee9b39a454b378
1,173
py
Python
cohesity_management_sdk/models/worm_retention_type_protection_policy_enum.py
cohesity/management-sdk-python
867d8c0c40dd317cdb017902c895527da7ae31c0
[ "Apache-2.0" ]
18
2019-09-24T17:35:53.000Z
2022-03-25T08:08:47.000Z
cohesity_management_sdk/models/worm_retention_type_protection_policy_enum.py
cohesity/management-sdk-python
867d8c0c40dd317cdb017902c895527da7ae31c0
[ "Apache-2.0" ]
18
2019-03-29T19:32:29.000Z
2022-01-03T23:16:45.000Z
cohesity_management_sdk/models/worm_retention_type_protection_policy_enum.py
cohesity/management-sdk-python
867d8c0c40dd317cdb017902c895527da7ae31c0
[ "Apache-2.0" ]
16
2019-02-27T06:54:12.000Z
2021-11-16T18:10:24.000Z
# -*- coding: utf-8 -*- # Copyright 2021 Cohesity Inc. class WormRetentionTypeProtectionPolicyEnum(object): """Implementation of the 'WormRetentionType_ProtectionPolicy' enum. Specifies WORM retention type for the snapshots. When a WORM retention type is specified, the snapshots of the Protection Jobs us...
34.5
77
0.738278
class WormRetentionTypeProtectionPolicyEnum(object): KNONE = 'kNone' KCOMPLIANCE = 'kCompliance' KADMINISTRATIVE = 'kAdministrative'
true
true
f773d91232a3826439abea102e783357146f395d
1,259
py
Python
{{cookiecutter.project_slug}}/setup.py
wethreetrees/cookiecutter-pipenv
958b2056561599729acb9a13c18e07bcac8a6850
[ "BSD-3-Clause" ]
null
null
null
{{cookiecutter.project_slug}}/setup.py
wethreetrees/cookiecutter-pipenv
958b2056561599729acb9a13c18e07bcac8a6850
[ "BSD-3-Clause" ]
null
null
null
{{cookiecutter.project_slug}}/setup.py
wethreetrees/cookiecutter-pipenv
958b2056561599729acb9a13c18e07bcac8a6850
[ "BSD-3-Clause" ]
null
null
null
#!/usr/bin/env python # -*- coding: utf-8 -*- """The setup script.""" from setuptools import setup, find_packages with open('README.rst') as readme_file: readme = readme_file.read() setup_requirements = [{%- if cookiecutter.use_pytest == 'y' %}'pytest-runner',{%- endif %} ] test_requirements = [{%- if cookiecu...
34.027027
96
0.651311
"""The setup script.""" from setuptools import setup, find_packages with open('README.rst') as readme_file: readme = readme_file.read() setup_requirements = [{%- if cookiecutter.use_pytest == 'y' %}'pytest-runner',{%- endif %} ] test_requirements = [{%- if cookiecutter.use_pytest == 'y' %}'pytest',{%- endif %}...
false
true
f773d9435691a4c34603b96b4da91aa601d07b78
6,869
py
Python
metapool/igm.py
charles-cowart/metagenomics_pooling_notebook-1
84975ba501d7caaef69aac92018a1b42544c5e4d
[ "MIT" ]
8
2021-08-30T03:54:39.000Z
2022-01-17T18:07:35.000Z
metapool/igm.py
charles-cowart/metagenomics_pooling_notebook-1
84975ba501d7caaef69aac92018a1b42544c5e4d
[ "MIT" ]
57
2021-08-19T20:45:16.000Z
2022-03-24T19:24:49.000Z
metapool/igm.py
charles-cowart/metagenomics_pooling_notebook-1
84975ba501d7caaef69aac92018a1b42544c5e4d
[ "MIT" ]
11
2021-09-03T17:48:26.000Z
2021-12-13T20:21:51.000Z
import os from datetime import datetime from openpyxl import load_workbook from openpyxl.styles import PatternFill _IGM_ROW_OFFSET = 25 _CONTACT = 'MacKenzie Bryant' _EMAIL = 'mackenzie.m.bryant@gmail.com' _INSTITUTE = 'Knight Lab' _PI_NAME = 'Dr. Knight' _PLATFORM = 'NovaSeq S4' _RUN_TYPE = 'PE150' _CUSTOM_PRIMER ...
33.837438
79
0.583345
import os from datetime import datetime from openpyxl import load_workbook from openpyxl.styles import PatternFill _IGM_ROW_OFFSET = 25 _CONTACT = 'MacKenzie Bryant' _EMAIL = 'mackenzie.m.bryant@gmail.com' _INSTITUTE = 'Knight Lab' _PI_NAME = 'Dr. Knight' _PLATFORM = 'NovaSeq S4' _RUN_TYPE = 'PE150' _CUSTOM_PRIMER ...
true
true