hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f71c3d9f2d35818503ab834cb34b0e0f458291f8 | 1,541 | py | Python | signal_ocean/geo/models.py | ktsitsikas-signal/SignalSDK | 1b125ae963ee2b53a2a3ec5a7ae6bf9511608355 | [
"Apache-2.0"
] | null | null | null | signal_ocean/geo/models.py | ktsitsikas-signal/SignalSDK | 1b125ae963ee2b53a2a3ec5a7ae6bf9511608355 | [
"Apache-2.0"
] | null | null | null | signal_ocean/geo/models.py | ktsitsikas-signal/SignalSDK | 1b125ae963ee2b53a2a3ec5a7ae6bf9511608355 | [
"Apache-2.0"
] | null | null | null | # noqa: D100
from dataclasses import dataclass
from decimal import Decimal
from typing import Optional
@dataclass(frozen=True)
class Country:
"""Represents a country.
Attributes:
id: The ID of the country.
name: The name of the country.
country_code: Alpha-2 codes used by the ISO 316... | 22.333333 | 78 | 0.627515 |
from dataclasses import dataclass
from decimal import Decimal
from typing import Optional
@dataclass(frozen=True)
class Country:
id: int
name: str
country_code: str
country_code_numeric: str
country_code_iso3: str
@dataclass(frozen=True)
class Port:
id: int
country_id: int
area_i... | true | true |
f71c3e06df78623471caeb98f86f952dc33b019f | 671 | py | Python | oocran/django/ns/admin.py | howls90/oocran | 9951f3ff752f9f6517a4d016476c1d1e2bb44a4d | [
"Apache-2.0",
"BSD-3-Clause"
] | 3 | 2018-12-12T10:32:16.000Z | 2022-02-07T19:46:10.000Z | oocran/django/ns/admin.py | howls90/oocran | 9951f3ff752f9f6517a4d016476c1d1e2bb44a4d | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2017-01-11T06:56:35.000Z | 2017-01-11T06:58:44.000Z | oocran/django/ns/admin.py | howls90/OOCRAN | 9951f3ff752f9f6517a4d016476c1d1e2bb44a4d | [
"Apache-2.0",
"BSD-3-Clause"
] | 6 | 2017-05-29T03:34:23.000Z | 2022-02-07T19:46:11.000Z | from django.contrib import admin
from .models import Ns, Nvf
class NsModelAdmin(admin.ModelAdmin):
list_display = ["name", "update", "timestamp"]
list_display_links = ["update"]
list_filter = ["update", "timestamp"]
list_editable = ["name"]
search_fields = ["name"]
class Meta:
model =... | 21.645161 | 50 | 0.657228 | from django.contrib import admin
from .models import Ns, Nvf
class NsModelAdmin(admin.ModelAdmin):
list_display = ["name", "update", "timestamp"]
list_display_links = ["update"]
list_filter = ["update", "timestamp"]
list_editable = ["name"]
search_fields = ["name"]
class Meta:
model =... | true | true |
f71c3fd4413d254a1be32c01d461ea5d95ef19f5 | 560 | py | Python | Video_Generation_with_Detections.py | ludvikalkhoury/Sperm-Heads-Segmentation-and-Localization-using-Urbano-s-Method | 30580d02d0981d59376fbec6b59f5146eaffef14 | [
"MIT"
] | null | null | null | Video_Generation_with_Detections.py | ludvikalkhoury/Sperm-Heads-Segmentation-and-Localization-using-Urbano-s-Method | 30580d02d0981d59376fbec6b59f5146eaffef14 | [
"MIT"
] | null | null | null | Video_Generation_with_Detections.py | ludvikalkhoury/Sperm-Heads-Segmentation-and-Localization-using-Urbano-s-Method | 30580d02d0981d59376fbec6b59f5146eaffef14 | [
"MIT"
] | null | null | null | import cv2
import numpy as np
Initial_Frame = 900
Final_Frame = 1190
video_name = 'Sample2 with detections.avi'
frame = cv2.imread("image/Seg_frame%d.jpg" % Initial_Frame)
height, width, layers = frame.shape
fps = 15
video = cv2.VideoWriter(video_name, 0, fps, (width,height))
for x in range(I... | 22.4 | 86 | 0.676786 | import cv2
import numpy as np
Initial_Frame = 900
Final_Frame = 1190
video_name = 'Sample2 with detections.avi'
frame = cv2.imread("image/Seg_frame%d.jpg" % Initial_Frame)
height, width, layers = frame.shape
fps = 15
video = cv2.VideoWriter(video_name, 0, fps, (width,height))
for x in range(I... | true | true |
f71c41f8731671ad3e1d3a2df155f7aa93679845 | 5,182 | py | Python | instances/optimization/20210422-1717/pas1/inst-20210422-1717-c30-pas1.py | LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure | bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11 | [
"BSD-3-Clause"
] | null | null | null | instances/optimization/20210422-1717/pas1/inst-20210422-1717-c30-pas1.py | LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure | bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11 | [
"BSD-3-Clause"
] | null | null | null | instances/optimization/20210422-1717/pas1/inst-20210422-1717-c30-pas1.py | LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure | bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11 | [
"BSD-3-Clause"
] | null | null | null |
"""
PERIODS
"""
numPeriods = 180
"""
STOPS
"""
numStations = 13
station_names = (
"Hamburg Hbf", # 0
"Landwehr", # 1
"Hasselbrook", # 2
"Wansbeker Chaussee*", # 3
"Friedrichsberg*", # 4
"Barmbek*", # 5
"Alte Woehr (Stadtpark)", # 6
"Ruebenkamp (City Nord)", # 7
"Ohlsdorf*", # 8
"Kornweg", # 9
... | 20.563492 | 108 | 0.446353 |
numPeriods = 180
numStations = 13
station_names = (
"Hamburg Hbf",
"Landwehr",
"Hasselbrook",
"Wansbeker Chaussee*",
"Friedrichsberg*",
"Barmbek*",
"Alte Woehr (Stadtpark)",
"Ruebenkamp (City Nord)",
"Ohlsdorf*",
"Kornweg",
"Hoheneichen",
"Wellingsbuettel",
"Poppenbuettel*",
)
numStops ... | true | true |
f71c4289fb96b9b13572b2e0265ec5d04f90d215 | 3,523 | py | Python | nn_interpretability/model/model_repository.py | miquelmn/nn_interpretability | 2b5d2b4102016189743e09f1f3a56f2ecddfde98 | [
"MIT"
] | 41 | 2020-10-13T18:46:32.000Z | 2022-02-21T15:52:50.000Z | nn_interpretability/model/model_repository.py | miquelmn/nn_interpretability | 2b5d2b4102016189743e09f1f3a56f2ecddfde98 | [
"MIT"
] | 4 | 2021-07-11T12:38:03.000Z | 2022-03-08T14:47:38.000Z | nn_interpretability/model/model_repository.py | miquelmn/nn_interpretability | 2b5d2b4102016189743e09f1f3a56f2ecddfde98 | [
"MIT"
] | 7 | 2020-10-21T13:03:16.000Z | 2022-03-07T11:45:00.000Z | import os
import torch
from pathlib import Path
from nn_interpretability.model.definition.am_mnist_classifier import AMCNN
from nn_interpretability.model.definition.mc_dropout_cnn import CNN_Dropout
from nn_interpretability.model.definition.general_mnist_cnn import GeneralCNN
from nn_interpretability.model.definition.... | 32.62037 | 121 | 0.705081 | import os
import torch
from pathlib import Path
from nn_interpretability.model.definition.am_mnist_classifier import AMCNN
from nn_interpretability.model.definition.mc_dropout_cnn import CNN_Dropout
from nn_interpretability.model.definition.general_mnist_cnn import GeneralCNN
from nn_interpretability.model.definition.... | true | true |
f71c4337eebf63c1b6c456cfeb478e85e64e7d70 | 4,660 | py | Python | cherrytree/github_utils.py | preset-io/cherrytree | 647b7acfb8f95c6a874386183860fdf17cace49b | [
"Apache-2.0"
] | 1 | 2021-04-06T18:25:58.000Z | 2021-04-06T18:25:58.000Z | cherrytree/github_utils.py | preset-io/cherrytree | 647b7acfb8f95c6a874386183860fdf17cace49b | [
"Apache-2.0"
] | null | null | null | cherrytree/github_utils.py | preset-io/cherrytree | 647b7acfb8f95c6a874386183860fdf17cace49b | [
"Apache-2.0"
] | null | null | null | import os
import re
from collections import OrderedDict
from typing import Generator, List, Optional, Reversible
import delegator
from git import Commit
from git.exc import InvalidGitRepositoryError
from git.repo import Repo
from github import Github
from github.Label import Label
from github.Issue import Issue
from g... | 29.308176 | 89 | 0.657296 | import os
import re
from collections import OrderedDict
from typing import Generator, List, Optional, Reversible
import delegator
from git import Commit
from git.exc import InvalidGitRepositoryError
from git.repo import Repo
from github import Github
from github.Label import Label
from github.Issue import Issue
from g... | true | true |
f71c439040784630188bbe6360a6d737525bd96e | 7,063 | py | Python | NiaPy/algorithms/basic/gso.py | tuahk/NiaPy | c863d801fda8e1949a3ca716a4de7c7ca3d0ea16 | [
"MIT"
] | null | null | null | NiaPy/algorithms/basic/gso.py | tuahk/NiaPy | c863d801fda8e1949a3ca716a4de7c7ca3d0ea16 | [
"MIT"
] | null | null | null | NiaPy/algorithms/basic/gso.py | tuahk/NiaPy | c863d801fda8e1949a3ca716a4de7c7ca3d0ea16 | [
"MIT"
] | null | null | null | # encoding=utf8
# pylint: disable=mixed-indentation, trailing-whitespace, line-too-long, multiple-statements, attribute-defined-outside-init, logging-not-lazy, no-self-use, redefined-builtin, singleton-comparison, unused-argument, arguments-differ, no-else-return
import logging
from scipy.spatial.distance import euclid... | 33.794258 | 247 | 0.68781 |
import logging
from scipy.spatial.distance import euclidean
from numpy import full, apply_along_axis, argmin, copy, sum, inf, fmax, pi, where
from NiaPy.algorithms.algorithm import Algorithm
logging.basicConfig()
logger = logging.getLogger('NiaPy.algorithms.basic')
logger.setLevel('INFO')
__all__ = ['GlowwormSwarmO... | true | true |
f71c43a114c10204ad2b5ff2693265ff01dc5894 | 64 | py | Python | dr/__init__.py | jigangkim/domain_randomization | 07a309a9e824b5332219871abe8f0f657694b292 | [
"MIT"
] | 7 | 2019-06-09T13:03:18.000Z | 2022-02-19T08:50:51.000Z | dr/__init__.py | jigangkim/domain_randomization | 07a309a9e824b5332219871abe8f0f657694b292 | [
"MIT"
] | 1 | 2019-07-12T23:59:46.000Z | 2021-11-21T04:09:09.000Z | dr/__init__.py | jigangkim/domain_randomization | 07a309a9e824b5332219871abe8f0f657694b292 | [
"MIT"
] | 3 | 2020-05-01T13:18:25.000Z | 2021-03-30T11:52:33.000Z | import dr.dist
import dr.experiment
import dr.gym
import dr.ppo
| 12.8 | 20 | 0.8125 | import dr.dist
import dr.experiment
import dr.gym
import dr.ppo
| true | true |
f71c441128b684fbb0542eeb3decdebe626fc0b9 | 377 | py | Python | plugin_info.py | Attolab/pymodaq_plugins_smaract | 109808255d784bd98b875fb4886c90a1f0e9ff7b | [
"CECILL-B"
] | null | null | null | plugin_info.py | Attolab/pymodaq_plugins_smaract | 109808255d784bd98b875fb4886c90a1f0e9ff7b | [
"CECILL-B"
] | null | null | null | plugin_info.py | Attolab/pymodaq_plugins_smaract | 109808255d784bd98b875fb4886c90a1f0e9ff7b | [
"CECILL-B"
] | null | null | null | SHORT_PLUGIN_NAME = 'smaract'
package_url = 'https://github.com/CEMES-CNRS/pymodaq_plugins_samarct'
description = 'Set of PyMoDAQ plugins for linear actuators from Smaract' \
'(SLC positioners). MCS and MCS2 controllers are supported.'
author = 'David Bresteau'
author_email = 'david.bresteau@cea.fr'
# p... | 34.272727 | 74 | 0.748011 | SHORT_PLUGIN_NAME = 'smaract'
package_url = 'https://github.com/CEMES-CNRS/pymodaq_plugins_samarct'
description = 'Set of PyMoDAQ plugins for linear actuators from Smaract' \
'(SLC positioners). MCS and MCS2 controllers are supported.'
author = 'David Bresteau'
author_email = 'david.bresteau@cea.fr'
pa... | true | true |
f71c454e2944e16b15e7400432d9858fbd2966f8 | 4,678 | py | Python | cuesdk/capi.py | CorsairOfficial/cue-sdk-python | 8385369725be852eac4bd8e4323ea6661c8603e4 | [
"MIT"
] | 34 | 2020-03-25T08:57:23.000Z | 2022-03-26T16:30:06.000Z | cuesdk/capi.py | CorsairOfficial/cue-sdk-python | 8385369725be852eac4bd8e4323ea6661c8603e4 | [
"MIT"
] | 12 | 2020-03-25T08:56:28.000Z | 2022-02-18T15:20:51.000Z | cuesdk/capi.py | CorsairOfficial/cue-sdk-python | 8385369725be852eac4bd8e4323ea6661c8603e4 | [
"MIT"
] | 17 | 2020-07-24T13:29:06.000Z | 2022-02-02T22:13:43.000Z | import os
import platform
import sys
from ctypes import (CDLL, CFUNCTYPE, POINTER, sizeof, c_bool, c_char, c_int32,
c_void_p)
from .enums import (CorsairAccessMode, CorsairError, CorsairLedId,
CorsairEventId, CorsairDevicePropertyId)
from .structs import (CorsairProtocolDetails, ... | 46.316832 | 79 | 0.621633 | import os
import platform
import sys
from ctypes import (CDLL, CFUNCTYPE, POINTER, sizeof, c_bool, c_char, c_int32,
c_void_p)
from .enums import (CorsairAccessMode, CorsairError, CorsairLedId,
CorsairEventId, CorsairDevicePropertyId)
from .structs import (CorsairProtocolDetails, ... | true | true |
f71c45e85feabb8c601d3ee30aa42ca3ae609193 | 20,007 | py | Python | gt_kai.py | d-ks/gym_torcs_kai | b9e1659a18ea8a788d0c6aeb7b1111c0284b23ac | [
"MIT"
] | null | null | null | gt_kai.py | d-ks/gym_torcs_kai | b9e1659a18ea8a788d0c6aeb7b1111c0284b23ac | [
"MIT"
] | null | null | null | gt_kai.py | d-ks/gym_torcs_kai | b9e1659a18ea8a788d0c6aeb7b1111c0284b23ac | [
"MIT"
] | null | null | null | # Gym-TORCS-Kai Environment for Reinforcement Learning in TORCS
# original author : Naoto Yoshida
# (https://github.com/ugo-nama-kun/gym_torcs)
# modified version author : Daiko Kishikawa
#
# This environment is under modification. (2019.12)
#
import gym
from gym import spaces
from gym.utils import seeding
import num... | 35.410619 | 107 | 0.450992 |
import gym
from gym import spaces
from gym.utils import seeding
import numpy as np
import sys
sys.path.append("./gym_torcs_kai")
import snakeoil3_gym as snakeoil3
import os
import time
class TorcsKaiEnv(gym.Env):
terminal_judge_start = 500
termination_limit_progress = 5
... | true | true |
f71c466cbf91fb905a3d1819ad2004dbe30abd3a | 775 | py | Python | app/mixin/assets.py | swelanauguste/refactored-sniffle | 1c0ea2f4d07a74d694ae3409b8b2ea3d57b9db4f | [
"MIT"
] | null | null | null | app/mixin/assets.py | swelanauguste/refactored-sniffle | 1c0ea2f4d07a74d694ae3409b8b2ea3d57b9db4f | [
"MIT"
] | null | null | null | app/mixin/assets.py | swelanauguste/refactored-sniffle | 1c0ea2f4d07a74d694ae3409b8b2ea3d57b9db4f | [
"MIT"
] | null | null | null | from django.conf import settings
from django.db import models
from django.views.generic import TemplateView
User = settings.AUTH_USER_MODEL
class TimeStampMixin(models.Model):
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
created_by = models.Foreign... | 22.794118 | 56 | 0.676129 | from django.conf import settings
from django.db import models
from django.views.generic import TemplateView
User = settings.AUTH_USER_MODEL
class TimeStampMixin(models.Model):
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
created_by = models.Foreign... | true | true |
f71c4861f8de557647d8e90f974fff337027d1d9 | 14,233 | py | Python | mnist128.py | samgregoost/self_supervised_large | 9c0c33cf374a1d5112519939012a64bca98c5f8d | [
"MIT"
] | 1 | 2021-08-25T08:32:19.000Z | 2021-08-25T08:32:19.000Z | mnist128.py | samgregoost/self_supervised_large | 9c0c33cf374a1d5112519939012a64bca98c5f8d | [
"MIT"
] | null | null | null | mnist128.py | samgregoost/self_supervised_large | 9c0c33cf374a1d5112519939012a64bca98c5f8d | [
"MIT"
] | null | null | null | from __future__ import print_function
import tensorflow as tf
import numpy as np
import random
import TensorflowUtils as utils
import read_MITSceneParsingDataParis as scene_parsing
import datetime
import BatchDatsetReader as dataset
from six.moves import xrange
FLAGS = tf.flags.FLAGS
tf.flags.DEFINE_integer("batch_siz... | 42.486567 | 135 | 0.622848 | from __future__ import print_function
import tensorflow as tf
import numpy as np
import random
import TensorflowUtils as utils
import read_MITSceneParsingDataParis as scene_parsing
import datetime
import BatchDatsetReader as dataset
from six.moves import xrange
FLAGS = tf.flags.FLAGS
tf.flags.DEFINE_integer("batch_siz... | true | true |
f71c490d7b16466aa2d3b6d909be2ecacb018f6b | 70 | py | Python | hashlib/hashlib/__init__.py | badgeteam/micropython-lib | fca0235c166ebbada489d88c42fc549267832797 | [
"PSF-2.0"
] | null | null | null | hashlib/hashlib/__init__.py | badgeteam/micropython-lib | fca0235c166ebbada489d88c42fc549267832797 | [
"PSF-2.0"
] | null | null | null | hashlib/hashlib/__init__.py | badgeteam/micropython-lib | fca0235c166ebbada489d88c42fc549267832797 | [
"PSF-2.0"
] | 2 | 2017-11-21T16:53:03.000Z | 2021-07-29T08:47:14.000Z | from .sha256 import sha224, sha256
from .sha512 import sha384, sha512
| 23.333333 | 34 | 0.8 | from .sha256 import sha224, sha256
from .sha512 import sha384, sha512
| true | true |
f71c4b2b7c7dee5107676ddd03075e0b5134b81f | 2,488 | py | Python | HDF5Saver.py | sizhky/carla-dataset-runner | a670d981d29de78460cd90b1d4949ee4b71d0ade | [
"MIT"
] | 48 | 2019-12-28T11:08:27.000Z | 2022-03-24T09:22:51.000Z | HDF5Saver.py | sizhky/carla-dataset-runner | a670d981d29de78460cd90b1d4949ee4b71d0ade | [
"MIT"
] | 6 | 2020-02-01T21:47:21.000Z | 2021-12-10T13:19:41.000Z | HDF5Saver.py | sizhky/carla-dataset-runner | a670d981d29de78460cd90b1d4949ee4b71d0ade | [
"MIT"
] | 19 | 2020-01-08T08:19:08.000Z | 2022-03-24T08:39:53.000Z | import h5py
import numpy as np
class HDF5Saver:
def __init__(self, sensor_width, sensor_height, file_path_to_save="data/carla_dataset.hdf5"):
self.sensor_width = sensor_width
self.sensor_height = sensor_height
self.file = h5py.File(file_path_to_save, "w")
# Creating groups to stor... | 54.086957 | 135 | 0.671624 | import h5py
import numpy as np
class HDF5Saver:
def __init__(self, sensor_width, sensor_height, file_path_to_save="data/carla_dataset.hdf5"):
self.sensor_width = sensor_width
self.sensor_height = sensor_height
self.file = h5py.File(file_path_to_save, "w")
self.rgb_group =... | true | true |
f71c4b4a5eb25c7ff024fb30f9b4ce405c736e0b | 544 | py | Python | manage.py | almazkun/PythonDjangoMozilaTut | 39e7c4d1ab9fbfe85abe90d94585fc7315617d1d | [
"MIT"
] | 1 | 2019-01-16T05:39:42.000Z | 2019-01-16T05:39:42.000Z | manage.py | almazkun/PythonDjangoMozilaTut | 39e7c4d1ab9fbfe85abe90d94585fc7315617d1d | [
"MIT"
] | null | null | null | manage.py | almazkun/PythonDjangoMozilaTut | 39e7c4d1ab9fbfe85abe90d94585fc7315617d1d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'visitkoreakz.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django.... | 34 | 76 | 0.689338 |
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'visitkoreakz.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 in... | true | true |
f71c4b6de69a49fef47431af49540a00c27168f7 | 622 | py | Python | src/libs/components/customsmarttile.py | loghinalexandru/blackboard-greenboard | 80332bf7709e602a4d5ada31b3cf95801c06190f | [
"MIT"
] | null | null | null | src/libs/components/customsmarttile.py | loghinalexandru/blackboard-greenboard | 80332bf7709e602a4d5ada31b3cf95801c06190f | [
"MIT"
] | null | null | null | src/libs/components/customsmarttile.py | loghinalexandru/blackboard-greenboard | 80332bf7709e602a4d5ada31b3cf95801c06190f | [
"MIT"
] | null | null | null | import kivy
from functools import partial
kivy.require('2.0.0')
from kivymd.uix.imagelist import SmartTile
from constants import Screen
class CustomSmartTile(SmartTile):
def __init__(self, **kwargs):
super(CustomSmartTile, self).__init__(**kwargs)
self.height = '240dp'
self.size_hint_y = No... | 36.588235 | 93 | 0.709003 | import kivy
from functools import partial
kivy.require('2.0.0')
from kivymd.uix.imagelist import SmartTile
from constants import Screen
class CustomSmartTile(SmartTile):
def __init__(self, **kwargs):
super(CustomSmartTile, self).__init__(**kwargs)
self.height = '240dp'
self.size_hint_y = No... | true | true |
f71c4cb2928d71b7feb87e22f1a85505c3468626 | 1,416 | py | Python | processing/data_collection/gazette/spiders/es_associacao_municipios.py | marlesson/diario-oficial | 6c2b3e41d1d08a1fd47517ed55ac22ae888c88b3 | [
"MIT"
] | 3 | 2018-06-05T02:33:03.000Z | 2018-06-05T14:20:02.000Z | processing/data_collection/gazette/spiders/es_associacao_municipios.py | marlesson/diario-oficial | 6c2b3e41d1d08a1fd47517ed55ac22ae888c88b3 | [
"MIT"
] | 4 | 2018-06-07T14:55:53.000Z | 2018-06-29T12:37:12.000Z | processing/data_collection/gazette/spiders/es_associacao_municipios.py | marlesson/diario-oficial | 6c2b3e41d1d08a1fd47517ed55ac22ae888c88b3 | [
"MIT"
] | 1 | 2018-08-24T22:32:27.000Z | 2018-08-24T22:32:27.000Z | from dateparser import parse
import datetime as dt
import scrapy
from gazette.items import Gazette
from gazette.spiders.base import BaseGazetteSpider
class EsAssociacaoMunicipiosSpider(BaseGazetteSpider):
TERRITORY_ID = '3200000'
name = 'es_associacao_municipios'
allowed_domains = ['diariomunicipales.or... | 35.4 | 83 | 0.633475 | from dateparser import parse
import datetime as dt
import scrapy
from gazette.items import Gazette
from gazette.spiders.base import BaseGazetteSpider
class EsAssociacaoMunicipiosSpider(BaseGazetteSpider):
TERRITORY_ID = '3200000'
name = 'es_associacao_municipios'
allowed_domains = ['diariomunicipales.or... | true | true |
f71c4f6668cb080ef2ce8616c2f028e0b74e850d | 6,404 | py | Python | test/functional/mempool_persist.py | likloadm/arielcoin | bd26479189fbdbea6e6f783c9d898054ae8740b0 | [
"MIT"
] | 3 | 2022-02-24T01:44:26.000Z | 2022-03-04T12:13:08.000Z | test/functional/mempool_persist.py | likloadm/arielcoin | bd26479189fbdbea6e6f783c9d898054ae8740b0 | [
"MIT"
] | 2 | 2022-03-21T05:41:51.000Z | 2022-03-21T17:12:13.000Z | test/functional/mempool_persist.py | likloadm/arielcoin | bd26479189fbdbea6e6f783c9d898054ae8740b0 | [
"MIT"
] | 6 | 2022-02-23T10:54:43.000Z | 2022-03-24T09:05:45.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test mempool persistence.
By default, bitcoind will dump mempool on shutdown and
then reload it on sta... | 47.088235 | 207 | 0.698626 |
from decimal import Decimal
import os
import time
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal, assert_raises_rpc_error, wait_until
class MempoolPersistTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 3
self... | true | true |
f71c4fd86e03f9140408817a88d200d10a2703a4 | 345 | py | Python | day07/day7_part1.py | briannamcdonald/advent-of-code-2021 | c67e3c02a84db1a0cceeefef34a8cddba311484e | [
"MIT"
] | 1 | 2021-12-05T15:04:23.000Z | 2021-12-05T15:04:23.000Z | day07/day7_part1.py | briannamcdonald/advent-of-code-2021 | c67e3c02a84db1a0cceeefef34a8cddba311484e | [
"MIT"
] | null | null | null | day07/day7_part1.py | briannamcdonald/advent-of-code-2021 | c67e3c02a84db1a0cceeefef34a8cddba311484e | [
"MIT"
] | null | null | null | def main():
data = open("day07/input.txt", "r")
lines = [line for line in data]
crabs = [int(fish.strip()) for fish in lines[0].split(",")]
median_val = sorted(crabs)[len(crabs) // 2]
fuel_sum = 0
for crab in crabs:
fuel_sum += abs(crab - median_val)
print(fuel_sum)
if __name__ =... | 21.5625 | 63 | 0.582609 | def main():
data = open("day07/input.txt", "r")
lines = [line for line in data]
crabs = [int(fish.strip()) for fish in lines[0].split(",")]
median_val = sorted(crabs)[len(crabs) // 2]
fuel_sum = 0
for crab in crabs:
fuel_sum += abs(crab - median_val)
print(fuel_sum)
if __name__ =... | true | true |
f71c503591cb93ca4d82cc8039bd0f901a19b722 | 578 | py | Python | utils/utility.py | qiyuangong/Relational_Transaction_Anon | 954cca4b073b4d0532814ac7cf77ab1ae8068c9c | [
"MIT"
] | 1 | 2020-04-16T13:40:39.000Z | 2020-04-16T13:40:39.000Z | utils/utility.py | qiyuangong/Relational_Transaction_Anon | 954cca4b073b4d0532814ac7cf77ab1ae8068c9c | [
"MIT"
] | null | null | null | utils/utility.py | qiyuangong/Relational_Transaction_Anon | 954cca4b073b4d0532814ac7cf77ab1ae8068c9c | [
"MIT"
] | 2 | 2015-12-17T01:20:39.000Z | 2019-03-10T13:51:21.000Z | """
shared functions
"""
#!/usr/bin/env python
#coding=utf-8
def cmp_str(element1, element2):
"""
compare number in str format correctley
"""
try:
return cmp(float(element1), float(element2))
except ValueError:
return cmp(element1, element2)
def list_to_str(value_list, cmpfun=cm... | 21.407407 | 67 | 0.650519 |
def cmp_str(element1, element2):
try:
return cmp(float(element1), float(element2))
except ValueError:
return cmp(element1, element2)
def list_to_str(value_list, cmpfun=cmp, sep=';'):
temp = value_list[:]
temp.sort(cmp=cmpfun)
return sep.join(temp)
| true | true |
f71c5062942eba1d7faec207ed2e124ae3fb0e61 | 603 | py | Python | app.py | zachmerrill/pyrdle | 573035cecbe3ee5cae36562a2e3b53ea4f2950a0 | [
"MIT"
] | null | null | null | app.py | zachmerrill/pyrdle | 573035cecbe3ee5cae36562a2e3b53ea4f2950a0 | [
"MIT"
] | null | null | null | app.py | zachmerrill/pyrdle | 573035cecbe3ee5cae36562a2e3b53ea4f2950a0 | [
"MIT"
] | null | null | null | from game import Game
if __name__ == '__main__':
# Initialize the game
game = Game()
# Game loop
while True:
# Get the user's guess
guess = input('Guess a word: ').lower()
# Check the guess
game.check_guess(guess)
# Print the board
game.print_board()
... | 25.125 | 47 | 0.512438 | from game import Game
if __name__ == '__main__':
game = Game()
while True:
guess = input('Guess a word: ').lower()
# Check the guess
game.check_guess(guess)
# Print the board
game.print_board()
# Check if the game is won
if game.is_won(... | true | true |
f71c51f3a090afb75de8ec1e60a2bd9eb1fb35d1 | 935 | py | Python | nnsvs/logger.py | nicolalandro/nnsvs | 45da00218dd0a445c8483f11ac891c6ef00d3925 | [
"MIT"
] | 72 | 2020-04-19T16:14:09.000Z | 2020-05-02T04:02:05.000Z | nnsvs/logger.py | nicolalandro/nnsvs | 45da00218dd0a445c8483f11ac891c6ef00d3925 | [
"MIT"
] | 1 | 2020-04-19T16:28:03.000Z | 2020-05-02T13:49:13.000Z | nnsvs/logger.py | nicolalandro/nnsvs | 45da00218dd0a445c8483f11ac891c6ef00d3925 | [
"MIT"
] | 3 | 2020-04-20T02:34:31.000Z | 2020-04-26T01:04:35.000Z | # coding: utf-8
from __future__ import absolute_import, print_function, with_statement
import logging
import os
from os.path import dirname
format = "%(asctime)s (%(module)s:%(lineno)d) %(levelname)s: %(message)s"
def getLogger(verbose=0, filename=None, name="nnsvs"):
logger = logging.getLogger(name)
if ver... | 29.21875 | 73 | 0.71123 |
from __future__ import absolute_import, print_function, with_statement
import logging
import os
from os.path import dirname
format = "%(asctime)s (%(module)s:%(lineno)d) %(levelname)s: %(message)s"
def getLogger(verbose=0, filename=None, name="nnsvs"):
logger = logging.getLogger(name)
if verbose >= 100:
... | true | true |
f71c525adccaf762f27c3b40fe128ecd416463bd | 6,309 | py | Python | dico/base/model.py | dico-api/dico | 0bb80e2bb8dd66bb5078e52c9e37c180b7c80319 | [
"MIT"
] | 37 | 2021-08-23T00:16:42.000Z | 2022-02-22T23:19:47.000Z | dico/base/model.py | dico-api/dico | 0bb80e2bb8dd66bb5078e52c9e37c180b7c80319 | [
"MIT"
] | 14 | 2021-08-07T09:01:29.000Z | 2022-02-27T15:19:36.000Z | dico/base/model.py | eunwoo1104/dico | 0bb80e2bb8dd66bb5078e52c9e37c180b7c80319 | [
"MIT"
] | 9 | 2021-08-25T04:14:05.000Z | 2022-02-27T15:08:49.000Z | import copy
import typing
from ..model.snowflake import Snowflake
if typing.TYPE_CHECKING:
from ..api import APIClient
class CopyableObject:
def copy(self):
return copy.deepcopy(self)
class EventBase:
def __init__(self, client: "APIClient", resp: dict):
self.raw: dict = resp
se... | 31.232673 | 87 | 0.579648 | import copy
import typing
from ..model.snowflake import Snowflake
if typing.TYPE_CHECKING:
from ..api import APIClient
class CopyableObject:
def copy(self):
return copy.deepcopy(self)
class EventBase:
def __init__(self, client: "APIClient", resp: dict):
self.raw: dict = resp
se... | true | true |
f71c526a7dbf0c3e5e4a74e675dd8614cf5c1f83 | 4,367 | py | Python | src/python/gh_api_repo_metrics.py | pamelarussell/github-bioinformatics | 0e7184cae57426c25cfa0e838637d34adf0a59e7 | [
"MIT"
] | 32 | 2018-05-14T20:34:08.000Z | 2022-03-22T12:37:19.000Z | src/python/gh_api_repo_metrics.py | pamelarussell/github-bioinformatics | 0e7184cae57426c25cfa0e838637d34adf0a59e7 | [
"MIT"
] | null | null | null | src/python/gh_api_repo_metrics.py | pamelarussell/github-bioinformatics | 0e7184cae57426c25cfa0e838637d34adf0a59e7 | [
"MIT"
] | 6 | 2018-07-11T17:15:07.000Z | 2021-08-02T19:51:40.000Z | import argparse
from bigquery import get_client
from gh_api import curr_commit_master
from gh_api import repo
from util import create_bq_table, push_bq_records
from util import get_repo_names, curr_time_utc
from util import unique_vals
parser = argparse.ArgumentParser()
parser.add_argument('--proj', action = 'store... | 41.590476 | 96 | 0.654912 | import argparse
from bigquery import get_client
from gh_api import curr_commit_master
from gh_api import repo
from util import create_bq_table, push_bq_records
from util import get_repo_names, curr_time_utc
from util import unique_vals
parser = argparse.ArgumentParser()
parser.add_argument('--proj', action = 'store... | true | true |
f71c529b8ce1931c25f8a957d2a88be00a3047b0 | 551 | py | Python | list/list10.py | liyuanyuan11/Python | d94cc7ab39e56c6e24bfc741a30da77590d1d220 | [
"MIT"
] | null | null | null | list/list10.py | liyuanyuan11/Python | d94cc7ab39e56c6e24bfc741a30da77590d1d220 | [
"MIT"
] | null | null | null | list/list10.py | liyuanyuan11/Python | d94cc7ab39e56c6e24bfc741a30da77590d1d220 | [
"MIT"
] | null | null | null | roadSign=[]
roadSign.append("Johnson's house")
roadSign.append("Fox streetlamp")
roadSign.append("Guang Hualu kindergarten")
roadSign.append("Dog rescue center")
roadSign.append("Samll street park")
roadSign.append("Ri Tan School")
print(roadSign)
nextRoadSign=roadSign.pop()
print(nextRoadSign)
nextRoadSign=roadSign.po... | 26.238095 | 43 | 0.811252 | roadSign=[]
roadSign.append("Johnson's house")
roadSign.append("Fox streetlamp")
roadSign.append("Guang Hualu kindergarten")
roadSign.append("Dog rescue center")
roadSign.append("Samll street park")
roadSign.append("Ri Tan School")
print(roadSign)
nextRoadSign=roadSign.pop()
print(nextRoadSign)
nextRoadSign=roadSign.po... | true | true |
f71c52fff7f80a35b0dd2c37b0c08e7e9f367495 | 2,489 | py | Python | src/pretalx/orga/management/commands/import_schedule.py | lili668668/pretalx | 5ba2185ffd7c5f95254aafe25ad3de340a86eadb | [
"Apache-2.0"
] | null | null | null | src/pretalx/orga/management/commands/import_schedule.py | lili668668/pretalx | 5ba2185ffd7c5f95254aafe25ad3de340a86eadb | [
"Apache-2.0"
] | null | null | null | src/pretalx/orga/management/commands/import_schedule.py | lili668668/pretalx | 5ba2185ffd7c5f95254aafe25ad3de340a86eadb | [
"Apache-2.0"
] | null | null | null | import datetime as dt
from xml.etree import ElementTree as ET
from django.core.management.base import BaseCommand
from django.db import transaction
from django_scopes import scopes_disabled
from pretalx.event.models import Event, Organiser, Team
from pretalx.person.models import User
class Command(BaseCommand):
... | 32.324675 | 72 | 0.599839 | import datetime as dt
from xml.etree import ElementTree as ET
from django.core.management.base import BaseCommand
from django.db import transaction
from django_scopes import scopes_disabled
from pretalx.event.models import Event, Organiser, Team
from pretalx.person.models import User
class Command(BaseCommand):
... | true | true |
f71c54f151171f4326ad7dc1ec48ae4b139e8083 | 1,412 | py | Python | python/com/nfs/select/selectMa20Stock.py | nfsli926/stock | aea312bbee2a48043800d45af8d7e14c99f566c5 | [
"Apache-2.0"
] | 1 | 2015-10-25T05:37:00.000Z | 2015-10-25T05:37:00.000Z | python/com/nfs/select/selectMa20Stock.py | nfsli926/stock | aea312bbee2a48043800d45af8d7e14c99f566c5 | [
"Apache-2.0"
] | null | null | null | python/com/nfs/select/selectMa20Stock.py | nfsli926/stock | aea312bbee2a48043800d45af8d7e14c99f566c5 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
import pandas as pd
import MySQLdb
import python.com.nfs.util.MailUtil as mailutil
import sys
# ========== 从原始csv文件中导入股票数据,以浦发银行sh600000为例
# 导入数据 - 注意:这里请填写数据文件在您电脑中的路径
'''
1、循环股票代码
2、最新的一条数据20均线在最高与最低之间
2、取出最新的5条数据
3、最后一条的均线数据大于倒数第二条
4、写入数据库,发送 或者写入df,形成xls文件
5、发送
'''
try:
reload(sys)
sys.set... | 26.641509 | 129 | 0.652975 |
import pandas as pd
import MySQLdb
import python.com.nfs.util.MailUtil as mailutil
import sys
'''
1、循环股票代码
2、最新的一条数据20均线在最高与最低之间
2、取出最新的5条数据
3、最后一条的均线数据大于倒数第二条
4、写入数据库,发送 或者写入df,形成xls文件
5、发送
'''
try:
reload(sys)
sys.setdefaultencoding('utf-8')
conn = MySQLdb.connect(host='localhost',user='root',passwd... | false | true |
f71c54fd629fe7b2eed4f7bb9d796bb0a3a708f2 | 17,077 | py | Python | ignite/contrib/engines/common.py | VinhLoiIT/ignite | 3b2b9655ea9f80ce49b8a9f1c2d72f80e2a95f56 | [
"BSD-3-Clause"
] | 1 | 2020-11-08T16:27:24.000Z | 2020-11-08T16:27:24.000Z | ignite/contrib/engines/common.py | VinhLoiIT/ignite | 3b2b9655ea9f80ce49b8a9f1c2d72f80e2a95f56 | [
"BSD-3-Clause"
] | null | null | null | ignite/contrib/engines/common.py | VinhLoiIT/ignite | 3b2b9655ea9f80ce49b8a9f1c2d72f80e2a95f56 | [
"BSD-3-Clause"
] | null | null | null | from functools import partial
import warnings
import numbers
from collections.abc import Sequence, Mapping
import torch
import torch.distributed as dist
from ignite.engine import Engine, Events
from ignite.metrics import RunningAverage
from ignite.handlers import TerminateOnNan, ModelCheckpoint, EarlyStopping
from i... | 42.061576 | 119 | 0.701997 | from functools import partial
import warnings
import numbers
from collections.abc import Sequence, Mapping
import torch
import torch.distributed as dist
from ignite.engine import Engine, Events
from ignite.metrics import RunningAverage
from ignite.handlers import TerminateOnNan, ModelCheckpoint, EarlyStopping
from i... | true | true |
f71c550e53e9a2417f70c36c35d7b793ff32d391 | 30,900 | py | Python | mindspore/python/mindspore/common/parameter.py | zhz44/mindspore | 6044d34074c8505dd4b02c0a05419cbc32a43f86 | [
"Apache-2.0"
] | null | null | null | mindspore/python/mindspore/common/parameter.py | zhz44/mindspore | 6044d34074c8505dd4b02c0a05419cbc32a43f86 | [
"Apache-2.0"
] | null | null | null | mindspore/python/mindspore/common/parameter.py | zhz44/mindspore | 6044d34074c8505dd4b02c0a05419cbc32a43f86 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020-2022 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | 43.036212 | 120 | 0.631489 |
from copy import copy
import numbers
import numpy as np
from mindspore import log as logger
from .._c_expression import ParamInfo
from . import dtype as mstype
from .. import context
from ..parallel._utils import _get_parallel_mode
from .initializer import initializer
from .tensor import Tensor
from .._c... | true | true |
f71c553ec28422c6f3e48889698abd8e2489bc38 | 6,512 | py | Python | rootpy/logger/__init__.py | masonproffitt/rootpy | 3926935e1f2100d8ba68070c2ab44055d4800f73 | [
"BSD-3-Clause"
] | 146 | 2015-01-04T15:16:44.000Z | 2022-01-27T11:29:31.000Z | rootpy/logger/__init__.py | masonproffitt/rootpy | 3926935e1f2100d8ba68070c2ab44055d4800f73 | [
"BSD-3-Clause"
] | 143 | 2015-01-07T00:20:42.000Z | 2021-11-04T07:48:26.000Z | rootpy/logger/__init__.py | masonproffitt/rootpy | 3926935e1f2100d8ba68070c2ab44055d4800f73 | [
"BSD-3-Clause"
] | 56 | 2015-01-30T11:11:07.000Z | 2022-03-28T09:42:06.000Z | """
:py:mod:`rootpy` overrides the default logging class, inserting a check that
there exists a default logging handler. If there is not, it adds one.
In additon, this can be used to intercept ROOT's log messages and redirect them
through python's logging subsystem
Example use:
.. sourcecode:: python
# Disable ... | 31.157895 | 85 | 0.640971 | from __future__ import absolute_import
import logging
import os
import re
import sys
import threading
from functools import wraps
from time import time
from .utils import check_tty
from .extended_logger import ExtendedLogger
logging.setLoggerClass(ExtendedLogger)
log = logging.getLogger("rootpy")
if not os.environ.g... | true | true |
f71c5653c53151aeb46ae97e28196d989957f8df | 586 | py | Python | data/scripts/templates/object/mobile/shared_swirl_prong_hue.py | obi-two/GameServer | 7d37024e2291a97d49522610cd8f1dbe5666afc2 | [
"MIT"
] | 20 | 2015-02-23T15:11:56.000Z | 2022-03-18T20:56:48.000Z | data/scripts/templates/object/mobile/shared_swirl_prong_hue.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/mobile/shared_swirl_prong_hue.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | 20 | 2015-04-04T16:35:59.000Z | 2022-03-24T14:54:37.000Z | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_swirl_prong_hue.iff"
result.attribute_template_id = 9
result.... | 29.3 | 70 | 0.750853 | true | true | |
f71c568fa66d427f4b77e6e61c5dc1c0fa4fdaf1 | 815 | py | Python | src/lists/tests/test_home_page.py | dmitricus/django-docker | 46e99dc4f3d902e7fda56f85260358f80f505297 | [
"MIT"
] | null | null | null | src/lists/tests/test_home_page.py | dmitricus/django-docker | 46e99dc4f3d902e7fda56f85260358f80f505297 | [
"MIT"
] | null | null | null | src/lists/tests/test_home_page.py | dmitricus/django-docker | 46e99dc4f3d902e7fda56f85260358f80f505297 | [
"MIT"
] | null | null | null | from django.urls import resolve
from django.test import TestCase
from django.http import HttpRequest
from lists.views import home_page
class HomePageTest(TestCase):
"""Тест домашней страницы"""
def test_root_url_resolve_to_home_page_view(self):
"""Тест: корневой url преобразуется в представление дом... | 33.958333 | 80 | 0.696933 | from django.urls import resolve
from django.test import TestCase
from django.http import HttpRequest
from lists.views import home_page
class HomePageTest(TestCase):
def test_root_url_resolve_to_home_page_view(self):
found = resolve('/lists/')
self.assertEqual(found.func, home_page)
def test... | true | true |
f71c57de636f2f24120b2ff23112503d33da311e | 2,056 | py | Python | auth/oauth.py | fiam/wapi | e3f06505c18d5842bc186a5578c0fc3cc9b3a920 | [
"MIT"
] | 2 | 2016-05-09T02:32:38.000Z | 2019-04-21T12:07:51.000Z | auth/oauth.py | ingenieroariel/wapi | f083ae93f498262c634db20e6c27c3c4705cc1ec | [
"MIT"
] | null | null | null | auth/oauth.py | ingenieroariel/wapi | f083ae93f498262c634db20e6c27c3c4705cc1ec | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2008 Alberto García Hierro <fiam@rm-fr.net>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rig... | 40.313725 | 80 | 0.726167 |
from django.http import HttpResponse
from django.utils.translation import ugettext as _
from wapi.auth.base import ApiAuth
from oauthsp.request import OAuthRequest
from oauthsp.exceptions import OAuthError
class ApiAuthOAuth(ApiAuth):
def login(self, request):
oauth_request = OAuthRe... | false | true |
f71c5890e794a661a56497593ddf0dfcf0ad6fc7 | 9,686 | py | Python | main.py | trueleo/python-teletootbot | d033a79b05a13d10bd2d4f0bd68d4ecaa47f3cb3 | [
"MIT"
] | 4 | 2019-04-19T12:58:51.000Z | 2021-07-27T01:12:41.000Z | main.py | trueleo/python-teletootbot | d033a79b05a13d10bd2d4f0bd68d4ecaa47f3cb3 | [
"MIT"
] | null | null | null | main.py | trueleo/python-teletootbot | d033a79b05a13d10bd2d4f0bd68d4ecaa47f3cb3 | [
"MIT"
] | null | null | null | from telegram.ext import MessageHandler, Filters, CommandHandler, Updater
from mastodon import MastodonIllegalArgumentError, MastodonUnauthorizedError
import DataHandler
import threading
import os
import sys
import logging
import certifi
import urllib3
import re
bot_token = '<your bot token here>'
# secretfile = open... | 40.024793 | 305 | 0.661986 | from telegram.ext import MessageHandler, Filters, CommandHandler, Updater
from mastodon import MastodonIllegalArgumentError, MastodonUnauthorizedError
import DataHandler
import threading
import os
import sys
import logging
import certifi
import urllib3
import re
bot_token = '<your bot token here>'
logging.basicC... | true | true |
f71c58960b4d96b75911c82859c3b22907774f53 | 864 | py | Python | texteditor.py | p10rahulm/python-basics | d8f6172d42c465382d672a6813dccfbe6dff45a7 | [
"MIT"
] | null | null | null | texteditor.py | p10rahulm/python-basics | d8f6172d42c465382d672a6813dccfbe6dff45a7 | [
"MIT"
] | null | null | null | texteditor.py | p10rahulm/python-basics | d8f6172d42c465382d672a6813dccfbe6dff45a7 | [
"MIT"
] | null | null | null |
from tkinter import *
import tkinter.filedialog as tkFileDialog
root = Tk("Text Editor")
text = Text(root)
text.grid()
def saveas():
global text
t = text.get("1.0", "end-1c")
savelocation= tkFileDialog.asksaveasfilename()
file1=open(savelocation, "w+")
file1.write(t)
file1.close()
button=Butto... | 23.351351 | 86 | 0.725694 |
from tkinter import *
import tkinter.filedialog as tkFileDialog
root = Tk("Text Editor")
text = Text(root)
text.grid()
def saveas():
global text
t = text.get("1.0", "end-1c")
savelocation= tkFileDialog.asksaveasfilename()
file1=open(savelocation, "w+")
file1.write(t)
file1.close()
button=Butto... | true | true |
f71c58990649e0b8588522179070c5aec9ae9d99 | 93 | py | Python | moopy/comments/admin.py | qrizan/moopy | 10459351727710c77279f24f224786622abc91b8 | [
"MIT"
] | 1 | 2017-01-15T21:58:06.000Z | 2017-01-15T21:58:06.000Z | moopy/comments/admin.py | qrizan/moopy | 10459351727710c77279f24f224786622abc91b8 | [
"MIT"
] | null | null | null | moopy/comments/admin.py | qrizan/moopy | 10459351727710c77279f24f224786622abc91b8 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Comment
admin.site.register(Comment)
| 13.285714 | 32 | 0.806452 | from django.contrib import admin
from .models import Comment
admin.site.register(Comment)
| true | true |
f71c58e4c78d5b8915f7be9b2f64999c3533da13 | 3,659 | py | Python | Python Data Structure/A1Q1_Letian Xu.py | XULetian/Python_Fundamental | b901014a3257649cf1b3205ee6c17ba35184cad7 | [
"MIT"
] | null | null | null | Python Data Structure/A1Q1_Letian Xu.py | XULetian/Python_Fundamental | b901014a3257649cf1b3205ee6c17ba35184cad7 | [
"MIT"
] | null | null | null | Python Data Structure/A1Q1_Letian Xu.py | XULetian/Python_Fundamental | b901014a3257649cf1b3205ee6c17ba35184cad7 | [
"MIT"
] | null | null | null | # Letian Xu
# 01/10/2019
# I have not given or received any unauthorized assistance on this assignment.
def overlap(s1,s2):
'''
Arguments: s1 and s2 represent two lists, also represent a square.
Return: The area of the overlap of the two squares, if the squares do not overlap, return 0.
'''
# Use ... | 22.447853 | 96 | 0.496037 |
def overlap(s1,s2):
x1 = list(range(s1[0],s1[0]+s1[2]))
x2 = list(range(s2[0],s2[0]+s2[2]))
x = len(set(x1) & set(x2))
# and this is the lenth of two squares' overlap on y-axis
y1 = list(range(s1[1],s1[1]+s1[2]))
y2 = list(range(s2[1],s2[1]+s2[2]))
y = len(set(y1) & set(y... | true | true |
f71c5a07ef97232bc9ba249f594bbcbea596ebe9 | 747 | py | Python | pywhatkit/wwd.py | apoorvthedude/PyWhatKit | edc60ad44c11d4700b531be1bb86639ff3fce270 | [
"MIT"
] | 2 | 2022-01-15T00:53:30.000Z | 2022-01-16T22:56:23.000Z | pywhatkit/wwd.py | apoorvthedude/PyWhatKit | edc60ad44c11d4700b531be1bb86639ff3fce270 | [
"MIT"
] | null | null | null | pywhatkit/wwd.py | apoorvthedude/PyWhatKit | edc60ad44c11d4700b531be1bb86639ff3fce270 | [
"MIT"
] | null | null | null | import webbrowser as web
def tutorial_hindi() -> None:
"""Watch tutorial on how to use this library on YouTube in Hindi"""
web.open("https://youtu.be/o6WV9zFJg1o")
def tutorial_english() -> None:
"""Watch tutorial on how to use this library on YouTube in English"""
web.open("https://yo... | 27.666667 | 108 | 0.670683 | import webbrowser as web
def tutorial_hindi() -> None:
web.open("https://youtu.be/o6WV9zFJg1o")
def tutorial_english() -> None:
web.open("https://youtu.be/vpfrwpO_HKY")
def developer_contact() -> None:
link = "https://github.com/Ankit404butfound/PyWhatKit"
print(f"You can reach ... | true | true |
f71c5aa86d59a64428303d427cd50c450b530ad6 | 6,559 | py | Python | tilde/parsers/__init__.py | fossabot/tilde-1 | 143810a711f00dc1c64a6eb10573986dddadfcef | [
"MIT"
] | null | null | null | tilde/parsers/__init__.py | fossabot/tilde-1 | 143810a711f00dc1c64a6eb10573986dddadfcef | [
"MIT"
] | null | null | null | tilde/parsers/__init__.py | fossabot/tilde-1 | 143810a711f00dc1c64a6eb10573986dddadfcef | [
"MIT"
] | null | null | null |
# Generic parser schema
# with the default values
# Author: Evgeny Blokhin
import os, sys
import re
import time
import math
import random
import hashlib
import base64
from ase.data import chemical_symbols
class Output:
def __init__(self, filename='', calcset=False):
self._filename = filename # for qui... | 35.646739 | 318 | 0.479646 |
import os, sys
import re
import time
import math
import random
import hashlib
import base64
from ase.data import chemical_symbols
class Output:
def __init__(self, filename='', calcset=False):
self._filename = filename
self.data = ''
self._checksum = None
se... | true | true |
f71c5c0fa48035e54718849c2b4a1ba58fa91295 | 4,789 | py | Python | Models/opt_torch.py | tarkantemizoz/Cost-Sensitive-Learning | 083f8dfd2950b7e3874df34bf61c2ca1e4a91fbb | [
"Apache-2.0"
] | 2 | 2021-03-05T08:06:17.000Z | 2021-04-13T21:03:12.000Z | Models/opt_torch.py | tarkantemizoz/Cost-Sensitive-Learning | 083f8dfd2950b7e3874df34bf61c2ca1e4a91fbb | [
"Apache-2.0"
] | null | null | null | Models/opt_torch.py | tarkantemizoz/Cost-Sensitive-Learning | 083f8dfd2950b7e3874df34bf61c2ca1e4a91fbb | [
"Apache-2.0"
] | 1 | 2021-03-10T18:10:30.000Z | 2021-03-10T18:10:30.000Z | # coding: utf-8
# Copyright 2020 Tarkan Temizoz
# 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 agre... | 35.738806 | 91 | 0.554187 |
import time
import torch
import matplotlib.pyplot as plt
from sklearn.utils import shuffle
from Models.linearnet import LinearNet
class Optimization:
def __init__(self, model, optimizer, config):
self.model = model
self.optimizer = optimizer
self.train_return =... | true | true |
f71c5d5f8d7d8019ce24e7f8738fe2a3db585bd9 | 12,026 | py | Python | grabcut.py | nong-fu/grabcut | 19a43eed7597ffae456349e4f0568da2f8f1f25c | [
"Apache-2.0"
] | null | null | null | grabcut.py | nong-fu/grabcut | 19a43eed7597ffae456349e4f0568da2f8f1f25c | [
"Apache-2.0"
] | null | null | null | grabcut.py | nong-fu/grabcut | 19a43eed7597ffae456349e4f0568da2f8f1f25c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
import sys
from pathlib import Path
import webbrowser
import numpy as np
import cv2
from PIL import Image
from PyQt5.QtCore import QDir, Qt, pyqtSlot, pyqtSignal
from PyQt5.QtGui import QImage, QPixmap, QColor
from PyQt5.QtWidgets import (
QApplication, QMainWindow, QWidget,
QMessageBox, QFile... | 31.564304 | 80 | 0.606187 |
import sys
from pathlib import Path
import webbrowser
import numpy as np
import cv2
from PIL import Image
from PyQt5.QtCore import QDir, Qt, pyqtSlot, pyqtSignal
from PyQt5.QtGui import QImage, QPixmap, QColor
from PyQt5.QtWidgets import (
QApplication, QMainWindow, QWidget,
QMessageBox, QFileDialog, QLabel... | true | true |
f71c5d93e6fff0721c0bfffe7881cdff8bdc9c08 | 952 | py | Python | scripts/runAll.py | acatwithacomputer/proteus | 80dfad95da6ab4d18a88a035f55c26b03540a864 | [
"MIT"
] | null | null | null | scripts/runAll.py | acatwithacomputer/proteus | 80dfad95da6ab4d18a88a035f55c26b03540a864 | [
"MIT"
] | 13 | 2018-02-08T23:22:59.000Z | 2020-12-06T19:40:32.000Z | scripts/runAll.py | acatwithacomputer/proteus | 80dfad95da6ab4d18a88a035f55c26b03540a864 | [
"MIT"
] | 1 | 2020-02-17T03:25:34.000Z | 2020-02-17T03:25:34.000Z | #! /usr/bin/env python
from __future__ import print_function
import sys
import os
import glob
pFiles = glob.glob('*_p.py')
caseDict = {}
for pf in pFiles:
caseDict[pf] = set(glob.glob(pf[:-5]+'*_n.py'))
#fix cases were problem name is a subset of some other problem name
for pf1 in pFiles:
for pf2 in pFiles:
... | 31.733333 | 96 | 0.553571 |
from __future__ import print_function
import sys
import os
import glob
pFiles = glob.glob('*_p.py')
caseDict = {}
for pf in pFiles:
caseDict[pf] = set(glob.glob(pf[:-5]+'*_n.py'))
for pf1 in pFiles:
for pf2 in pFiles:
if pf2.find(pf1[:-4]):
nf1Set=set(glob.glob(pf1[:-5]+'*_n.py'))
... | true | true |
f71c5df90825c721c8d73769c1b51879fc9c7df2 | 2,706 | py | Python | runloop/adminx.py | luqin/firefly | 2e5ab17f2d20deb3c68c927f6208ea89db7c639d | [
"MIT"
] | null | null | null | runloop/adminx.py | luqin/firefly | 2e5ab17f2d20deb3c68c927f6208ea89db7c639d | [
"MIT"
] | 9 | 2020-03-24T16:45:25.000Z | 2022-03-11T23:40:51.000Z | runloop/adminx.py | luqin/firefly | 2e5ab17f2d20deb3c68c927f6208ea89db7c639d | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from django.forms import ModelMultipleChoiceField
from django.utils.translation import ugettext as _
import xadmin
from .xadmin_action import RunloopAction
from .models import RunLoopGroup, Orders
ACTION_NAME = {
'add': _('Can add %s'),
'change': _('Can change %s'),
... | 30.404494 | 117 | 0.64745 | from __future__ import absolute_import
from django.forms import ModelMultipleChoiceField
from django.utils.translation import ugettext as _
import xadmin
from .xadmin_action import RunloopAction
from .models import RunLoopGroup, Orders
ACTION_NAME = {
'add': _('Can add %s'),
'change': _('Can change %s'),
... | true | true |
f71c5ef0b1d632892fa3fd528d707dc54828ea6e | 16,431 | py | Python | pychron/mv/focus/autofocus_manager.py | ael-noblegas/pychron | 6ebbbb1f66a614972b62b7a9be4c784ae61b5d62 | [
"Apache-2.0"
] | 1 | 2019-02-27T21:57:44.000Z | 2019-02-27T21:57:44.000Z | pychron/mv/focus/autofocus_manager.py | ael-noblegas/pychron | 6ebbbb1f66a614972b62b7a9be4c784ae61b5d62 | [
"Apache-2.0"
] | 80 | 2018-07-17T20:10:20.000Z | 2021-08-17T15:38:24.000Z | pychron/mv/focus/autofocus_manager.py | AGESLDEO/pychron | 1a81e05d9fba43b797f335ceff6837c016633bcf | [
"Apache-2.0"
] | null | null | null | # ===============================================================================
# Copyright 2011 Jake Ross
#
# 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/licens... | 33.261134 | 93 | 0.559369 |
from __future__ import absolute_import
from __future__ import print_function
import six.moves.cPickle as pickle
from traits.api import Bool, Any, Instance, Button, Property, Event, on_trait_change
from traitsui.api import View, Item, Handler, HGroup
from threading import Event as TEvent
from numpy ... | true | true |
f71c5f4fe3f324377d2b741bc0a1bb84b3949735 | 602 | py | Python | gdrive_sync/migrations/0002_drivefile_video.py | mitodl/ocw-studio | 949f96ec0647064f8d495ebdd22d66eea7d024a5 | [
"BSD-3-Clause"
] | 2 | 2020-08-07T15:55:41.000Z | 2021-08-16T18:28:09.000Z | gdrive_sync/migrations/0002_drivefile_video.py | mitodl/ocw-studio | 949f96ec0647064f8d495ebdd22d66eea7d024a5 | [
"BSD-3-Clause"
] | 924 | 2020-08-10T17:54:19.000Z | 2022-03-31T21:15:17.000Z | gdrive_sync/migrations/0002_drivefile_video.py | mitodl/ocw-studio | 949f96ec0647064f8d495ebdd22d66eea7d024a5 | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 3.1.12 on 2021-08-09 17:27
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("videos", "0001_initial"),
("gdrive_sync", "0001_initial"),
]
operations = [
migrations.AddField(
... | 23.153846 | 61 | 0.546512 |
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("videos", "0001_initial"),
("gdrive_sync", "0001_initial"),
]
operations = [
migrations.AddField(
model_name="drivefile",
n... | true | true |
f71c5f5935f04be92603bb1df6e9e04ca6fbc926 | 9,829 | py | Python | main.py | GautamGunecha/KBC-Quiz | 9e78435aaf2a88c6dc2bd38324d9e0b807ac909d | [
"MIT"
] | null | null | null | main.py | GautamGunecha/KBC-Quiz | 9e78435aaf2a88c6dc2bd38324d9e0b807ac909d | [
"MIT"
] | null | null | null | main.py | GautamGunecha/KBC-Quiz | 9e78435aaf2a88c6dc2bd38324d9e0b807ac909d | [
"MIT"
] | null | null | null | # Python Quiz Game
import time
from pygame import mixer
mixer.init()
mixer.music.load("Audio/KBCMAIN.mp3")
mixer.music.set_volume(0.2)
mixer.music.play()
print("Let's Play Kaun Banega Crorepati")
name = input("Please Enter your Name: ")
print("Welcome", name)
decision = input("Do you want to play KBC(Yes/No): ")
deci... | 29.428144 | 126 | 0.630786 |
import time
from pygame import mixer
mixer.init()
mixer.music.load("Audio/KBCMAIN.mp3")
mixer.music.set_volume(0.2)
mixer.music.play()
print("Let's Play Kaun Banega Crorepati")
name = input("Please Enter your Name: ")
print("Welcome", name)
decision = input("Do you want to play KBC(Yes/No): ")
decision = decision.lo... | true | true |
f71c608e5b1cc741cd572c1921ad56281e09b9eb | 2,400 | py | Python | contrib/python/Jinja2/tests/test_utils.py | HeyLey/catboost | f472aed90604ebe727537d9d4a37147985e10ec2 | [
"Apache-2.0"
] | 1 | 2019-01-26T02:58:50.000Z | 2019-01-26T02:58:50.000Z | contrib/python/Jinja2/tests/test_utils.py | HeyLey/catboost | f472aed90604ebe727537d9d4a37147985e10ec2 | [
"Apache-2.0"
] | 1 | 2019-07-29T12:25:53.000Z | 2019-07-29T12:25:53.000Z | contrib/python/Jinja2/tests/test_utils.py | HeyLey/catboost | f472aed90604ebe727537d9d4a37147985e10ec2 | [
"Apache-2.0"
] | 1 | 2020-11-11T16:56:19.000Z | 2020-11-11T16:56:19.000Z | # -*- coding: utf-8 -*-
"""
jinja2.testsuite.utils
~~~~~~~~~~~~~~~~~~~~~~
Tests utilities jinja uses.
:copyright: (c) 2017 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import gc
import pytest
import pickle
from jinja2.utils import LRUCache, escape, object_type_repr, urliz... | 27.586207 | 76 | 0.558333 |
import gc
import pytest
import pickle
from jinja2.utils import LRUCache, escape, object_type_repr, urlize, \
select_autoescape
@pytest.mark.utils
@pytest.mark.lrucache
class TestLRUCache(object):
def test_simple(self):
d = LRUCache(3)
d["a"] = 1
d["b"] = 2
d["c"] = 3
... | true | true |
f71c6158b5131e8416bc7f571ce69e11b023703b | 52,287 | py | Python | dendropy/test/test_datamodel_tree_list.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | dendropy/test/test_datamodel_tree_list.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | dendropy/test/test_datamodel_tree_list.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | # !/usr/bin/env python
##############################################################################
## DendroPy Phylogenetic Computing Library.
##
## Copyright 2010-2015 Jeet Sukumaran and Mark T. Holder.
## All rights reserved.
##
## See "LICENSE.rst" for terms and conditions of usage.
##
## If you use this wo... | 44.499574 | 129 | 0.613785 |
ls))
for t1, tlabel in zip(tlist, expected_tree_labels):
self.assertIn(t1, tlist)
if tlabel in source_tree_labels:
self.assertIn(t1, source_trees)
else:
self.assertNotIn(t1, source_trees)
self.assertIs(t1.taxon_namespace, tlist.ta... | true | true |
f71c6192795695fce398b118465ead2235f638d3 | 263 | py | Python | services/movies_billing/subscription_service/src/models/customer.py | fuodorov/yacinema | 43ad869575fbaab7c7056229538638666aa87110 | [
"MIT"
] | null | null | null | services/movies_billing/subscription_service/src/models/customer.py | fuodorov/yacinema | 43ad869575fbaab7c7056229538638666aa87110 | [
"MIT"
] | null | null | null | services/movies_billing/subscription_service/src/models/customer.py | fuodorov/yacinema | 43ad869575fbaab7c7056229538638666aa87110 | [
"MIT"
] | 1 | 2021-09-30T09:49:40.000Z | 2021-09-30T09:49:40.000Z | from sqlalchemy import String, ForeignKey, Integer, Enum
from .base import AbstractModel, RequiredColumn
class Customer(AbstractModel):
__tablename__ = "customer"
user_id = RequiredColumn(String(50))
stripe_customer_id = RequiredColumn(String(50))
| 26.3 | 56 | 0.775665 | from sqlalchemy import String, ForeignKey, Integer, Enum
from .base import AbstractModel, RequiredColumn
class Customer(AbstractModel):
__tablename__ = "customer"
user_id = RequiredColumn(String(50))
stripe_customer_id = RequiredColumn(String(50))
| true | true |
f71c61dd6a6ae22677f0c87104c88f4220333ae8 | 234 | py | Python | physionet-django/project/fileviews/image.py | Lucas-Mc/physionet-build | 77da5da6273cf3f5f2afce95dc5d0ce3302741ca | [
"BSD-3-Clause"
] | 36 | 2019-02-14T18:10:39.000Z | 2022-01-21T12:48:52.000Z | physionet-django/project/fileviews/image.py | Lucas-Mc/physionet-build | 77da5da6273cf3f5f2afce95dc5d0ce3302741ca | [
"BSD-3-Clause"
] | 1,051 | 2019-01-31T18:03:14.000Z | 2022-03-31T20:53:04.000Z | physionet-django/project/fileviews/image.py | Lucas-Mc/physionet-build | 77da5da6273cf3f5f2afce95dc5d0ce3302741ca | [
"BSD-3-Clause"
] | 13 | 2019-03-26T11:02:32.000Z | 2022-03-17T11:39:49.000Z | from project.fileviews.base import FileView
class ImageFileView(FileView):
"""
Class for displaying image files.
"""
def render(self, request):
return super().render(request, 'project/file_view_image.html')
| 21.272727 | 70 | 0.692308 | from project.fileviews.base import FileView
class ImageFileView(FileView):
def render(self, request):
return super().render(request, 'project/file_view_image.html')
| true | true |
f71c63d30ec047c7337fa37ae62317af4f4cdf92 | 2,398 | py | Python | model_zoo/official/cv/alexnet/export.py | dongkcs/mindspore | cd7df6dbf463ff3128e9181e9d0c779cecb81320 | [
"Apache-2.0"
] | 2 | 2020-11-23T13:46:37.000Z | 2020-12-20T02:02:38.000Z | model_zoo/official/cv/alexnet/export.py | dongkcs/mindspore | cd7df6dbf463ff3128e9181e9d0c779cecb81320 | [
"Apache-2.0"
] | null | null | null | model_zoo/official/cv/alexnet/export.py | dongkcs/mindspore | cd7df6dbf463ff3128e9181e9d0c779cecb81320 | [
"Apache-2.0"
] | 1 | 2021-01-01T08:35:01.000Z | 2021-01-01T08:35:01.000Z | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 42.821429 | 111 | 0.685988 |
import argparse
import numpy as np
import mindspore as ms
from mindspore import Tensor
from mindspore import context
from mindspore.train.serialization import load_checkpoint, load_param_into_net, export
from src.config import alexnet_cifar10_cfg, alexnet_imagenet_cfg
from src.alexnet import AlexNet
if... | true | true |
f71c6605bc3c94744764c205c3291d67c5416f2f | 624 | py | Python | setup.py | tianjianjiang/bigscience-metadata | 3460c8d2bca2c818646feb3b49c50b351b51ad70 | [
"Apache-2.0"
] | null | null | null | setup.py | tianjianjiang/bigscience-metadata | 3460c8d2bca2c818646feb3b49c50b351b51ad70 | [
"Apache-2.0"
] | null | null | null | setup.py | tianjianjiang/bigscience-metadata | 3460c8d2bca2c818646feb3b49c50b351b51ad70 | [
"Apache-2.0"
] | null | null | null | from setuptools import find_packages, setup
def req_file(filename):
with open(filename) as f:
content = f.readlines()
return [x.strip() for x in content]
install_requires = req_file("requirements.txt")
setup(
name="bsmetadata",
python_requires=">=3.7.11, <3.10",
version="0.1.0",
url... | 27.130435 | 121 | 0.698718 | from setuptools import find_packages, setup
def req_file(filename):
with open(filename) as f:
content = f.readlines()
return [x.strip() for x in content]
install_requires = req_file("requirements.txt")
setup(
name="bsmetadata",
python_requires=">=3.7.11, <3.10",
version="0.1.0",
url... | true | true |
f71c66238339944e28e835fcee02bfdd0f475eda | 1,171 | py | Python | setup.py | judoscale/judoscale-python | 3a2c82921ec5feb81d2691037b9bf13e94f7e5c9 | [
"MIT"
] | null | null | null | setup.py | judoscale/judoscale-python | 3a2c82921ec5feb81d2691037b9bf13e94f7e5c9 | [
"MIT"
] | null | null | null | setup.py | judoscale/judoscale-python | 3a2c82921ec5feb81d2691037b9bf13e94f7e5c9 | [
"MIT"
] | null | null | null | import setuptools
# To publish:
#
# - Update VERSION constant below
# - python3 -m pip install --upgrade build twine
# - rm -rf dist && python3 -m build
# - python3 -m twine upload dist/*
# - Username is __token__, password is token value
VERSION = "1.0.0rc1"
INSTALL_REQUIRES = ["requests<3.0.0"]
with ... | 30.815789 | 91 | 0.674637 | import setuptools
VERSION = "1.0.0rc1"
INSTALL_REQUIRES = ["requests<3.0.0"]
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name="judoscale-python",
version=VERSION,
author="Adam McCrea",
author_email="adam@adamlogic.com",
descripti... | true | true |
f71c68260a4ae6f5fd97179a6c4e00a92144ea7f | 36,156 | py | Python | zerver/migrations/0001_initial.py | N-Shar-ma/zulip | 95303a9929424b55a1f7c7cce9313c4619a9533b | [
"Apache-2.0"
] | 4 | 2021-09-16T16:46:55.000Z | 2022-02-06T13:00:21.000Z | zerver/migrations/0001_initial.py | jai2201/zulip | 95303a9929424b55a1f7c7cce9313c4619a9533b | [
"Apache-2.0"
] | null | null | null | zerver/migrations/0001_initial.py | jai2201/zulip | 95303a9929424b55a1f7c7cce9313c4619a9533b | [
"Apache-2.0"
] | null | null | null | # Generated by Django 1.11.2 on 2017-06-22 10:22
import bitfield.models
import django.contrib.auth.models
import django.core.validators
import django.db.models.deletion
import django.utils.timezone
from django.conf import settings
from django.contrib.postgres.indexes import GinIndex
from django.contrib.postgres.search ... | 38.545842 | 126 | 0.491841 |
import bitfield.models
import django.contrib.auth.models
import django.core.validators
import django.db.models.deletion
import django.utils.timezone
from django.conf import settings
from django.contrib.postgres.indexes import GinIndex
from django.contrib.postgres.search import SearchVectorField
from django.db import m... | true | true |
f71c69a2524bdf3501491590fb98b0dba43692e4 | 3,863 | py | Python | img_filter/img_advanced_filter.py | Gretacyh/images-downloader-fliter | ffe070026a45c741013a575a6a985d97e28d6fd7 | [
"ICU",
"MIT"
] | null | null | null | img_filter/img_advanced_filter.py | Gretacyh/images-downloader-fliter | ffe070026a45c741013a575a6a985d97e28d6fd7 | [
"ICU",
"MIT"
] | null | null | null | img_filter/img_advanced_filter.py | Gretacyh/images-downloader-fliter | ffe070026a45c741013a575a6a985d97e28d6fd7 | [
"ICU",
"MIT"
] | null | null | null | import os
import re
import cv2
import umap
import torch
import torch.nn as nn
from torchvision import models
import torch.nn.functional as F
import numpy as np
from sklearn.manifold import TSNE
import matplotlib.pyplot as plt
def global_std_pool2d(x):
"""2D global standard variation pooling"""
return torch.st... | 30.904 | 102 | 0.619467 | import os
import re
import cv2
import umap
import torch
import torch.nn as nn
from torchvision import models
import torch.nn.functional as F
import numpy as np
from sklearn.manifold import TSNE
import matplotlib.pyplot as plt
def global_std_pool2d(x):
return torch.std(x.view(x.size()[0], x.size()[1], -1, 1), dim=... | true | true |
f71c6a899f50afd65c97f6d10559da3bf89ef5b8 | 162 | py | Python | querybuilder_rules/compat.py | Apkawa/django-querybuilder-rules | 430488f6e50be7ac74b5b757c9bef0d09e49301b | [
"MIT"
] | null | null | null | querybuilder_rules/compat.py | Apkawa/django-querybuilder-rules | 430488f6e50be7ac74b5b757c9bef0d09e49301b | [
"MIT"
] | null | null | null | querybuilder_rules/compat.py | Apkawa/django-querybuilder-rules | 430488f6e50be7ac74b5b757c9bef0d09e49301b | [
"MIT"
] | null | null | null | try:
from django.utils.encoding import smart_text, smart_str
except ImportError:
from django.utils.encoding import smart_unicode as smart_text, smart_str
| 32.4 | 76 | 0.808642 | try:
from django.utils.encoding import smart_text, smart_str
except ImportError:
from django.utils.encoding import smart_unicode as smart_text, smart_str
| true | true |
f71c6b46358edba34d7bcd2375000838bace4301 | 2,623 | py | Python | acme/tf/networks/__init__.py | RaoulDrake/acme | 16ad2f284ad7c038081454a9b820d8f424b3ad1f | [
"Apache-2.0"
] | 1 | 2021-06-17T16:11:43.000Z | 2021-06-17T16:11:43.000Z | acme/tf/networks/__init__.py | RaoulDrake/acme | 16ad2f284ad7c038081454a9b820d8f424b3ad1f | [
"Apache-2.0"
] | null | null | null | acme/tf/networks/__init__.py | RaoulDrake/acme | 16ad2f284ad7c038081454a9b820d8f424b3ad1f | [
"Apache-2.0"
] | null | null | null | # python3
# Copyright 2018 DeepMind Technologies Limited. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 48.574074 | 74 | 0.847884 |
from acme.tf.networks.atari import AtariTorso
from acme.tf.networks.atari import DeepIMPALAAtariNetwork
from acme.tf.networks.atari import DQNAtariNetwork
from acme.tf.networks.atari import IMPALAAtariNetwork
from acme.tf.networks.atari import R2D2AtariNetwork
from acme.tf.networks.base import Distribut... | true | true |
f71c6bd2042d817dbc78da43dc684306860b7f69 | 1,029 | py | Python | pyquilted/pdf_printer.py | cocoroutine/pyquilted | dd8644043deec17608e00f46e3ac4562b8879603 | [
"MIT"
] | 1 | 2019-02-21T20:10:37.000Z | 2019-02-21T20:10:37.000Z | pyquilted/pdf_printer.py | cocoroutine/pyquilted | dd8644043deec17608e00f46e3ac4562b8879603 | [
"MIT"
] | null | null | null | pyquilted/pdf_printer.py | cocoroutine/pyquilted | dd8644043deec17608e00f46e3ac4562b8879603 | [
"MIT"
] | null | null | null | import pdfkit
class PdfPrinter:
"""A wrapper class around pdfkit functionality to print html to pdfs"""
@staticmethod
def from_file(infile, outfile):
options = {
"page-size": "Letter",
"dpi": "96",
"margin-top": "1in",
"margin-right":... | 31.181818 | 75 | 0.462585 | import pdfkit
class PdfPrinter:
@staticmethod
def from_file(infile, outfile):
options = {
"page-size": "Letter",
"dpi": "96",
"margin-top": "1in",
"margin-right": "1.25in",
"margin-bottom": "1in",
"margin-l... | true | true |
f71c6bda42c3ee94832851be22cdd754e1af0b13 | 1,164 | py | Python | example_app/app.py | quanpower/flask_jsondash | 274c41bcbc754fd217b7dc4679c377bac912b88d | [
"MIT"
] | 1 | 2017-09-01T16:08:49.000Z | 2017-09-01T16:08:49.000Z | example_app/app.py | quanpower/flask_jsondash | 274c41bcbc754fd217b7dc4679c377bac912b88d | [
"MIT"
] | null | null | null | example_app/app.py | quanpower/flask_jsondash | 274c41bcbc754fd217b7dc4679c377bac912b88d | [
"MIT"
] | null | null | null | """This is an example app, demonstrating usage."""
import os
from flask import Flask
from flask_jsondash.charts_builder import charts
app = Flask(__name__)
app.config['SECRET_KEY'] = 'NOTSECURELOL'
app.config.update(
JSONDASH_FILTERUSERS=False,
JSONDASH_GLOBALDASH=True,
JSONDASH_GLOBAL_USER='global',
)
... | 18.1875 | 62 | 0.652921 |
import os
from flask import Flask
from flask_jsondash.charts_builder import charts
app = Flask(__name__)
app.config['SECRET_KEY'] = 'NOTSECURELOL'
app.config.update(
JSONDASH_FILTERUSERS=False,
JSONDASH_GLOBALDASH=True,
JSONDASH_GLOBAL_USER='global',
)
app.debug = True
app.register_blueprint(charts)
d... | true | true |
f71c6d6149e0b6acd0b94e3af246e4aa23a4b08d | 10,495 | py | Python | grr/client/grr_response_client/client_actions/admin.py | tsehori/grr | 048506f22f74642bfe61749069a45ddf496fdab3 | [
"Apache-2.0"
] | 1 | 2021-07-01T01:43:06.000Z | 2021-07-01T01:43:06.000Z | grr/client/grr_response_client/client_actions/admin.py | tsehori/grr | 048506f22f74642bfe61749069a45ddf496fdab3 | [
"Apache-2.0"
] | 44 | 2021-05-14T22:49:24.000Z | 2022-03-13T21:54:02.000Z | grr/client/grr_response_client/client_actions/admin.py | tsehori/grr | 048506f22f74642bfe61749069a45ddf496fdab3 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Lint as: python3
"""Client actions related to administrating the client and its configuration."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import logging
import os
import platform
import socket
import traceback
import crypto... | 32.292308 | 80 | 0.723106 |
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import logging
import os
import platform
import socket
import traceback
import cryptography
from cryptography.hazmat.backends import openssl
import pkg_resources
import psutil
import pytsk3
import yara
fr... | true | true |
f71c6da0c8beda1979477eff278dde12b8d91849 | 1,317 | py | Python | social_fabric/network_template_processor.py | social-fabric/social-fabric | 5b6adacf4717865a262bf4364fac62f945c52f41 | [
"Apache-2.0"
] | null | null | null | social_fabric/network_template_processor.py | social-fabric/social-fabric | 5b6adacf4717865a262bf4364fac62f945c52f41 | [
"Apache-2.0"
] | null | null | null | social_fabric/network_template_processor.py | social-fabric/social-fabric | 5b6adacf4717865a262bf4364fac62f945c52f41 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2020 - Neptunium Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
from jinja2 import Environment, FileSystemLoader, StrictUndefined
from social_fabric.config_repo import ConfigRepo
class NetworkTemplateProcessor:
def __init__(self):
self.file_loader = FileSystemLoader(ConfigRepo.TEMPLAT... | 38.735294 | 103 | 0.593014 |
from jinja2 import Environment, FileSystemLoader, StrictUndefined
from social_fabric.config_repo import ConfigRepo
class NetworkTemplateProcessor:
def __init__(self):
self.file_loader = FileSystemLoader(ConfigRepo.TEMPLATE_SRC_DIR)
self.env = Environment(loader=self.file_loader, undefined=St... | true | true |
f71c6e32018acdc987579657fa46ba5d3cf922de | 6,231 | py | Python | crabageprediction/venv/Lib/site-packages/matplotlib/tests/test_sphinxext.py | 13rianlucero/CrabAgePrediction | 92bc7fbe1040f49e820473e33cc3902a5a7177c7 | [
"MIT"
] | 7 | 2022-01-16T12:28:16.000Z | 2022-03-04T15:31:45.000Z | crabageprediction/venv/Lib/site-packages/matplotlib/tests/test_sphinxext.py | 13rianlucero/CrabAgePrediction | 92bc7fbe1040f49e820473e33cc3902a5a7177c7 | [
"MIT"
] | 5 | 2022-01-16T10:08:41.000Z | 2022-01-20T05:34:09.000Z | crabageprediction/venv/Lib/site-packages/matplotlib/tests/test_sphinxext.py | 13rianlucero/CrabAgePrediction | 92bc7fbe1040f49e820473e33cc3902a5a7177c7 | [
"MIT"
] | 4 | 2022-02-04T22:58:27.000Z | 2022-02-14T19:29:18.000Z | """Tests for tinypages build using sphinx extensions."""
import filecmp
import os
from pathlib import Path
import shutil
from subprocess import Popen, PIPE
import sys
import pytest
pytest.importorskip('sphinx',
minversion=None if sys.version_info < (3, 10) else '4.1.3')
def test_tinypages(tmpd... | 44.507143 | 79 | 0.69074 |
import filecmp
import os
from pathlib import Path
import shutil
from subprocess import Popen, PIPE
import sys
import pytest
pytest.importorskip('sphinx',
minversion=None if sys.version_info < (3, 10) else '4.1.3')
def test_tinypages(tmpdir):
source_dir = Path(tmpdir) / 'src'
shutil.cop... | true | true |
f71c6f7492e390d017ea6f6fa7414b737b27c660 | 7,147 | py | Python | distributed/tests/test_as_completed.py | abduhbm/distributed | d99752e030e2534c1f064865e2241289fedfe5a9 | [
"BSD-3-Clause"
] | null | null | null | distributed/tests/test_as_completed.py | abduhbm/distributed | d99752e030e2534c1f064865e2241289fedfe5a9 | [
"BSD-3-Clause"
] | null | null | null | distributed/tests/test_as_completed.py | abduhbm/distributed | d99752e030e2534c1f064865e2241289fedfe5a9 | [
"BSD-3-Clause"
] | null | null | null | import asyncio
from collections.abc import Iterator
from operator import add
import queue
import random
from time import sleep
import pytest
from tornado import gen
from distributed.client import _as_completed, as_completed, _first_completed, wait
from distributed.metrics import time
from distributed.utils import Can... | 24.644828 | 82 | 0.622219 | import asyncio
from collections.abc import Iterator
from operator import add
import queue
import random
from time import sleep
import pytest
from tornado import gen
from distributed.client import _as_completed, as_completed, _first_completed, wait
from distributed.metrics import time
from distributed.utils import Can... | true | true |
f71c6fe7ef5eb499ee506fe71c00dd30ce728f85 | 14,768 | py | Python | pdf2image/pdf2image.py | ldevandiere/pdf2image | ba11f6a931337c889ac739f6b41a7e78690d6d32 | [
"MIT"
] | null | null | null | pdf2image/pdf2image.py | ldevandiere/pdf2image | ba11f6a931337c889ac739f6b41a7e78690d6d32 | [
"MIT"
] | null | null | null | pdf2image/pdf2image.py | ldevandiere/pdf2image | ba11f6a931337c889ac739f6b41a7e78690d6d32 | [
"MIT"
] | null | null | null | """
pdf2image is a light wrapper for the poppler-utils tools that can convert your
PDFs into Pillow images.
"""
import os
import platform
import tempfile
import types
import shutil
import pathlib
from subprocess import Popen, PIPE
from PIL import Image
from .generators import uuid_generator, counter_generato... | 31.090526 | 101 | 0.609223 |
import os
import platform
import tempfile
import types
import shutil
import pathlib
from subprocess import Popen, PIPE
from PIL import Image
from .generators import uuid_generator, counter_generator, ThreadSafeGenerator
from .parsers import (
parse_buffer_to_pgm,
parse_buffer_to_ppm,
parse_buffer_to_jpe... | true | true |
f71c70ebaffb4cb67ea8865b24dfc0fdb55a9000 | 2,986 | py | Python | resources/test_data/honeycomb/pbb/pbb.py | preym17/csit | 3151c98618c78e3782e48bbe4d9c8f906c126f69 | [
"Apache-2.0"
] | null | null | null | resources/test_data/honeycomb/pbb/pbb.py | preym17/csit | 3151c98618c78e3782e48bbe4d9c8f906c126f69 | [
"Apache-2.0"
] | null | null | null | resources/test_data/honeycomb/pbb/pbb.py | preym17/csit | 3151c98618c78e3782e48bbe4d9c8f906c126f69 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2016 Cisco and/or its affiliates.
# 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 ag... | 28.711538 | 74 | 0.598794 |
cfg_pbb_sub_if_1 = {
"pbb-rewrite": {
"source-address": "aa:aa:aa:aa:aa:ab",
"destination-address": "bb:bb:bb:bb:bb:bc",
"b-vlan-tag-vlan-id": "2223",
"outer-tag": "16",
"i-tag-isid": "12",
"interface-operation": "translate-2-1"
}
}
cfg_pbb_su... | true | true |
f71c717d6fee0d1489bbe83962abdd173aae3304 | 668 | py | Python | setup.py | ishine/fastHan | 09550a750bb06b89b81769b8786a7eb3f8ca5713 | [
"Apache-2.0"
] | 635 | 2020-06-11T12:32:53.000Z | 2022-03-31T09:31:32.000Z | setup.py | ishine/fastHan | 09550a750bb06b89b81769b8786a7eb3f8ca5713 | [
"Apache-2.0"
] | 37 | 2020-06-12T10:07:47.000Z | 2022-03-10T02:46:52.000Z | setup.py | ishine/fastHan | 09550a750bb06b89b81769b8786a7eb3f8ca5713 | [
"Apache-2.0"
] | 77 | 2020-06-11T17:08:17.000Z | 2022-03-30T05:40:10.000Z | #!/usr/bin/env python
# coding=utf-8
from setuptools import setup, find_packages
with open('README.md', encoding='utf-8') as f:
readme = f.read()
with open('requirements.txt', encoding='utf-8') as f:
reqs = f.read()
pkgs = [p for p in find_packages()]
print(pkgs)
setup(
name='fastHan',
version='1.7... | 21.548387 | 53 | 0.652695 |
from setuptools import setup, find_packages
with open('README.md', encoding='utf-8') as f:
readme = f.read()
with open('requirements.txt', encoding='utf-8') as f:
reqs = f.read()
pkgs = [p for p in find_packages()]
print(pkgs)
setup(
name='fastHan',
version='1.7',
url='https://github.com/fast... | true | true |
f71c719a80b561157aaf6bc9411436cc6e44d60f | 3,425 | py | Python | minemeld/ft/vt.py | zul126/minemeld-core | 2eb9b9bfd7654aee57aabd5fb280d4e89a438daf | [
"Apache-2.0"
] | 147 | 2016-07-22T18:15:49.000Z | 2022-03-26T23:32:44.000Z | minemeld/ft/vt.py | zul126/minemeld-core | 2eb9b9bfd7654aee57aabd5fb280d4e89a438daf | [
"Apache-2.0"
] | 167 | 2016-07-27T07:02:25.000Z | 2021-12-16T16:26:52.000Z | minemeld/ft/vt.py | zul126/minemeld-core | 2eb9b9bfd7654aee57aabd5fb280d4e89a438daf | [
"Apache-2.0"
] | 112 | 2016-07-22T07:14:29.000Z | 2022-03-24T18:43:12.000Z | # Copyright 2016 Palo Alto Networks, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | 30.580357 | 94 | 0.616058 |
import logging
import os
import yaml
from . import json
LOG = logging.getLogger(__name__)
_VT_NOTIFICATIONS = 'https://www.virustotal.com/intelligence/hunting/notifications-feed/?key='
class Notifications(json.SimpleJSON):
def __init__(self, name, chassis, config):
super(Notifications, s... | true | true |
f71c722935297413c44452739b1c5efe80dcce1c | 5,736 | py | Python | tests/test_ac.py | knovichikhin/pyemv | 4a07cb550f27618822b530c6aa954e0820020ae7 | [
"MIT"
] | 14 | 2020-11-01T11:44:41.000Z | 2022-03-24T15:53:23.000Z | tests/test_ac.py | manoutoftime/pyemv | 4a07cb550f27618822b530c6aa954e0820020ae7 | [
"MIT"
] | 3 | 2021-06-18T01:36:00.000Z | 2021-10-17T02:09:50.000Z | tests/test_ac.py | manoutoftime/pyemv | 4a07cb550f27618822b530c6aa954e0820020ae7 | [
"MIT"
] | 8 | 2020-10-09T20:23:39.000Z | 2022-03-31T00:56:47.000Z | import pytest
from pyemv import ac
def test_generate_ac_exception() -> None:
# SK < 16 bytes
with pytest.raises(
ValueError,
match="Session Key must be a double length DES key",
):
ac.generate_ac(
sk_ac=bytes.fromhex("AAAAAAAAAAAAAAAA"),
data=bytes.fromhex(... | 30.031414 | 84 | 0.591702 | import pytest
from pyemv import ac
def test_generate_ac_exception() -> None:
with pytest.raises(
ValueError,
match="Session Key must be a double length DES key",
):
ac.generate_ac(
sk_ac=bytes.fromhex("AAAAAAAAAAAAAAAA"),
data=bytes.fromhex("12345678901214... | true | true |
f71c735f5bbe363994606cb49a6742b243a951ed | 2,203 | py | Python | DeepJIT/train.py | ZZR0/ISSTA21-JIT-DP | c2916f7c3b1d235ff2858220886d6a7da068bf8a | [
"MIT"
] | 14 | 2021-07-12T07:29:57.000Z | 2022-01-18T07:01:46.000Z | DeepJIT/train.py | ZZR0/ISSTA21-JIT-DP | c2916f7c3b1d235ff2858220886d6a7da068bf8a | [
"MIT"
] | null | null | null | DeepJIT/train.py | ZZR0/ISSTA21-JIT-DP | c2916f7c3b1d235ff2858220886d6a7da068bf8a | [
"MIT"
] | 7 | 2021-05-19T21:51:36.000Z | 2022-03-29T13:57:54.000Z | from model import DeepJIT
import torch
from tqdm import tqdm
from utils import mini_batches_train, save
import torch.nn as nn
import os, datetime
def train_model(data, params):
data_pad_msg, data_pad_code, data_labels, dict_msg, dict_code = data
# set up parameters
params.cuda = (not params.no_cuda) ... | 40.054545 | 128 | 0.635951 | from model import DeepJIT
import torch
from tqdm import tqdm
from utils import mini_batches_train, save
import torch.nn as nn
import os, datetime
def train_model(data, params):
data_pad_msg, data_pad_code, data_labels, dict_msg, dict_code = data
params.cuda = (not params.no_cuda) and torch.cuda.is_a... | true | true |
f71c73b92c22513c6d322953955170aa4fd2838a | 524 | py | Python | BackEnd/testModel/mymodel/migrations/0012_auto_20180603_2214.py | WindyMen/BackEnd | d3e33b1b57734fcefda494793ed940e5b079c36b | [
"Apache-2.0"
] | 1 | 2018-06-28T02:35:15.000Z | 2018-06-28T02:35:15.000Z | BackEnd/testModel/mymodel/migrations/0012_auto_20180603_2214.py | WindyMen/BackEnd | d3e33b1b57734fcefda494793ed940e5b079c36b | [
"Apache-2.0"
] | null | null | null | BackEnd/testModel/mymodel/migrations/0012_auto_20180603_2214.py | WindyMen/BackEnd | d3e33b1b57734fcefda494793ed940e5b079c36b | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.0.3 on 2018-06-03 14:14
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('mymodel', '0011_auto_20180603_2208'),
]
operations = [
migrations.AlterField(
mod... | 26.2 | 140 | 0.624046 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('mymodel', '0011_auto_20180603_2208'),
]
operations = [
migrations.AlterField(
model_name='room',
name='owner',
... | true | true |
f71c73d0a50c3eaf71f966a8af555fc36e37ec03 | 1,026 | py | Python | sortosm.py | TimSC/osm-to-gps-map | cedae6752b16e6f3e02a75f0a0ef784fd70298bf | [
"Unlicense"
] | 1 | 2020-06-15T02:22:08.000Z | 2020-06-15T02:22:08.000Z | sortosm.py | TimSC/osm-to-gps-map | cedae6752b16e6f3e02a75f0a0ef784fd70298bf | [
"Unlicense"
] | null | null | null | sortosm.py | TimSC/osm-to-gps-map | cedae6752b16e6f3e02a75f0a0ef784fd70298bf | [
"Unlicense"
] | null | null | null | import xml.etree.ElementTree as ET
import bz2, sys
def SortOsm(inFina, outFina):
fi = bz2.BZ2File(inFina)
root = ET.fromstring(fi.read())
fi.close()
objDict = {}
for obj in root:
if 'id' in obj.attrib:
i = int(obj.attrib['id'])
#print obj.tag, i
if obj.tag not in objDict:
objDict[obj.tag] = {}
... | 20.52 | 49 | 0.645224 | import xml.etree.ElementTree as ET
import bz2, sys
def SortOsm(inFina, outFina):
fi = bz2.BZ2File(inFina)
root = ET.fromstring(fi.read())
fi.close()
objDict = {}
for obj in root:
if 'id' in obj.attrib:
i = int(obj.attrib['id'])
if obj.tag not in objDict:
objDict[obj.tag] = {}
objDict[obj.tag]... | true | true |
f71c7496c320b6938b1d6b9ee7d678add526adf7 | 4,780 | py | Python | salt/pillar/libvirt.py | hvnsweeting/salt | abc9d3a0b51e6f5c4738cf71c221daf8b46fddcf | [
"Apache-2.0"
] | 2 | 2015-09-21T14:13:30.000Z | 2016-02-12T11:33:46.000Z | salt/pillar/libvirt.py | hvnsweeting/salt | abc9d3a0b51e6f5c4738cf71c221daf8b46fddcf | [
"Apache-2.0"
] | null | null | null | salt/pillar/libvirt.py | hvnsweeting/salt | abc9d3a0b51e6f5c4738cf71c221daf8b46fddcf | [
"Apache-2.0"
] | 2 | 2017-01-05T16:14:59.000Z | 2019-01-31T23:15:25.000Z | # -*- coding: utf-8 -*-
'''
Load up the libvirt keys into Pillar for a given minion if said keys have been generated using the libvirt key runner
'''
from __future__ import absolute_import
# Don't "fix" the above docstring to put it on two lines, as the sphinx
# autosummary pulls only the first line for its descriptio... | 37.637795 | 117 | 0.561715 |
from __future__ import absolute_import
# autosummary pulls only the first line for its description.
# Import python libs
import os
import subprocess
# Import salt libs
import salt.utils
def __virtual__():
return salt.utils.which('certtool') is not None
def ext_pillar(minion_id,
pillar, # py... | true | true |
f71c74c4947034e3fa1939f004fe6def695c2676 | 2,684 | py | Python | unjupyter.py | milo-trujillo/unjupyter | 2ea86f67e39060ddffb109a2ab94bd074c169fed | [
"MIT"
] | null | null | null | unjupyter.py | milo-trujillo/unjupyter | 2ea86f67e39060ddffb109a2ab94bd074c169fed | [
"MIT"
] | null | null | null | unjupyter.py | milo-trujillo/unjupyter | 2ea86f67e39060ddffb109a2ab94bd074c169fed | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import json, sys, os, base64, hashlib, glob
def writeSource(f, src):
for line in src:
f.write(line)
def processOutputs(f, outputs):
for output in outputs:
if( "text" in output.keys() ):
f.write("```\n")
for line in output["text"]:
f.write(line)
f.write("\n```\n")
if( "d... | 33.55 | 94 | 0.604322 |
import json, sys, os, base64, hashlib, glob
def writeSource(f, src):
for line in src:
f.write(line)
def processOutputs(f, outputs):
for output in outputs:
if( "text" in output.keys() ):
f.write("```\n")
for line in output["text"]:
f.write(line)
f.write("\n```\n")
if( "data" in output.keys() ... | true | true |
f71c7536f0d8bae32792340fd5193c009dbbeef0 | 403 | py | Python | AIC21_Backend/asgi.py | mehrbodjavadi79/AIC21-Backend | 9f4342781f0722804a2eb704b43b52984c81b40a | [
"MIT"
] | 3 | 2021-03-12T18:32:39.000Z | 2021-11-08T10:21:04.000Z | AIC21_Backend/asgi.py | mehrbodjavadi79/AIC21-Backend | 9f4342781f0722804a2eb704b43b52984c81b40a | [
"MIT"
] | null | null | null | AIC21_Backend/asgi.py | mehrbodjavadi79/AIC21-Backend | 9f4342781f0722804a2eb704b43b52984c81b40a | [
"MIT"
] | 2 | 2021-01-29T14:52:53.000Z | 2022-03-05T10:24:24.000Z | """
ASGI config for AIC21_Backend project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO... | 23.705882 | 78 | 0.791563 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'AIC21_Backend.settings')
application = get_asgi_application()
| true | true |
f71c767d697d8a28a293c70fc345f6c9aac815fd | 296 | py | Python | TweetsToDB/main.py | lru-avershave/CapstoneProject | f74b4c73ffb0214a498b19f5f51481c529fa85a8 | [
"MIT"
] | 2 | 2020-01-15T06:38:34.000Z | 2020-01-22T20:42:19.000Z | TweetsToDB/main.py | lru-avershave/CapstoneProject | f74b4c73ffb0214a498b19f5f51481c529fa85a8 | [
"MIT"
] | null | null | null | TweetsToDB/main.py | lru-avershave/CapstoneProject | f74b4c73ffb0214a498b19f5f51481c529fa85a8 | [
"MIT"
] | 1 | 2020-01-15T20:11:48.000Z | 2020-01-15T20:11:48.000Z | import mongodb_setup as dbConnection
import TweetModel as TweetModel
# from watchdir import watch
from ImportText import collectTxt
class main():
try:
dbConnection
collectTxt()
# watch()
except KeyboardInterrupt:
print("Interrupted Main")
exit(0) | 21.142857 | 36 | 0.679054 | import mongodb_setup as dbConnection
import TweetModel as TweetModel
from ImportText import collectTxt
class main():
try:
dbConnection
collectTxt()
except KeyboardInterrupt:
print("Interrupted Main")
exit(0) | true | true |
f71c76b8aae27f9f54f39dc22abd7134629a2418 | 6,042 | py | Python | yateto/arch.py | ZaubererHaft/yateto | 88a02d160da9bfa7f74a4280deaf465f15cae0fb | [
"BSD-3-Clause"
] | 2 | 2021-07-01T14:23:01.000Z | 2022-01-12T01:06:24.000Z | yateto/arch.py | ZaubererHaft/yateto | 88a02d160da9bfa7f74a4280deaf465f15cae0fb | [
"BSD-3-Clause"
] | 14 | 2019-06-25T18:12:29.000Z | 2022-02-08T15:17:27.000Z | yateto/arch.py | ZaubererHaft/yateto | 88a02d160da9bfa7f74a4280deaf465f15cae0fb | [
"BSD-3-Clause"
] | 3 | 2021-05-14T13:04:28.000Z | 2021-12-24T03:15:35.000Z | ##
# @file
# This file is part of SeisSol.
#
# @author Carsten Uphoff (c.uphoff AT tum.de, http://www5.in.tum.de/wiki/index.php/Carsten_Uphoff,_M.Sc.)
#
# @section LICENSE
# Copyright (c) 2015-2018, SeisSol Group
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modificatio... | 38.484076 | 110 | 0.71665 |
from .memory import DenseMemoryLayout
class Architecture(object):
def __init__(self,
name,
precision,
alignment,
enablePrefetch=False,
sub_name=None,
host_name=None):
self.name = name
... | true | true |
f71c77a35b95b5244ed1a2f4cb8314b74edffc12 | 19,222 | py | Python | lib/spack/spack/test/install.py | padamson/spack | d3f67a48552691b4846ccc4a10f76740b154090c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2021-03-05T10:54:32.000Z | 2021-03-05T14:14:52.000Z | lib/spack/spack/test/install.py | padamson/spack | d3f67a48552691b4846ccc4a10f76740b154090c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 32 | 2020-12-15T17:29:20.000Z | 2022-03-21T15:08:31.000Z | lib/spack/spack/test/install.py | padamson/spack | d3f67a48552691b4846ccc4a10f76740b154090c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2021-07-19T20:31:27.000Z | 2021-07-19T21:14:14.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
import shutil
import pytest
import llnl.util.filesystem as fs
import spack.error
import spack.patch
import sp... | 33.371528 | 83 | 0.70232 |
import os
import shutil
import pytest
import llnl.util.filesystem as fs
import spack.error
import spack.patch
import spack.repo
import spack.store
import spack.util.spack_json as sjson
from spack.package import (
InstallError,
PackageBase,
PackageStillNeededError,
_spack_build_envfile,
_spac... | true | true |
f71c77d1c0f627d4c0d8120689ae89c7e1a43d86 | 2,577 | py | Python | agogosml_cli/cli/templates/{{cookiecutter.PROJECT_NAME_SLUG}}/e2e/testgen/main.py | cicorias/agogosml | 60e0b52c2fc721bdd965aadaf8c1afd1ddb9b7d1 | [
"MIT"
] | 13 | 2018-12-07T21:02:20.000Z | 2019-02-22T14:36:31.000Z | agogosml_cli/cli/templates/{{cookiecutter.PROJECT_NAME_SLUG}}/e2e/testgen/main.py | cicorias/agogosml | 60e0b52c2fc721bdd965aadaf8c1afd1ddb9b7d1 | [
"MIT"
] | 43 | 2018-11-30T11:31:43.000Z | 2019-04-03T16:09:06.000Z | agogosml_cli/cli/templates/{{cookiecutter.PROJECT_NAME_SLUG}}/e2e/testgen/main.py | cicorias/agogosml | 60e0b52c2fc721bdd965aadaf8c1afd1ddb9b7d1 | [
"MIT"
] | 13 | 2018-11-29T00:31:29.000Z | 2019-02-22T18:50:28.000Z | import json
import os
import sys
import time
from agogosml.common.abstract_streaming_client import find_streaming_clients
from agogosml.tools.sender import send
from agogosml.tools.receiver import receive
eh_base_config = {
"EVENT_HUB_NAMESPACE": os.getenv("EVENT_HUB_NAMESPACE"),
"EVENT_HUB_NAME": os.getenv("... | 28.955056 | 109 | 0.73962 | import json
import os
import sys
import time
from agogosml.common.abstract_streaming_client import find_streaming_clients
from agogosml.tools.sender import send
from agogosml.tools.receiver import receive
eh_base_config = {
"EVENT_HUB_NAMESPACE": os.getenv("EVENT_HUB_NAMESPACE"),
"EVENT_HUB_NAME": os.getenv("... | true | true |
f71c78a611dd59c34a836099368a08f02076670b | 9,173 | py | Python | tensorflow/contrib/timeseries/python/timeseries/state_space_models/varma.py | uve/tensorflow | e08079463bf43e5963acc41da1f57e95603f8080 | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/timeseries/python/timeseries/state_space_models/varma.py | uve/tensorflow | e08079463bf43e5963acc41da1f57e95603f8080 | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/timeseries/python/timeseries/state_space_models/varma.py | uve/tensorflow | e08079463bf43e5963acc41da1f57e95603f8080 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 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... | 45.636816 | 97 | 0.692903 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.contrib.timeseries.python.timeseries import math_utils
from tensorflow.contrib.timeseries.python.timeseries.state_space_models import state_space_model
from tensorflow.py... | true | true |
f71c792738a6eb005cce3420d1463f363558dd6e | 898 | py | Python | Lms/migrations/versions/4b83761bf52a_users_table.py | stsl256/LMS_for_tinkoff | 5ace2a9d8f8e6c80660171502de6689f746535ed | [
"MIT"
] | null | null | null | Lms/migrations/versions/4b83761bf52a_users_table.py | stsl256/LMS_for_tinkoff | 5ace2a9d8f8e6c80660171502de6689f746535ed | [
"MIT"
] | null | null | null | Lms/migrations/versions/4b83761bf52a_users_table.py | stsl256/LMS_for_tinkoff | 5ace2a9d8f8e6c80660171502de6689f746535ed | [
"MIT"
] | 1 | 2020-12-09T00:41:26.000Z | 2020-12-09T00:41:26.000Z | """users table
Revision ID: 4b83761bf52a
Revises: 0d3bdf63aacc
Create Date: 2029-12-29 17:17:20.500426
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '4b83761bf52a'
down_revision = '0d3bdf63aacc'
branch_labels = None
depends_on = None
def upgrade():
# ### ... | 29.933333 | 89 | 0.688196 | from alembic import op
import sqlalchemy as sa
revision = '4b83761bf52a'
down_revision = '0d3bdf63aacc'
branch_labels = None
depends_on = None
def upgrade():
add_column('user', sa.Column('phone', sa.String(length=64), nullable=True))
| true | true |
f71c7941417b4404871df8bb404ec9f2347ad2f0 | 1,254 | py | Python | var/spack/repos/builtin/packages/dpdk/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/dpdk/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 8 | 2021-11-09T20:28:40.000Z | 2022-03-15T03:26:33.000Z | var/spack/repos/builtin/packages/dpdk/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2019-02-08T20:37:20.000Z | 2019-03-31T15:19:26.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class Dpdk(MakefilePackage):
"""DPDK is a set of libraries and drivers for fast packet p... | 39.1875 | 95 | 0.748804 |
from spack.package import *
class Dpdk(MakefilePackage):
homepage = "https://github.com/DPDK/dpdk"
url = "https://github.com/DPDK/dpdk/archive/v19.11.tar.gz"
version('20.02', sha256='29e56ea8e47e30110ecb881fa5a37125a865dd2d45b61f68e93e334caaab16b7')
version('19.11', sha256='ce1befb20a5e5c5... | true | true |
f71c7bece95f106b2a9bb71db5ac6017fee41c58 | 1,757 | py | Python | spdx_lint/lint.py | sthagen/verbose-pancake | f12b38c8aea8aee8f7a593a4669dfe5e0a447ba5 | [
"MIT"
] | 1 | 2021-02-28T11:39:00.000Z | 2021-02-28T11:39:00.000Z | spdx_lint/lint.py | sthagen/verbose-pancake | f12b38c8aea8aee8f7a593a4669dfe5e0a447ba5 | [
"MIT"
] | 26 | 2021-02-28T12:07:04.000Z | 2021-02-28T13:04:27.000Z | spdx_lint/lint.py | sthagen/verbose-pancake | f12b38c8aea8aee8f7a593a4669dfe5e0a447ba5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# pylint: disable=expression-not-assigned,line-too-long
SPDX_2_2_DCI_TV = {
"SPDXVersion": "SPDX-2.2",
"DataLicense": "CC0-1.0",
"SPDXID": "SPDXRef-DOCUMENT",
"DocumentName": "$_SINGLE_LINE",
"DocumentNamespace": "$_URI_MINUS_PART",
"[ExternalDocumentRef]": [
"Do... | 31.375 | 109 | 0.592487 |
SPDX_2_2_DCI_TV = {
"SPDXVersion": "SPDX-2.2",
"DataLicense": "CC0-1.0",
"SPDXID": "SPDXRef-DOCUMENT",
"DocumentName": "$_SINGLE_LINE",
"DocumentNamespace": "$_URI_MINUS_PART",
"[ExternalDocumentRef]": [
"DocumentRef-$_IDSTRING $_SPDX_DOCUMENT_URI $_PREFIX_COLON_CHECKSUM",
],
... | true | true |
f71c7c09de030a029f096f3ac1471f0f9a979e3b | 6,549 | py | Python | packages/pytea/pytest/benchmarks/transformers/examples/question-answering/run_squad_trainer.py | lego0901/pytea | 8ede650def2e68f4610ba816451d8b9e28f09f76 | [
"MIT"
] | 1 | 2020-11-30T09:01:57.000Z | 2020-11-30T09:01:57.000Z | packages/pytea/pytest/benchmarks/transformers/examples/question-answering/run_squad_trainer.py | lego0901/pytea | 8ede650def2e68f4610ba816451d8b9e28f09f76 | [
"MIT"
] | null | null | null | packages/pytea/pytest/benchmarks/transformers/examples/question-answering/run_squad_trainer.py | lego0901/pytea | 8ede650def2e68f4610ba816451d8b9e28f09f76 | [
"MIT"
] | null | null | null | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. 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 cop... | 37.637931 | 133 | 0.703008 |
import logging
import os
import sys
from dataclasses import dataclass, field
from typing import Optional
import transformers
from transformers import AutoConfig, AutoModelForQuestionAnswering, AutoTokenizer, HfArgumentParser, SquadDataset
from transformers import SquadDataTrainingArguments as DataTrai... | true | true |
f71c7c547c5784ada99fdc35a9188f398ce31ecd | 123 | py | Python | adlmagics/adlmagics/__init__.py | Azure/Azure-Data-Service-Notebook | 6bd28587c9fa0a7c1f9113f638b790b1773c5585 | [
"MIT"
] | 6 | 2018-06-06T08:37:53.000Z | 2020-06-01T13:13:13.000Z | adlmagics/adlmagics/__init__.py | Azure/Azure-Data-Service-Notebook | 6bd28587c9fa0a7c1f9113f638b790b1773c5585 | [
"MIT"
] | 30 | 2018-06-08T02:47:18.000Z | 2018-07-25T07:07:07.000Z | adlmagics/adlmagics/__init__.py | Azure/Azure-Data-Service-Notebook | 6bd28587c9fa0a7c1f9113f638b790b1773c5585 | [
"MIT"
] | 5 | 2018-06-06T08:37:55.000Z | 2021-01-07T09:15:15.000Z | from adlmagics.adlmagics_main import AdlMagics
def load_ipython_extension(ipython):
ipython.register_magics(AdlMagics) | 30.75 | 46 | 0.853659 | from adlmagics.adlmagics_main import AdlMagics
def load_ipython_extension(ipython):
ipython.register_magics(AdlMagics) | true | true |
f71c7ce5af65015396617f32ecb957271f0d1e12 | 1,295 | py | Python | soal2/acceptor.py | irff/uas | a68bdac5f13c61e21675b43a56e5407d11e3409c | [
"MIT"
] | null | null | null | soal2/acceptor.py | irff/uas | a68bdac5f13c61e21675b43a56e5407d11e3409c | [
"MIT"
] | null | null | null | soal2/acceptor.py | irff/uas | a68bdac5f13c61e21675b43a56e5407d11e3409c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from rabbitmq import RabbitMQ, Consumer, Publisher
import time
import json
import pika
import random
import threading
import sys
from datetime import datetime
from tinydb import TinyDB, Query
QUEUE_URL = '152.118.148.103'
QUEUE_PORT = '5672'
USERNAME = '1306398983'
PASSWORD = '446167'
VHOST = '13... | 23.545455 | 60 | 0.654826 |
from rabbitmq import RabbitMQ, Consumer, Publisher
import time
import json
import pika
import random
import threading
import sys
from datetime import datetime
from tinydb import TinyDB, Query
QUEUE_URL = '152.118.148.103'
QUEUE_PORT = '5672'
USERNAME = '1306398983'
PASSWORD = '446167'
VHOST = '1306398983'
EX_PAXOS =... | false | true |
f71c7e0a03d097595b703379f84e0942a21fd206 | 4,909 | py | Python | kubernetes/client/models/v1beta1_self_subject_access_review_spec.py | woqer/python | 3a6fe8231cefe1fa39a0a69d4b2f33044ab32745 | [
"Apache-2.0"
] | 1 | 2019-07-12T05:38:06.000Z | 2019-07-12T05:38:06.000Z | kubernetes/client/models/v1beta1_self_subject_access_review_spec.py | woqer/python | 3a6fe8231cefe1fa39a0a69d4b2f33044ab32745 | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/v1beta1_self_subject_access_review_spec.py | woqer/python | 3a6fe8231cefe1fa39a0a69d4b2f33044ab32745 | [
"Apache-2.0"
] | 1 | 2021-05-18T12:25:56.000Z | 2021-05-18T12:25:56.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.11.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re... | 31.670968 | 111 | 0.644938 |
from pprint import pformat
from six import iteritems
import re
class V1beta1SelfSubjectAccessReviewSpec(object):
swagger_types = {
'non_resource_attributes': 'V1beta1NonResourceAttributes',
'resource_attributes': 'V1beta1ResourceAttributes'
}
attribute_map = {
'non_resource_... | true | true |
f71c7edc2ae9ca95fcb919548ce178feef3c1b16 | 2,805 | py | Python | st2common/tests/unit/test_triggers_registrar.py | saucetray/st2 | 8f507d6c8d9483c8371e386fe2b7998596856fd7 | [
"Apache-2.0"
] | 2 | 2021-08-04T01:04:06.000Z | 2021-08-04T01:04:08.000Z | st2common/tests/unit/test_triggers_registrar.py | saucetray/st2 | 8f507d6c8d9483c8371e386fe2b7998596856fd7 | [
"Apache-2.0"
] | 1 | 2022-03-31T03:53:22.000Z | 2022-03-31T03:53:22.000Z | st2common/tests/unit/test_triggers_registrar.py | saucetray/st2 | 8f507d6c8d9483c8371e386fe2b7998596856fd7 | [
"Apache-2.0"
] | 1 | 2019-10-11T14:42:28.000Z | 2019-10-11T14:42:28.000Z | # Copyright 2019 Extreme Networks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 40.652174 | 88 | 0.745455 |
from __future__ import absolute_import
import os
import st2common.bootstrap.triggersregistrar as triggers_registrar
from st2common.persistence.trigger import Trigger
from st2common.persistence.trigger import TriggerType
from st2tests.base import CleanDbTestCase
from st2tests.fixturesloader import get_fix... | true | true |
f71c8126e5ce154c4f9e4de6a8537b75a21c3612 | 1,486 | py | Python | examples/node_labels.py | venukarnati92/python-1 | 3fabf9ed9f4758fb5133975a58fc147471e91d9d | [
"Apache-2.0"
] | 4,417 | 2018-01-13T04:30:48.000Z | 2022-03-31T15:33:59.000Z | examples/node_labels.py | belajarqywok/python | b15bea16a87ad03136a4627941ac437582ea4657 | [
"Apache-2.0"
] | 1,414 | 2018-01-12T19:31:56.000Z | 2022-03-31T22:01:02.000Z | examples/node_labels.py | palnabarun/python | 6b01c95e1673c0787d3d688b361bfd995d62dd98 | [
"Apache-2.0"
] | 2,854 | 2018-01-14T08:57:33.000Z | 2022-03-31T01:41:56.000Z | # Copyright 2016 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | 28.576923 | 74 | 0.662853 |
from kubernetes import client, config
def main():
config.load_kube_config()
api_instance = client.CoreV1Api()
body = {
"metadata": {
"labels": {
"foo": "bar",
"baz": None}
}
}
node_list = api_instance.list_node()
... | true | true |
f71c817e947e6fd2bca33380c21307542dc6f585 | 110,038 | py | Python | hermes/hermes_parser.py | scottfrazer/hermes | d82d916dd20da58c056b18dbb9b6c01a3700f3e1 | [
"MIT"
] | 14 | 2015-07-29T06:20:00.000Z | 2021-03-21T10:23:38.000Z | hermes/hermes_parser.py | scottfrazer/hermes | d82d916dd20da58c056b18dbb9b6c01a3700f3e1 | [
"MIT"
] | 32 | 2015-02-13T18:34:44.000Z | 2020-03-17T15:08:51.000Z | hermes/hermes_parser.py | scottfrazer/hermes | d82d916dd20da58c056b18dbb9b6c01a3700f3e1 | [
"MIT"
] | 8 | 2015-04-22T11:46:59.000Z | 2019-03-29T22:58:38.000Z |
import sys
import os
import re
import base64
import argparse
from collections import OrderedDict
# Common Code #
def parse_tree_string(parsetree, indent=None, b64_source=True, indent_level=0, debug=False):
indent_str = (' ' * indent * indent_level) if indent else ''
if isinstance(parsetree, ParseTree):
... | 38.088612 | 189 | 0.520529 |
import sys
import os
import re
import base64
import argparse
from collections import OrderedDict
def parse_tree_string(parsetree, indent=None, b64_source=True, indent_level=0, debug=False):
indent_str = (' ' * indent * indent_level) if indent else ''
if isinstance(parsetree, ParseTree):
children = [par... | true | true |
f71c81a8b1726d61edd4af204b0813341e2fdc17 | 20,285 | py | Python | pkg/suggestion/v1beta1/nas/enas/service.py | Adarsh2910/katib | cd095d6a33401cfddee8188943b60cd12c950c33 | [
"Apache-2.0"
] | null | null | null | pkg/suggestion/v1beta1/nas/enas/service.py | Adarsh2910/katib | cd095d6a33401cfddee8188943b60cd12c950c33 | [
"Apache-2.0"
] | 669 | 2021-01-25T10:26:46.000Z | 2022-03-31T22:01:58.000Z | pkg/suggestion/v1beta1/nas/enas/service.py | Adarsh2910/katib | cd095d6a33401cfddee8188943b60cd12c950c33 | [
"Apache-2.0"
] | 1 | 2021-09-10T06:56:10.000Z | 2021-09-10T06:56:10.000Z | import logging
from logging import getLogger, StreamHandler, INFO
import json
import os
import tensorflow as tf
import grpc
from pkg.apis.manager.v1beta1.python import api_pb2
from pkg.apis.manager.v1beta1.python import api_pb2_grpc
from pkg.suggestion.v1beta1.nas.enas.Controller import Controller
from pkg.suggestion.... | 46.956019 | 156 | 0.603944 | import logging
from logging import getLogger, StreamHandler, INFO
import json
import os
import tensorflow as tf
import grpc
from pkg.apis.manager.v1beta1.python import api_pb2
from pkg.apis.manager.v1beta1.python import api_pb2_grpc
from pkg.suggestion.v1beta1.nas.enas.Controller import Controller
from pkg.suggestion.... | true | true |
f71c84d85474a8f5aa729fc1e185f9a029c9a09c | 6,121 | py | Python | Monte-Carlo-Attacks/Monte-Carlo-CIFAR_VAE/cifar10_train.py | SAP-samples/security-research-mi-gen-nn | 15627f73fcc497c87a67f41957f6b82881dff353 | [
"Apache-2.0"
] | 5 | 2020-02-21T15:13:57.000Z | 2021-08-05T15:18:40.000Z | Monte-Carlo-Attacks/Monte-Carlo-CIFAR_VAE/cifar10_train.py | SAP-samples/security-research-membership-inference-against-generative-networks | 15627f73fcc497c87a67f41957f6b82881dff353 | [
"Apache-2.0"
] | null | null | null | Monte-Carlo-Attacks/Monte-Carlo-CIFAR_VAE/cifar10_train.py | SAP-samples/security-research-membership-inference-against-generative-networks | 15627f73fcc497c87a67f41957f6b82881dff353 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import norm
import pickle
from keras.layers import Input, Dense, Lambda, Flatten, Reshape, Layer
from keras.layers import Conv2D, Conv2DTranspose
from keras.models import Model
from keras import backend as K
from keras import metrics
# import paramet... | 37.09697 | 123 | 0.663944 | import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import norm
import pickle
from keras.layers import Input, Dense, Lambda, Flatten, Reshape, Layer
from keras.layers import Conv2D, Conv2DTranspose
from keras.models import Model
from keras import backend as K
from keras import metrics
from cifar10_pa... | true | true |
f71c8578ec45fa13ff3af1382cbd44bcc86f9bbe | 93 | py | Python | CVgallery/apps.py | siavashMehran/Portfolio | a592ec51122d96e8e336365fd3cd039a7f223221 | [
"MIT"
] | null | null | null | CVgallery/apps.py | siavashMehran/Portfolio | a592ec51122d96e8e336365fd3cd039a7f223221 | [
"MIT"
] | null | null | null | CVgallery/apps.py | siavashMehran/Portfolio | a592ec51122d96e8e336365fd3cd039a7f223221 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class CvgalleryConfig(AppConfig):
name = 'CVgallery'
| 15.5 | 33 | 0.763441 | from django.apps import AppConfig
class CvgalleryConfig(AppConfig):
name = 'CVgallery'
| true | true |
f71c861ea7dd94eca7c2a5bcbc500411f6590433 | 2,705 | py | Python | castle/kivy_wrapper.py | chappers/castle | 0abdb4eed91c45b443c0de8f029dff983f921363 | [
"MIT"
] | null | null | null | castle/kivy_wrapper.py | chappers/castle | 0abdb4eed91c45b443c0de8f029dff983f921363 | [
"MIT"
] | 1 | 2020-11-22T22:00:13.000Z | 2020-11-22T22:00:13.000Z | castle/kivy_wrapper.py | chappers/castle | 0abdb4eed91c45b443c0de8f029dff983f921363 | [
"MIT"
] | null | null | null | """
A simple kivy wrapper
"""
import kivy
from kivy.app import App
from kivy.core.window import Window
from kivy.uix.widget import Widget
from kivy.uix.gridlayout import GridLayout
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.label import Label
from kivy.clock import Clock
"""
A really simple discrete env... | 29.725275 | 85 | 0.629945 |
import kivy
from kivy.app import App
from kivy.core.window import Window
from kivy.uix.widget import Widget
from kivy.uix.gridlayout import GridLayout
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.label import Label
from kivy.clock import Clock
import numpy as np
import random
from gym.spaces import Box, ... | true | true |
f71c862ef26b8cf209313fbb5ff5c086291c53ca | 1,093 | py | Python | python/analysis/TargetScanDB.py | mjoppich/miRExplore | 32760d88d65e7bc23b2bfb49415efcd0a7c7c5e1 | [
"Apache-2.0"
] | null | null | null | python/analysis/TargetScanDB.py | mjoppich/miRExplore | 32760d88d65e7bc23b2bfb49415efcd0a7c7c5e1 | [
"Apache-2.0"
] | null | null | null | python/analysis/TargetScanDB.py | mjoppich/miRExplore | 32760d88d65e7bc23b2bfb49415efcd0a7c7c5e1 | [
"Apache-2.0"
] | null | null | null | import re
from collections import defaultdict
from openpyxl import load_workbook
class TargetScanDB :
def __init__(self):
self.elems = []
self.gene2mirnas = defaultdict(list)
def make_dictionary(self):
for elem in self.elems:
self.gene2mirnas[elem[0]].append(elem)
... | 19.517857 | 102 | 0.548948 | import re
from collections import defaultdict
from openpyxl import load_workbook
class TargetScanDB :
def __init__(self):
self.elems = []
self.gene2mirnas = defaultdict(list)
def make_dictionary(self):
for elem in self.elems:
self.gene2mirnas[elem[0]].append(elem)
... | true | true |
f71c86d03bc2eedb4697b0730ac3f051ebb54808 | 15,522 | py | Python | rasa_nlu/project.py | osmanbaskaya/rasa_nlu | 4f0b5d0fd0d058e437e7d74369cef212fd0a345b | [
"Apache-2.0"
] | null | null | null | rasa_nlu/project.py | osmanbaskaya/rasa_nlu | 4f0b5d0fd0d058e437e7d74369cef212fd0a345b | [
"Apache-2.0"
] | 6 | 2020-09-26T00:52:34.000Z | 2022-02-10T01:37:38.000Z | rasa_nlu/project.py | esrel/rasa_nlu | 53840788e41b2daf957ec5d488281f70e238730f | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import datetime
import logging
import os
import tempfile
import zipfile
from threading import Lock, Thread
from typing import Text, List
import six
import time
from buil... | 36.097674 | 86 | 0.616029 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import datetime
import logging
import os
import tempfile
import zipfile
from threading import Lock, Thread
from typing import Text, List
import six
import time
from buil... | true | true |
f71c881a51efe3fd38a5ddad27bb876a0a24ab7d | 8,497 | py | Python | pytype/tests/test_namedtuple.py | ashwinprasadme/pytype | fed209c73aacfcab15efc33deef3b4016a67cfe5 | [
"Apache-2.0"
] | null | null | null | pytype/tests/test_namedtuple.py | ashwinprasadme/pytype | fed209c73aacfcab15efc33deef3b4016a67cfe5 | [
"Apache-2.0"
] | null | null | null | pytype/tests/test_namedtuple.py | ashwinprasadme/pytype | fed209c73aacfcab15efc33deef3b4016a67cfe5 | [
"Apache-2.0"
] | null | null | null | """Tests for the namedtuple implementation in collections_overlay.py."""
import textwrap
from pytype import file_utils
from pytype.overlays import collections_overlay
from pytype.pytd import escape
from pytype.pytd import pytd_utils
from pytype.tests import test_base
class NamedtupleTests(test_base.TargetIndependen... | 31.354244 | 88 | 0.564905 |
import textwrap
from pytype import file_utils
from pytype.overlays import collections_overlay
from pytype.pytd import escape
from pytype.pytd import pytd_utils
from pytype.tests import test_base
class NamedtupleTests(test_base.TargetIndependentTest):
def _namedtuple_ast(self, name, fields):
return collection... | true | true |
f71c885784aeccc154dd5cca2413ad6060ae4e6b | 3,087 | py | Python | tests/tests_hrv.py | raimonpv/NeuroKit | cb37d83ee20d6a13a91c4848aa435f41e979e203 | [
"MIT"
] | 1 | 2021-11-14T21:18:43.000Z | 2021-11-14T21:18:43.000Z | tests/tests_hrv.py | raimonpv/NeuroKit | cb37d83ee20d6a13a91c4848aa435f41e979e203 | [
"MIT"
] | null | null | null | tests/tests_hrv.py | raimonpv/NeuroKit | cb37d83ee20d6a13a91c4848aa435f41e979e203 | [
"MIT"
] | 1 | 2021-11-14T21:18:48.000Z | 2021-11-14T21:18:48.000Z | import numpy as np
import neurokit2 as nk
def test_hrv_time():
ecg_slow = nk.ecg_simulate(duration=60, sampling_rate=1000, heart_rate=70, random_state=42)
ecg_fast = nk.ecg_simulate(duration=60, sampling_rate=1000, heart_rate=110, random_state=42)
_, peaks_slow = nk.ecg_process(ecg_slow, sampling_rate=1... | 44.73913 | 96 | 0.661808 | import numpy as np
import neurokit2 as nk
def test_hrv_time():
ecg_slow = nk.ecg_simulate(duration=60, sampling_rate=1000, heart_rate=70, random_state=42)
ecg_fast = nk.ecg_simulate(duration=60, sampling_rate=1000, heart_rate=110, random_state=42)
_, peaks_slow = nk.ecg_process(ecg_slow, sampling_rate=1... | true | true |
f71c887dca4cf691587ab051359773359de7010e | 3,226 | bzl | Python | build_tools/bazel/iree_lit_test.bzl | smit-hinsu/iree | a385d311b701cdc06cb825000ddb34c8a11c6eef | [
"Apache-2.0"
] | 1 | 2022-02-13T15:27:08.000Z | 2022-02-13T15:27:08.000Z | build_tools/bazel/iree_lit_test.bzl | iree-github-actions-bot/iree | 9982f10090527a1a86cd280b4beff9a579b96b38 | [
"Apache-2.0"
] | 1 | 2022-01-27T18:10:51.000Z | 2022-01-27T18:10:51.000Z | build_tools/bazel/iree_lit_test.bzl | iree-github-actions-bot/iree | 9982f10090527a1a86cd280b4beff9a579b96b38 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The IREE Authors
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
"""Bazel macros for running lit tests."""
load(":lit_test.bzl", "lit_test", "lit_test_suite")
def ir... | 32.918367 | 79 | 0.6584 |
load(":lit_test.bzl", "lit_test", "lit_test_suite")
def iree_lit_test(
name,
cfg = "//iree:lit.cfg.py",
tools = None,
env = None,
**kwargs):
tools = tools or []
env = env or {}
# when it does, I think better to hardcode it here.
llvm_symbo... | true | true |
f71c8959b58f25069e1143ec6f69c7935fd4843b | 8,176 | py | Python | safe/view.py | s-a-f-e/backend | 6018f51466df9abd58f25729d91856842eee9509 | [
"MIT"
] | 1 | 2019-05-06T19:40:43.000Z | 2019-05-06T19:40:43.000Z | safe/view.py | s-a-f-e/backend | 6018f51466df9abd58f25729d91856842eee9509 | [
"MIT"
] | 9 | 2019-12-04T22:57:46.000Z | 2022-02-10T07:15:11.000Z | safe/view.py | s-a-f-e/backend | 6018f51466df9abd58f25729d91856842eee9509 | [
"MIT"
] | 3 | 2019-05-01T20:41:33.000Z | 2019-10-03T20:57:00.000Z | from people.models import Village, Mother, Driver, HealthCenter, MotherDriverConnection
from django.http import JsonResponse, Http404
from django.core import serializers
from decouple import config
from .geokdbush.geokdbush import around, distance
import requests
import json
import time
FRONTLINE_KEY = config('FRONTLI... | 40.676617 | 183 | 0.57999 | from people.models import Village, Mother, Driver, HealthCenter, MotherDriverConnection
from django.http import JsonResponse, Http404
from django.core import serializers
from decouple import config
from .geokdbush.geokdbush import around, distance
import requests
import json
import time
FRONTLINE_KEY = config('FRONTLI... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.