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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7ffc70a895ff1fedde4da3b9fc978e6ba6f7910 | 8,030 | py | Python | controllers/mpr.py | unimauro/eden | b739d334e6828d0db14b3790f2f5e2666fc83576 | [
"MIT"
] | null | null | null | controllers/mpr.py | unimauro/eden | b739d334e6828d0db14b3790f2f5e2666fc83576 | [
"MIT"
] | null | null | null | controllers/mpr.py | unimauro/eden | b739d334e6828d0db14b3790f2f5e2666fc83576 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Missing Person Registry
@author: nursix
"""
module = request.controller
prefix = request.controller
resourcename = request.function
if prefix not in deployment_settings.modules:
raise HTTP(404, body="Module disabled: %s" % prefix)
MISSING = str(T("Missing"))
FOUND = str(T("F... | 37.699531 | 80 | 0.456787 |
module = request.controller
prefix = request.controller
resourcename = request.function
if prefix not in deployment_settings.modules:
raise HTTP(404, body="Module disabled: %s" % prefix)
MISSING = str(T("Missing"))
FOUND = str(T("Found"))
DETAILS = str(T("Details"))
action = lambda l, u: dict(label=str(l), ur... | true | true |
f7ffc903e9f54175818bbd77845748fe3151ac64 | 15,055 | py | Python | jina/types/document/graph.py | ezhaohongwei/jina | 9769f2e35eb8a196304a145409f959a7beac0432 | [
"Apache-2.0"
] | 1 | 2021-06-14T00:35:14.000Z | 2021-06-14T00:35:14.000Z | jina/types/document/graph.py | ezhaohongwei/jina | 9769f2e35eb8a196304a145409f959a7beac0432 | [
"Apache-2.0"
] | null | null | null | jina/types/document/graph.py | ezhaohongwei/jina | 9769f2e35eb8a196304a145409f959a7beac0432 | [
"Apache-2.0"
] | null | null | null | from typing import Optional, Iterator, Tuple, Dict, Iterable
import numpy as np
from . import Document, DocumentSourceType
from ..arrays import ChunkArray
from ..struct import StructView
from ..ndarray.sparse.scipy import SparseNdArray
from ...importer import ImportExtensions
from ...logging.predefined import default... | 35.09324 | 136 | 0.583527 | from typing import Optional, Iterator, Tuple, Dict, Iterable
import numpy as np
from . import Document, DocumentSourceType
from ..arrays import ChunkArray
from ..struct import StructView
from ..ndarray.sparse.scipy import SparseNdArray
from ...importer import ImportExtensions
from ...logging.predefined import default... | true | true |
f7ffca35834bcc4fdd7810febd9a45485379d3e3 | 16,354 | py | Python | waferscreen/inst_control/Keysight_USB_VNA.py | chw3k5/WaferScreen | c0ca7fe939fe7cd0b722b7d6129b148c03a7505c | [
"Apache-2.0"
] | 1 | 2021-07-30T19:06:07.000Z | 2021-07-30T19:06:07.000Z | waferscreen/inst_control/Keysight_USB_VNA.py | chw3k5/WaferScreen | c0ca7fe939fe7cd0b722b7d6129b148c03a7505c | [
"Apache-2.0"
] | 8 | 2021-04-22T20:47:48.000Z | 2021-07-30T19:06:01.000Z | waferscreen/inst_control/Keysight_USB_VNA.py | chw3k5/WaferScreen | c0ca7fe939fe7cd0b722b7d6129b148c03a7505c | [
"Apache-2.0"
] | null | null | null | import visa
import math
import numpy as np
import time
class USBVNA():
""" Keysight USB VNA instrument class. """
def __init__(self, address="TCPIP0::687UWAVE-TEST::hislip_PXI10_CHASSIS1_SLOT1_INDEX0,4880::INSTR"):
self.ResourceManager = visa.ResourceManager()
self.ctrl = self.ResourceManager... | 39.598063 | 112 | 0.548918 | import visa
import math
import numpy as np
import time
class USBVNA():
def __init__(self, address="TCPIP0::687UWAVE-TEST::hislip_PXI10_CHASSIS1_SLOT1_INDEX0,4880::INSTR"):
self.ResourceManager = visa.ResourceManager()
self.ctrl = self.ResourceManager.open_resource("%s" % address, write_terminatio... | true | true |
f7ffcb16d89f9bf0a3c1691bf12b9bef581801b5 | 96 | py | Python | venv/lib/python3.8/site-packages/numpy/typing/_add_docstring.py | GiulianaPola/select_repeats | 17a0d053d4f874e42cf654dd142168c2ec8fbd11 | [
"MIT"
] | 2 | 2022-03-13T01:58:52.000Z | 2022-03-31T06:07:54.000Z | venv/lib/python3.8/site-packages/numpy/typing/_add_docstring.py | DesmoSearch/Desmobot | b70b45df3485351f471080deb5c785c4bc5c4beb | [
"MIT"
] | 19 | 2021-11-20T04:09:18.000Z | 2022-03-23T15:05:55.000Z | venv/lib/python3.8/site-packages/numpy/typing/_add_docstring.py | DesmoSearch/Desmobot | b70b45df3485351f471080deb5c785c4bc5c4beb | [
"MIT"
] | null | null | null | /home/runner/.cache/pip/pool/7e/f8/99/031081079c35398e4f9e73fd1e3d836bb92b12cf22c698fcca4ff468b3 | 96 | 96 | 0.895833 | /home/runner/.cache/pip/pool/7e/f8/99/031081079c35398e4f9e73fd1e3d836bb92b12cf22c698fcca4ff468b3 | false | true |
f7ffcd40685acb634ad20f9e3382d254b3867683 | 448 | py | Python | cride/betfriends/admin.py | albertoaldanar/betmatcherAPI | c0590025efd79f4e489f9c9433b17554ea6ba23f | [
"MIT"
] | null | null | null | cride/betfriends/admin.py | albertoaldanar/betmatcherAPI | c0590025efd79f4e489f9c9433b17554ea6ba23f | [
"MIT"
] | 7 | 2020-06-05T20:53:27.000Z | 2022-03-11T23:47:12.000Z | cride/betfriends/admin.py | albertoaldanar/betmatcherAPI | c0590025efd79f4e489f9c9433b17554ea6ba23f | [
"MIT"
] | null | null | null | #django
from django.db import models
from django.contrib import admin
#model
from cride.betfriends.models import BetFriend, FriendRequest
@admin.register(BetFriend)
class BetFriendAdmin(admin.ModelAdmin):
list_display= (
"user_a",
"user_b"
)
@admin.register(FriendRequest)
class FriendRequestAdmin(admin.Mo... | 17.92 | 60 | 0.720982 |
from django.db import models
from django.contrib import admin
from cride.betfriends.models import BetFriend, FriendRequest
@admin.register(BetFriend)
class BetFriendAdmin(admin.ModelAdmin):
list_display= (
"user_a",
"user_b"
)
@admin.register(FriendRequest)
class FriendRequestAdmin(admin.ModelAdmin):
... | true | true |
f7ffcd7ff9af3f9a9c18348e4ad75cb41e127bd8 | 2,285 | py | Python | examples/example_background_image.py | o0morgan0o/CustomTkinter | f7d4f902a91d87c7f078963d6e8b757d84abd743 | [
"CC0-1.0"
] | 1 | 2022-02-18T03:45:01.000Z | 2022-02-18T03:45:01.000Z | examples/example_background_image.py | o0morgan0o/CustomTkinter | f7d4f902a91d87c7f078963d6e8b757d84abd743 | [
"CC0-1.0"
] | null | null | null | examples/example_background_image.py | o0morgan0o/CustomTkinter | f7d4f902a91d87c7f078963d6e8b757d84abd743 | [
"CC0-1.0"
] | null | null | null | import tkinter
import tkinter.messagebox
import customtkinter
from PIL import Image, ImageTk
import os
customtkinter.set_appearance_mode("System") # Other: "Light", "Dark"
PATH = os.path.dirname(os.path.realpath(__file__))
class App(tkinter.Tk):
APP_NAME = "CustomTkinter background gardient"
WIDTH = 900
... | 34.104478 | 104 | 0.611379 | import tkinter
import tkinter.messagebox
import customtkinter
from PIL import Image, ImageTk
import os
customtkinter.set_appearance_mode("System")
PATH = os.path.dirname(os.path.realpath(__file__))
class App(tkinter.Tk):
APP_NAME = "CustomTkinter background gardient"
WIDTH = 900
HEIGHT = 600
def... | true | true |
f7ffce14bbfc62748b0adfbfb4990a11b8e8de47 | 780 | py | Python | ward_tests/test_entities.py | koichiro8/learning | ffc0785dfeeeee4240aed0a1742a64b86ff28369 | [
"MIT"
] | null | null | null | ward_tests/test_entities.py | koichiro8/learning | ffc0785dfeeeee4240aed0a1742a64b86ff28369 | [
"MIT"
] | null | null | null | ward_tests/test_entities.py | koichiro8/learning | ffc0785dfeeeee4240aed0a1742a64b86ff28369 | [
"MIT"
] | null | null | null | from ward import raises, test
from learning.entities import Todo
from learning.errors import TitleLengthError
@test("create todo")
def _():
todo = Todo("test todo")
assert todo.title == "test todo"
assert not todo.id
assert not todo.done
assert not todo.created_at
@test("title length is less t... | 23.636364 | 86 | 0.641026 | from ward import raises, test
from learning.entities import Todo
from learning.errors import TitleLengthError
@test("create todo")
def _():
todo = Todo("test todo")
assert todo.title == "test todo"
assert not todo.id
assert not todo.done
assert not todo.created_at
@test("title length is less t... | true | true |
f7ffcedcc27c5491cbbdab7873d4aa1a5d0241a3 | 3,648 | py | Python | cortex_DIM_DEMI/models/coordinates.py | RayRuizhiLiao/DIM_DEMI | 6b0cb14f56f1aee232e553e75ea81a722b9e71dd | [
"BSD-3-Clause"
] | null | null | null | cortex_DIM_DEMI/models/coordinates.py | RayRuizhiLiao/DIM_DEMI | 6b0cb14f56f1aee232e553e75ea81a722b9e71dd | [
"BSD-3-Clause"
] | null | null | null | cortex_DIM_DEMI/models/coordinates.py | RayRuizhiLiao/DIM_DEMI | 6b0cb14f56f1aee232e553e75ea81a722b9e71dd | [
"BSD-3-Clause"
] | null | null | null | '''Coordinate task
'''
from cortex.plugins import ModelPlugin
import torch
import torch.nn.functional as F
from cortex_DIM_DEMI.nn_modules.mi_networks import MI1x1ConvNet
class CoordinatePredictor(ModelPlugin):
'''Coordinate prediction
'''
defaults = dict(
data=dict(batch_size=dict(train=64, t... | 31.721739 | 114 | 0.578673 |
from cortex.plugins import ModelPlugin
import torch
import torch.nn.functional as F
from cortex_DIM_DEMI.nn_modules.mi_networks import MI1x1ConvNet
class CoordinatePredictor(ModelPlugin):
defaults = dict(
data=dict(batch_size=dict(train=64, test=64),
inputs=dict(inputs='data.images'), ... | true | true |
f7ffcf00f72cd8efd21b59834792d7c0a9a8deaf | 12,294 | py | Python | ievv_opensource/utils/choices_with_meta.py | appressoas/ievv_opensource | 63e87827952ddc8f6f86145b79478ef21d6a0990 | [
"BSD-3-Clause"
] | null | null | null | ievv_opensource/utils/choices_with_meta.py | appressoas/ievv_opensource | 63e87827952ddc8f6f86145b79478ef21d6a0990 | [
"BSD-3-Clause"
] | 37 | 2015-10-26T09:14:12.000Z | 2022-02-10T10:35:33.000Z | ievv_opensource/utils/choices_with_meta.py | appressoas/ievv_opensource | 63e87827952ddc8f6f86145b79478ef21d6a0990 | [
"BSD-3-Clause"
] | 1 | 2015-11-06T07:56:34.000Z | 2015-11-06T07:56:34.000Z | from collections import OrderedDict
class Choice(object):
"""
A choice in a :class:`.ChoicesWithMeta`.
This basic choice class supports value, label and description,
but you should subclass this (and possibly also :class:`.ChoicesWithMeta`)
if you need more metadata.
.. attribute:: value
... | 33.048387 | 99 | 0.602652 | from collections import OrderedDict
class Choice(object):
def __init__(self, value, label=None, description='',
attributename=None):
self.value = value
self.label = label or value
self.description = description
if attributename is None:
self.attributena... | true | true |
f7ffcf3141c9a7705268082eb3e32b2c0285b192 | 840 | py | Python | SmallObjectAugmentation/Helpers.py | riciche/SimpleCVReproduction | 4075de39f9c61f1359668a413f6a5d98903fcf97 | [
"Apache-2.0"
] | 923 | 2020-01-11T06:36:53.000Z | 2022-03-31T00:26:57.000Z | SmallObjectAugmentation/Helpers.py | riciche/SimpleCVReproduction | 4075de39f9c61f1359668a413f6a5d98903fcf97 | [
"Apache-2.0"
] | 25 | 2020-02-27T08:35:46.000Z | 2022-01-25T08:54:19.000Z | SmallObjectAugmentation/Helpers.py | riciche/SimpleCVReproduction | 4075de39f9c61f1359668a413f6a5d98903fcf97 | [
"Apache-2.0"
] | 262 | 2020-01-02T02:19:40.000Z | 2022-03-23T04:56:16.000Z | import glob
import cv2 as cv2
import numpy as np
import matplotlib.pyplot as plt
# import random
import math
from tqdm import tqdm
def load_images(path):
image_list = []
images = glob.glob(path)
for index in range(len(images)):
image = cv2.cvtColor(cv2.imread(images[index]), cv2.COLOR_BGR2RGB)
... | 21.538462 | 74 | 0.672619 | import glob
import cv2 as cv2
import numpy as np
import matplotlib.pyplot as plt
import math
from tqdm import tqdm
def load_images(path):
image_list = []
images = glob.glob(path)
for index in range(len(images)):
image = cv2.cvtColor(cv2.imread(images[index]), cv2.COLOR_BGR2RGB)
image_list... | true | true |
f7ffd0288f1b19a06643b308e542a6f30c83599e | 1,892 | py | Python | tests/python/unittest/test_container.py | jheo4/incubator-tvm | c4c61cb766608fb2f0fd8c9facc480a43afed3f5 | [
"Apache-2.0"
] | 3 | 2020-03-12T10:25:51.000Z | 2020-08-05T05:36:23.000Z | tests/python/unittest/test_container.py | jheo4/incubator-tvm | c4c61cb766608fb2f0fd8c9facc480a43afed3f5 | [
"Apache-2.0"
] | null | null | null | tests/python/unittest/test_container.py | jheo4/incubator-tvm | c4c61cb766608fb2f0fd8c9facc480a43afed3f5 | [
"Apache-2.0"
] | 1 | 2018-10-19T18:11:41.000Z | 2018-10-19T18:11:41.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 31.016393 | 62 | 0.679704 |
import numpy as np
import tvm
from tvm import nd, relay
from tvm.runtime import container as _container
def test_adt_constructor():
arr = nd.array([1, 2, 3])
fields = [arr, arr]
y = _container.ADT(0, [arr, arr])
assert len(y) == 2
assert isinstance(y, _container.ADT)
y[0:1][-... | true | true |
f7ffd02d9ed661742b46d73f7b22da07a388b08e | 435 | py | Python | tests/storage_api_methods/test_exists.py | Stuvros/django-selectel-storage | 076f7e3c58d9391e2e7e27feb0526736d101c2b5 | [
"MIT"
] | 27 | 2015-01-28T09:17:09.000Z | 2021-06-21T20:48:01.000Z | tests/storage_api_methods/test_exists.py | Stuvros/django-selectel-storage | 076f7e3c58d9391e2e7e27feb0526736d101c2b5 | [
"MIT"
] | 9 | 2015-08-07T15:03:00.000Z | 2020-05-01T04:54:02.000Z | tests/storage_api_methods/test_exists.py | Stuvros/django-selectel-storage | 076f7e3c58d9391e2e7e27feb0526736d101c2b5 | [
"MIT"
] | 19 | 2015-05-20T14:16:25.000Z | 2022-03-31T06:31:59.000Z | import uuid
def test_exists_returns_false_when_the_file_does_not_exist(selectel_storage):
non_existing_file = '{0}/non-exist.txt'.format(uuid.uuid4())
assert not selectel_storage.exists(non_existing_file)
def test_exists_returns_true_when_the_file_exists(
selectel_storage,
create_file
):
... | 29 | 77 | 0.772414 | import uuid
def test_exists_returns_false_when_the_file_does_not_exist(selectel_storage):
non_existing_file = '{0}/non-exist.txt'.format(uuid.uuid4())
assert not selectel_storage.exists(non_existing_file)
def test_exists_returns_true_when_the_file_exists(
selectel_storage,
create_file
):
... | true | true |
f7ffd18e7769c69a9cf1e7e2015ee21596bf701b | 309 | py | Python | Others/code_festival/code-thanks-festival-2018-open/b/main.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | 2 | 2020-06-12T09:54:23.000Z | 2021-05-04T01:34:07.000Z | Others/code_festival/code-thanks-festival-2018-open/b/main.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | 961 | 2020-06-23T07:26:22.000Z | 2022-03-31T21:34:52.000Z | Others/code_festival/code-thanks-festival-2018-open/b/main.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
def main():
import sys
input = sys.stdin.readline
x, y = map(int, input().split())
a = 3 * x - y
b = -x + 3 * y
if a >= 0 and a % 8 == 0 and b >= 0 and b % 8 == 0:
print("Yes")
else:
print("No")
if __name__ == "__main__":
main()
| 14.045455 | 55 | 0.436893 |
def main():
import sys
input = sys.stdin.readline
x, y = map(int, input().split())
a = 3 * x - y
b = -x + 3 * y
if a >= 0 and a % 8 == 0 and b >= 0 and b % 8 == 0:
print("Yes")
else:
print("No")
if __name__ == "__main__":
main()
| true | true |
f7ffd1d561da0917f45b033bfcbc3fd07f8c6797 | 3,983 | py | Python | synapse/events/validator.py | whitemike889/synapse | 97bf3077550915161765fdd1cf9290d8039a55f9 | [
"Apache-2.0"
] | null | null | null | synapse/events/validator.py | whitemike889/synapse | 97bf3077550915161765fdd1cf9290d8039a55f9 | [
"Apache-2.0"
] | null | null | null | synapse/events/validator.py | whitemike889/synapse | 97bf3077550915161765fdd1cf9290d8039a55f9 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2014-2016 OpenMarket 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 applicab... | 34.634783 | 79 | 0.584233 |
from six import string_types
from synapse.api.constants import MAX_ALIAS_LENGTH, EventTypes, Membership
from synapse.api.errors import Codes, SynapseError
from synapse.api.room_versions import EventFormatVersions
from synapse.types import EventID, RoomID, UserID
class EventValidator(object):
def v... | true | true |
f7ffd352b51ea5078d9b782189356b229c3fc8e5 | 858 | py | Python | Mp4ToWav.py | louisondumont/Emotion-Classification-Ravdess | 9c5317cde9d3c440e050018db124f51d1f56245a | [
"MIT"
] | null | null | null | Mp4ToWav.py | louisondumont/Emotion-Classification-Ravdess | 9c5317cde9d3c440e050018db124f51d1f56245a | [
"MIT"
] | 12 | 2020-11-13T19:04:46.000Z | 2022-03-12T00:45:54.000Z | Mp4ToWav.py | louisondumont/Emotion-Classification-Ravdess | 9c5317cde9d3c440e050018db124f51d1f56245a | [
"MIT"
] | null | null | null | import os
import subprocess
# Loop through the filesystem
for root, dirs, files in os.walk("./folder", topdown=False):
# Loop through files
for name in files:
# Consider only mp4
if name.endswith('.mp4'):
# Using ffmpeg to convert the mp4 in wav
# Example co... | 35.75 | 192 | 0.538462 | import os
import subprocess
for root, dirs, files in os.walk("./folder", topdown=False):
for name in files:
if name.endswith('.mp4'):
command = "ffmpeg -i /Users/marcogdepinto/Desktop" + root[1:] + "/" + name + " " + "-ab 160k -ac 2 -ar 4410... | true | true |
f7ffd455683de04fed0cdc139e75533fc64de951 | 215 | py | Python | devel/apps/ik/models/__init__.py | riscoscloverleaf/chatcube | a7184ef76108f90a74a88d3183a3d21c1249a0f5 | [
"MIT"
] | null | null | null | devel/apps/ik/models/__init__.py | riscoscloverleaf/chatcube | a7184ef76108f90a74a88d3183a3d21c1249a0f5 | [
"MIT"
] | null | null | null | devel/apps/ik/models/__init__.py | riscoscloverleaf/chatcube | a7184ef76108f90a74a88d3183a3d21c1249a0f5 | [
"MIT"
] | null | null | null | from .members import Member, MemberOnline
from .member_propertis import Country
from .member_settings import MemberSettings
from .globalvars import GlobalVars
from .chat import Chat, ChatMember, Message, OpenedChat
| 35.833333 | 55 | 0.846512 | from .members import Member, MemberOnline
from .member_propertis import Country
from .member_settings import MemberSettings
from .globalvars import GlobalVars
from .chat import Chat, ChatMember, Message, OpenedChat
| true | true |
f7ffd4f2c78c5417120fbdc7b598952e92567bc9 | 3,070 | py | Python | nagnodeconfig.py | DheerajCidda/Nagios-Redfish-API-Integration | 7a433fc670e5367ccfb30711bbdcd964f5e1e4d1 | [
"BSD-3-Clause"
] | null | null | null | nagnodeconfig.py | DheerajCidda/Nagios-Redfish-API-Integration | 7a433fc670e5367ccfb30711bbdcd964f5e1e4d1 | [
"BSD-3-Clause"
] | null | null | null | nagnodeconfig.py | DheerajCidda/Nagios-Redfish-API-Integration | 7a433fc670e5367ccfb30711bbdcd964f5e1e4d1 | [
"BSD-3-Clause"
] | null | null | null | import os
import sys
import time
import configparser
config = configparser.ConfigParser()
config.read('nagios_node_config.conf')
hostList = config['new_nodes']['new_ip_list']
if hostList == "":
print ("\nNo new Redfish enabled node available for Nagios configuration.\n")
#print (config['config_nodes']['config... | 32.315789 | 105 | 0.628013 | import os
import sys
import time
import configparser
config = configparser.ConfigParser()
config.read('nagios_node_config.conf')
hostList = config['new_nodes']['new_ip_list']
if hostList == "":
print ("\nNo new Redfish enabled node available for Nagios configuration.\n")
sys.exit(0)
else:
print ("\nT... | true | true |
f7ffd5c942d5daba3c1b542dd0e57743b1dab9fb | 796 | py | Python | migrations/versions/2b46478eeb50_.py | feasiblereplica/kindlebox | 84c7b75eea013e04780d7bdbb77dfc387cebf75a | [
"MIT"
] | 136 | 2015-01-17T22:07:18.000Z | 2022-02-20T05:21:57.000Z | migrations/versions/2b46478eeb50_.py | feasiblereplica/kindlebox | 84c7b75eea013e04780d7bdbb77dfc387cebf75a | [
"MIT"
] | 16 | 2015-02-18T21:56:17.000Z | 2020-01-15T11:48:22.000Z | migrations/versions/2b46478eeb50_.py | feasiblereplica/kindlebox | 84c7b75eea013e04780d7bdbb77dfc387cebf75a | [
"MIT"
] | 19 | 2015-02-19T10:43:53.000Z | 2020-04-23T15:03:36.000Z | """empty message
Revision ID: 2b46478eeb50
Revises: d7fc2abf989
Create Date: 2014-08-10 23:38:50.200231
"""
# revision identifiers, used by Alembic.
revision = '2b46478eeb50'
down_revision = 'd7fc2abf989'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - pl... | 24.121212 | 63 | 0.629397 |
revision = '2b46478eeb50'
down_revision = 'd7fc2abf989'
from alembic import op
import sqlalchemy as sa
def upgrade():
existing_nullable=True)
| true | true |
f7ffd63a9278cb16add3189d7ab37fae4f0662fe | 3,408 | py | Python | Django/tasking-and-analysis-system-django/tasking-and-analysis-system/apps/reports/forms.py | Yeva9/ITC-projects | 19e967d656c86c64f04cc1ffbe03540f97c6eb34 | [
"MIT"
] | null | null | null | Django/tasking-and-analysis-system-django/tasking-and-analysis-system/apps/reports/forms.py | Yeva9/ITC-projects | 19e967d656c86c64f04cc1ffbe03540f97c6eb34 | [
"MIT"
] | null | null | null | Django/tasking-and-analysis-system-django/tasking-and-analysis-system/apps/reports/forms.py | Yeva9/ITC-projects | 19e967d656c86c64f04cc1ffbe03540f97c6eb34 | [
"MIT"
] | null | null | null | from datetime import datetime
from django import forms
from apps.reports.models import Report
from apps.tasks.forms import DateInput
from apps.upload.models import Upload
from .helper import get_selected_date_list
from apps.constants import General, Errors, Style, ReportsFields
from apps.audit_trail.models import Audi... | 42.074074 | 128 | 0.580399 | from datetime import datetime
from django import forms
from apps.reports.models import Report
from apps.tasks.forms import DateInput
from apps.upload.models import Upload
from .helper import get_selected_date_list
from apps.constants import General, Errors, Style, ReportsFields
from apps.audit_trail.models import Audi... | true | true |
f7ffd6c33691ba2cf5d9c28f7ee56a9f33f4003a | 56,019 | py | Python | modules/templates/SAFIRE/config.py | waidyanatha/eden | a275ed7d10c2bf8839de86b7ac7c549186fc94b7 | [
"MIT"
] | 1 | 2018-12-25T05:33:36.000Z | 2018-12-25T05:33:36.000Z | modules/templates/SAFIRE/config.py | waidyanatha/eden | a275ed7d10c2bf8839de86b7ac7c549186fc94b7 | [
"MIT"
] | null | null | null | modules/templates/SAFIRE/config.py | waidyanatha/eden | a275ed7d10c2bf8839de86b7ac7c549186fc94b7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from collections import OrderedDict
from gluon import current, URL
from gluon.storage import Storage
def config(settings):
"""
Template settings for SaFiRe: Sahana First Response
http://eden.sahanafoundation.org/wiki/BluePrint/SAFIRE
"""
T = current.T
settin... | 45.103865 | 198 | 0.441529 |
from collections import OrderedDict
from gluon import current, URL
from gluon.storage import Storage
def config(settings):
T = current.T
settings.base.system_name = T("Sahana First Response")
settings.base.system_name_short = T("SAFIRE")
settings.base.prepopulate.append("SAFIRE")
setting... | true | true |
f7ffd7eb79bf3ba2a89c9da9051d078b6be0c139 | 1,735 | py | Python | simdeblur/model/loss/perceptual_loss.py | ljzycmd/SimDeblur | dd2f60c41176b75c4eaf80d740f547c206aa8227 | [
"MIT"
] | 190 | 2021-03-22T13:59:42.000Z | 2022-03-08T21:14:41.000Z | simdeblur/model/loss/perceptual_loss.py | ljzycmd/SimDeblur | dd2f60c41176b75c4eaf80d740f547c206aa8227 | [
"MIT"
] | 9 | 2021-04-26T06:44:40.000Z | 2022-03-25T07:48:30.000Z | simdeblur/model/loss/perceptual_loss.py | ljzycmd/SimDeblur | dd2f60c41176b75c4eaf80d740f547c206aa8227 | [
"MIT"
] | 27 | 2021-03-23T03:11:00.000Z | 2022-03-19T21:26:02.000Z | """ ************************************************
* fileName: perceptual_loss.py
* desc: Perceptual loss using vggnet with conv1_2, conv2_2, conv3_3 feature,
before relu layer.
* author: mingdeng_cao
* date: 2021/07/09 11:08
* last revised: None
************************************************ """
import ... | 32.735849 | 94 | 0.617291 |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchvision.models import vgg19, vgg16
from ..build import LOSS_REGISTRY
@LOSS_REGISTRY.register()
class PerceptualLossVGG19(nn.Module):
def __init__(self, layer_idx=[2, 7, 14], layer_weights=[1, 0.2, 0.04], reduction="sum"):
supe... | true | true |
f7ffd8d7f5b9f1db0f196ac262eff03184566218 | 63,299 | py | Python | napalm/nxos_ssh/nxos_ssh.py | remingu/napalm | 884ac086e614c20bdfe2238876d70832d33d3a27 | [
"Apache-2.0"
] | null | null | null | napalm/nxos_ssh/nxos_ssh.py | remingu/napalm | 884ac086e614c20bdfe2238876d70832d33d3a27 | [
"Apache-2.0"
] | null | null | null | napalm/nxos_ssh/nxos_ssh.py | remingu/napalm | 884ac086e614c20bdfe2238876d70832d33d3a27 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2015 Spotify AB. All rights reserved.
#
# The contents of this file are 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/LICE... | 38.503041 | 99 | 0.501825 |
from builtins import super
import re
import socket
from netaddr import IPAddress, IPNetwork
from netaddr.core import AddrFormatError
from napalm.base import helpers
from napalm.base.exceptions import CommandErrorException, ReplaceConfigException
from napalm.nxos import NXOSDriverBase
HOUR_SECONDS ... | true | true |
f7ffdadfd08c532d4ddb10b50d5697bfd1838ea6 | 1,622 | py | Python | modules/signatures/windows/antidbg_debuggercheck.py | Yuanmessi/Bold-Falcon | 00fcaba0b3d9c462b9d20ecb256ff85db5d119e2 | [
"BSD-3-Clause"
] | 24 | 2021-06-21T07:35:37.000Z | 2022-03-22T03:33:59.000Z | modules/signatures/windows/antidbg_debuggercheck.py | Yuanmessi/Bold-Falcon | 00fcaba0b3d9c462b9d20ecb256ff85db5d119e2 | [
"BSD-3-Clause"
] | 3 | 2021-07-01T08:09:05.000Z | 2022-01-28T03:38:36.000Z | modules/signatures/windows/antidbg_debuggercheck.py | Yuanmessi/Bold-Falcon | 00fcaba0b3d9c462b9d20ecb256ff85db5d119e2 | [
"BSD-3-Clause"
] | 6 | 2021-06-22T05:32:57.000Z | 2022-02-11T02:05:45.000Z | # Copyright (C) 2018 Kevin Ross
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the... | 29.490909 | 76 | 0.696054 |
from lib.cuckoo.common.abstracts import Signature
class ChecksDebugger(Signature):
name = "checks_debugger"
description = "Checks if process is being debugged by a debugger"
severity = 1
categories = ["anti-debug"]
authors = ["Kevin Ross"]
minimum = "2.0"
filter_apinames = ... | true | true |
f7ffdb4a44411e66e6e5e0ae554d733f23bab2b6 | 655 | py | Python | migrations/versions/b8bfbb8170b6_add_mood.py | edementyev/wakeupbot | 975b95efe6845589046cf185da241a4aa255caf7 | [
"MIT"
] | null | null | null | migrations/versions/b8bfbb8170b6_add_mood.py | edementyev/wakeupbot | 975b95efe6845589046cf185da241a4aa255caf7 | [
"MIT"
] | null | null | null | migrations/versions/b8bfbb8170b6_add_mood.py | edementyev/wakeupbot | 975b95efe6845589046cf185da241a4aa255caf7 | [
"MIT"
] | null | null | null | """add_mood
Revision ID: b8bfbb8170b6
Revises: d459222e4af3
Create Date: 2020-07-19 11:11:16.102951
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "b8bfbb8170b6"
down_revision = "d459222e4af3"
branch_labels = None
depends_on = None
def upgrade():
# ### co... | 23.392857 | 81 | 0.694656 | import sqlalchemy as sa
from alembic import op
revision = "b8bfbb8170b6"
down_revision = "d459222e4af3"
branch_labels = None
depends_on = None
def upgrade():
| true | true |
f7ffdc7d44321f951095bf2994ac47ace0753d9f | 4,240 | py | Python | tests/python/pants_test/tasks/test_thrift_linter_integration.py | square/pants | 28a018c7f47900aec4f576c81a52e0e4b41d9fec | [
"Apache-2.0"
] | 11 | 2015-01-20T01:39:41.000Z | 2019-08-08T07:27:44.000Z | tests/python/pants_test/tasks/test_thrift_linter_integration.py | fakeNetflix/square-repo-pants | 28a018c7f47900aec4f576c81a52e0e4b41d9fec | [
"Apache-2.0"
] | 1 | 2019-08-21T07:29:26.000Z | 2019-08-21T07:29:26.000Z | tests/python/pants_test/tasks/test_thrift_linter_integration.py | fakeNetflix/square-repo-pants | 28a018c7f47900aec4f576c81a52e0e4b41d9fec | [
"Apache-2.0"
] | 5 | 2015-03-30T02:46:53.000Z | 2018-03-08T20:10:43.000Z | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement,
print_function, unicode_literals)
from pants_test.pant... | 42.828283 | 93 | 0.706368 |
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement,
print_function, unicode_literals)
from pants_test.pants_run_integration_test import PantsRunIntegrationTest
class ThriftLinterTest(PantsRunIntegrationTest):
def test_good(self):
cmd = ... | true | true |
f7ffdd1859f3c607028e46364794c66139d2c888 | 628 | py | Python | manage.py | Bchizi/instajam | 1a1669fa28acfaf5158715be3b7bd27ac1dc407a | [
"MIT"
] | null | null | null | manage.py | Bchizi/instajam | 1a1669fa28acfaf5158715be3b7bd27ac1dc407a | [
"MIT"
] | 9 | 2021-03-19T04:37:19.000Z | 2022-03-12T00:10:39.000Z | manage.py | Bchizi/instajam | 1a1669fa28acfaf5158715be3b7bd27ac1dc407a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'instajam.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise Impor... | 28.545455 | 73 | 0.683121 |
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'instajam.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
... | true | true |
f7ffdd4c9a7a25cd70129b8f2b4b7827e0ace372 | 346 | py | Python | OOP/10_properties.py | marinaoliveira96/python-exercises | 13fc0ec30dec9bb6531cdeb41c80726971975835 | [
"MIT"
] | null | null | null | OOP/10_properties.py | marinaoliveira96/python-exercises | 13fc0ec30dec9bb6531cdeb41c80726971975835 | [
"MIT"
] | null | null | null | OOP/10_properties.py | marinaoliveira96/python-exercises | 13fc0ec30dec9bb6531cdeb41c80726971975835 | [
"MIT"
] | null | null | null | class Product:
def __init__(self, price):
self.price = price
@property
def price(self):
return self.__price
@price.setter
def price(self, value):
if value < 0:
raise ValueError("Price cannot be negative.")
self.__price = value
# getter and setter
product = Product(10)
product.price... | 19.222222 | 51 | 0.67052 | class Product:
def __init__(self, price):
self.price = price
@property
def price(self):
return self.__price
@price.setter
def price(self, value):
if value < 0:
raise ValueError("Price cannot be negative.")
self.__price = value
product = Product(10)
product.price = 9
print(product.... | true | true |
f7ffdd60b8aaa2c0752e32a70abef6541234574f | 460 | py | Python | bin/rehex.py | advantage-development/masternode-sentinel | d809d52a37d5d7bc15b02f9491396ec5bd269822 | [
"MIT"
] | null | null | null | bin/rehex.py | advantage-development/masternode-sentinel | d809d52a37d5d7bc15b02f9491396ec5bd269822 | [
"MIT"
] | null | null | null | bin/rehex.py | advantage-development/masternode-sentinel | d809d52a37d5d7bc15b02f9491396ec5bd269822 | [
"MIT"
] | null | null | null | import simplejson
import binascii
import sys
import pdb
from pprint import pprint
import sys
import os
sys.path.append(os.path.normpath(os.path.join(os.path.dirname(__file__), '../lib')))
import advantagelib
# ============================================================================
usage = "%s <hex>" % sys.argv[0]
... | 20.909091 | 84 | 0.591304 | import simplejson
import binascii
import sys
import pdb
from pprint import pprint
import sys
import os
sys.path.append(os.path.normpath(os.path.join(os.path.dirname(__file__), '../lib')))
import advantagelib
usage = "%s <hex>" % sys.argv[0]
obj = None
if len(sys.argv) < 2:
print(usage)
sys.exit(1)
else:
o... | true | true |
f7ffe1d22350a43524089bad9076cac3b1e79224 | 4,076 | py | Python | Collections-a-installer/community-general-2.4.0/scripts/inventory/freeipa.py | d-amien-b/simple-getwordpress | da90d515a0aa837b633d50db4d91d22b031c04a2 | [
"MIT"
] | 1 | 2020-01-22T13:11:23.000Z | 2020-01-22T13:11:23.000Z | Collections-a-installer/community-general-2.4.0/scripts/inventory/freeipa.py | d-amien-b/simple-getwordpress | da90d515a0aa837b633d50db4d91d22b031c04a2 | [
"MIT"
] | 12 | 2020-02-21T07:24:52.000Z | 2020-04-14T09:54:32.000Z | Collections-a-installer/community-general-2.4.0/scripts/inventory/freeipa.py | d-amien-b/simple-getwordpress | da90d515a0aa837b633d50db4d91d22b031c04a2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import argparse
from distutils.version import LooseVersion
import json
import ... | 32.094488 | 92 | 0.648675 |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import argparse
from distutils.version import LooseVersion
import json
import os
import sys
from ipalib import api, errors, __version__ as IPA_VERSION
from ansible.module_utils.six import u
def initialize():
api.bootstra... | true | true |
f7ffe21bd0f2206db7cb425b138213367a16205d | 18,287 | py | Python | bootleg/dataloaders/wiki_dataset.py | mleszczy/bootleg | 162d74001cdfbbe146753393641d549e0328acb1 | [
"Apache-2.0"
] | 1 | 2021-01-11T18:40:09.000Z | 2021-01-11T18:40:09.000Z | bootleg/dataloaders/wiki_dataset.py | mleszczy/bootleg | 162d74001cdfbbe146753393641d549e0328acb1 | [
"Apache-2.0"
] | null | null | null | bootleg/dataloaders/wiki_dataset.py | mleszczy/bootleg | 162d74001cdfbbe146753393641d549e0328acb1 | [
"Apache-2.0"
] | null | null | null | import os
import time
import ujson as json
import torch
import sys
import pickle
import numpy as np
from torch.utils.data import Dataset
import torch.distributed as dist
import torch.nn.functional as F
from bootleg.symbols.alias_entity_table import AliasEntityTable
from bootleg.symbols.constants import *
from bootleg.... | 58.238854 | 156 | 0.667359 | import os
import time
import ujson as json
import torch
import sys
import pickle
import numpy as np
from torch.utils.data import Dataset
import torch.distributed as dist
import torch.nn.functional as F
from bootleg.symbols.alias_entity_table import AliasEntityTable
from bootleg.symbols.constants import *
from bootleg.... | true | true |
f7ffe2d124f030817d7d121b6510b244546c2572 | 1,741 | py | Python | src/globus_cli/commands/group/member/approve.py | globusonline/globus-cli | 696857baafac198141edc3c1c29c72215f217df1 | [
"Apache-2.0"
] | null | null | null | src/globus_cli/commands/group/member/approve.py | globusonline/globus-cli | 696857baafac198141edc3c1c29c72215f217df1 | [
"Apache-2.0"
] | 1 | 2016-04-09T17:26:05.000Z | 2016-04-11T16:13:50.000Z | src/globus_cli/commands/group/member/approve.py | globusonline/globus-cli | 696857baafac198141edc3c1c29c72215f217df1 | [
"Apache-2.0"
] | null | null | null | import click
from globus_cli.login_manager import LoginManager
from globus_cli.parsing import IdentityType, ParsedIdentity, command
from globus_cli.termio import FORMAT_TEXT_RECORD, formatted_print
from globus_cli.types import FIELD_LIST_T
APPROVED_USER_FIELDS: FIELD_LIST_T = [
("Group ID", "group_id"),
("App... | 38.688889 | 86 | 0.721424 | import click
from globus_cli.login_manager import LoginManager
from globus_cli.parsing import IdentityType, ParsedIdentity, command
from globus_cli.termio import FORMAT_TEXT_RECORD, formatted_print
from globus_cli.types import FIELD_LIST_T
APPROVED_USER_FIELDS: FIELD_LIST_T = [
("Group ID", "group_id"),
("App... | true | true |
f7ffe32f2174b14ab36b60734d3122f28c18bae8 | 17,424 | py | Python | synchronize.py | calizarr/PhenoPiSight | 9ee01dfa5e11a16e43ae1c71f1effcf58f22435a | [
"MIT"
] | 4 | 2017-09-03T14:12:42.000Z | 2019-02-27T00:24:40.000Z | synchronize.py | calizarr/PhenoPiSight | 9ee01dfa5e11a16e43ae1c71f1effcf58f22435a | [
"MIT"
] | null | null | null | synchronize.py | calizarr/PhenoPiSight | 9ee01dfa5e11a16e43ae1c71f1effcf58f22435a | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012-2013, Timothy Appnel <tim@appnel.com>
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | 37.470968 | 542 | 0.646809 |
DOCUMENTATION = '''
---
module: synchronize
version_added: "1.4"
short_description: Uses rsync to make synchronizing file paths in your playbooks quick and easy.
description:
- C(synchronize) is a wrapper around the rsync command, meant to make common tasks with rsync easier. It is run and origina... | true | true |
f7ffe43478e59d4e76f10ecc71e03ff0041074d2 | 927 | py | Python | src/utils/print_config.py | jabra/PrivacyFL | 93dd68cc7dcd52f1f95e28c514d21a1e1ea081cb | [
"Unlicense",
"MIT"
] | null | null | null | src/utils/print_config.py | jabra/PrivacyFL | 93dd68cc7dcd52f1f95e28c514d21a1e1ea081cb | [
"Unlicense",
"MIT"
] | null | null | null | src/utils/print_config.py | jabra/PrivacyFL | 93dd68cc7dcd52f1f95e28c514d21a1e1ea081cb | [
"Unlicense",
"MIT"
] | null | null | null | import sys
sys.path.append('..')
import config
def print_config(len_per_iteration):
"""
Prints parameters at start of simulation. The two arguments are dynamically created and hence not in config.
:param len_per_iteration: length of training dataset for each client for each iteration
:param sensitivi... | 42.136364 | 116 | 0.692557 | import sys
sys.path.append('..')
import config
def print_config(len_per_iteration):
print('\n')
print(
'Running simulation with: \n{} clients \n{} iterations \n{}differential privacy \nand {}security \n'.format(
config.NUM_CLIENTS, config.ITERATIONS, 'no ' if not config.USE_DP_PRIVACY els... | true | true |
f7ffe45b0b680cfeefb1ddf830a61bdf34ba9439 | 1,033 | py | Python | server/dva/celery.py | Yinqingwen/Dva | 3b8d1d1435f6a804a9c370006b931f9dc50a7462 | [
"BSD-3-Clause",
"Apache-2.0",
"MIT"
] | 1 | 2021-04-10T20:19:35.000Z | 2021-04-10T20:19:35.000Z | server/dva/celery.py | Yinqingwen/Dva | 3b8d1d1435f6a804a9c370006b931f9dc50a7462 | [
"BSD-3-Clause",
"Apache-2.0",
"MIT"
] | null | null | null | server/dva/celery.py | Yinqingwen/Dva | 3b8d1d1435f6a804a9c370006b931f9dc50a7462 | [
"BSD-3-Clause",
"Apache-2.0",
"MIT"
] | 3 | 2021-07-13T10:52:48.000Z | 2022-03-11T03:31:45.000Z | from __future__ import absolute_import
import os
from celery import Celery
from kombu.common import Broadcast
# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'dva.settings')
from django.conf import settings # noqa
app = Celery('dva')
# Using a st... | 26.487179 | 71 | 0.752178 | from __future__ import absolute_import
import os
from celery import Celery
from kombu.common import Broadcast
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'dva.settings')
from django.conf import settings
app = Celery('dva')
app.config_from_object('django.conf:settings')
app.conf.update(
CELERYD_PREFET... | true | true |
f7ffe4a8e96616b9a39388581dae3d307ee35ac0 | 823 | py | Python | src/attack_flow/scripts/graphviz.py | center-for-threat-informed-defense/attack-flow | 93a39a29edca19be979f1a8df4b95564bba49e8d | [
"Apache-2.0"
] | 165 | 2022-03-03T14:41:10.000Z | 2022-03-31T10:36:41.000Z | src/attack_flow/scripts/graphviz.py | center-for-threat-informed-defense/attack-flow | 93a39a29edca19be979f1a8df4b95564bba49e8d | [
"Apache-2.0"
] | 3 | 2022-03-03T14:55:30.000Z | 2022-03-25T14:22:57.000Z | src/attack_flow/scripts/graphviz.py | center-for-threat-informed-defense/attack-flow | 93a39a29edca19be979f1a8df4b95564bba49e8d | [
"Apache-2.0"
] | 18 | 2022-03-03T16:56:05.000Z | 2022-03-24T21:05:26.000Z | """
Convert ATT&CK Flow documents to GraphViz format.
"""
import argparse
import json
import attack_flow.graphviz
def parse_args():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('attack_flow',
help='The Attack Flow document to convert.')
parser.add_argu... | 29.392857 | 72 | 0.652491 | import argparse
import json
import attack_flow.graphviz
def parse_args():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('attack_flow',
help='The Attack Flow document to convert.')
parser.add_argument('graphviz',
help='The path to... | true | true |
f7ffe4b88557ef5caff135ba51749eb640ce96ca | 1,096 | py | Python | setup.py | AlexandrMov/sqlbehave | 587e71a7cf1307867fb848daf98c3990bb554165 | [
"MIT"
] | null | null | null | setup.py | AlexandrMov/sqlbehave | 587e71a7cf1307867fb848daf98c3990bb554165 | [
"MIT"
] | 2 | 2017-03-24T13:58:52.000Z | 2017-12-01T06:54:39.000Z | setup.py | AlexandrMov/sqlbehave | 587e71a7cf1307867fb848daf98c3990bb554165 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name="sqlbehave",
version="0.0.2.dev2",
description='sqlbehave is beha... | 31.314286 | 84 | 0.663321 | from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name="sqlbehave",
version="0.0.2.dev2",
description='sqlbehave is beha... | true | true |
f7ffe59dcff0102f4855cc0bce68c23e8115095b | 278 | py | Python | projects/code_combat/4_Backwoods_Forest/159-Blind_Distance/blind.py | only-romano/junkyard | b60a25b2643f429cdafee438d20f9966178d6f36 | [
"MIT"
] | null | null | null | projects/code_combat/4_Backwoods_Forest/159-Blind_Distance/blind.py | only-romano/junkyard | b60a25b2643f429cdafee438d20f9966178d6f36 | [
"MIT"
] | null | null | null | projects/code_combat/4_Backwoods_Forest/159-Blind_Distance/blind.py | only-romano/junkyard | b60a25b2643f429cdafee438d20f9966178d6f36 | [
"MIT"
] | null | null | null | def nearestEnemyDistance():
enemy = hero.findNearestEnemy()
result = 0
if enemy:
result = hero.distanceTo(enemy)
return result
while True:
enemyDistance = nearestEnemyDistance()
if enemyDistance > 0:
hero.say(enemyDistance)
| 21.384615 | 43 | 0.636691 | def nearestEnemyDistance():
enemy = hero.findNearestEnemy()
result = 0
if enemy:
result = hero.distanceTo(enemy)
return result
while True:
enemyDistance = nearestEnemyDistance()
if enemyDistance > 0:
hero.say(enemyDistance)
| true | true |
f7ffe5ee6efd884d5b57ef0d7b05ecab3c6be7b4 | 408 | py | Python | paypalpayoutssdk/config.py | truthiswill/Payouts-Python-SDK | ba04ffafb8165a1b7cdfd5841f08a96dccdd190b | [
"BSD-Source-Code"
] | 23 | 2020-03-02T13:31:55.000Z | 2022-03-06T11:25:21.000Z | paypalpayoutssdk/config.py | truthiswill/Payouts-Python-SDK | ba04ffafb8165a1b7cdfd5841f08a96dccdd190b | [
"BSD-Source-Code"
] | 4 | 2020-09-26T08:40:26.000Z | 2022-03-01T17:29:51.000Z | paypalpayoutssdk/config.py | truthiswill/Payouts-Python-SDK | ba04ffafb8165a1b7cdfd5841f08a96dccdd190b | [
"BSD-Source-Code"
] | 21 | 2020-02-07T10:02:57.000Z | 2021-09-09T18:05:02.000Z | __version__ = "1.0.0"
__pypi_username__ = "paypal"
__pypi_packagename__ = "paypal-payouts-sdk"
__github_username__ = "paypal"
__github_reponame__ = "Payouts-Python-SDK"
import re
import os
def find_packages():
path = "."
ret = []
for root, dirs, files in os.walk(path):
if '__init__.py' in files:
... | 25.5 | 74 | 0.632353 | __version__ = "1.0.0"
__pypi_username__ = "paypal"
__pypi_packagename__ = "paypal-payouts-sdk"
__github_username__ = "paypal"
__github_reponame__ = "Payouts-Python-SDK"
import re
import os
def find_packages():
path = "."
ret = []
for root, dirs, files in os.walk(path):
if '__init__.py' in files:
... | true | true |
f7ffe64fb0ae085e941308aab7b3c4ec8cad6e53 | 362 | py | Python | homepage/tests/test_misc_stuff.py | ralphqq/dc-alerts-service | f00131dd7b2a0ee72ae5476b40f8552480c655b6 | [
"MIT"
] | null | null | null | homepage/tests/test_misc_stuff.py | ralphqq/dc-alerts-service | f00131dd7b2a0ee72ae5476b40f8552480c655b6 | [
"MIT"
] | 7 | 2020-06-05T22:45:18.000Z | 2021-06-09T18:32:43.000Z | homepage/tests/test_misc_stuff.py | ralphqq/dc-alerts-service | f00131dd7b2a0ee72ae5476b40f8552480c655b6 | [
"MIT"
] | null | null | null | from django.conf import settings
from django.test import TestCase
class MiscStuffTest(TestCase):
def test_external_url_building_settings(self):
self.assertEqual(
settings.EXTERNAL_URL_SCHEME,
'http'
)
self.assertEqual(
settings.EXTERNAL_URL_... | 24.133333 | 51 | 0.607735 | from django.conf import settings
from django.test import TestCase
class MiscStuffTest(TestCase):
def test_external_url_building_settings(self):
self.assertEqual(
settings.EXTERNAL_URL_SCHEME,
'http'
)
self.assertEqual(
settings.EXTERNAL_URL_... | true | true |
f7ffe660a98ad0e182716b9ac152e211afd97eb2 | 345 | py | Python | shark/utils/dynamic_callable.py | bikeshedder/shark | 36c5baecee6f5d8967aea8385b509d84dd9affa6 | [
"BSD-2-Clause"
] | null | null | null | shark/utils/dynamic_callable.py | bikeshedder/shark | 36c5baecee6f5d8967aea8385b509d84dd9affa6 | [
"BSD-2-Clause"
] | 1 | 2022-03-12T00:23:43.000Z | 2022-03-12T00:23:43.000Z | shark/utils/dynamic_callable.py | bikeshedder/shark | 36c5baecee6f5d8967aea8385b509d84dd9affa6 | [
"BSD-2-Clause"
] | null | null | null | from importlib import import_module
def dynamic_callable(name):
module_name, function_name = name.rsplit('.', 1)
def wrapped(*args, **kwargs):
module = import_module(module_name)
function = getattr(module, function_name)
return function(*args, **kwargs)
wrapped.__name__ == function... | 28.75 | 52 | 0.692754 | from importlib import import_module
def dynamic_callable(name):
module_name, function_name = name.rsplit('.', 1)
def wrapped(*args, **kwargs):
module = import_module(module_name)
function = getattr(module, function_name)
return function(*args, **kwargs)
wrapped.__name__ == function... | true | true |
f7ffe86fc7b8c773b2ef4a9eef3ba5381fd2da5c | 2,151 | py | Python | robotice/conf/managers/actions.py | robotice/robotice | aa8af3ac357021a8884bdbdaae760c7a368bfd13 | [
"Apache-2.0"
] | 2 | 2015-02-19T23:39:28.000Z | 2015-03-27T21:59:50.000Z | robotice/conf/managers/actions.py | robotice/robotice | aa8af3ac357021a8884bdbdaae760c7a368bfd13 | [
"Apache-2.0"
] | 1 | 2015-01-17T12:22:42.000Z | 2015-01-17T12:22:42.000Z | robotice/conf/managers/actions.py | robotice/robotice | aa8af3ac357021a8884bdbdaae760c7a368bfd13 | [
"Apache-2.0"
] | null | null | null |
"""
base object managers
"""
import sys
import logging
from robotice.conf.managers import base
from celery import states
from celery import Celery
from celery.result import AsyncResult
from celery.backends.base import DisabledBackend
import glob
from yaml import load, dump, safe_dump
LOG = logging.getLogger(__na... | 25.305882 | 79 | 0.599721 |
"""
base object managers
"""
import sys
import logging
from robotice.conf.managers import base
from celery import states
from celery import Celery
from celery.result import AsyncResult
from celery.backends.base import DisabledBackend
import glob
from yaml import load, dump, safe_dump
LOG = logging.getLogger(__na... | false | true |
f7ffe881e3d6c7584439f1385c3b5a42c4b05e99 | 9,907 | py | Python | pylibup/static.py | trisongz/pylibup | 456c082032cb14e7b2f12f115b4033237a0b1d1f | [
"MIT"
] | null | null | null | pylibup/static.py | trisongz/pylibup | 456c082032cb14e7b2f12f115b4033237a0b1d1f | [
"MIT"
] | null | null | null | pylibup/static.py | trisongz/pylibup | 456c082032cb14e7b2f12f115b4033237a0b1d1f | [
"MIT"
] | null | null | null | setup_py_template = """
import os
import sys
from pathlib import Path
from setuptools import setup, find_packages
{% if require_py3 %}
if sys.version_info.major != 3:
raise RuntimeError("This package requires Python 3+")
{% endif %}
version = '{{ pkg_version }}'
pkg_name = '{{ pkg_name }}'
gitrepo = '{{ git_repo ... | 20.989407 | 109 | 0.589179 | setup_py_template = """
import os
import sys
from pathlib import Path
from setuptools import setup, find_packages
{% if require_py3 %}
if sys.version_info.major != 3:
raise RuntimeError("This package requires Python 3+")
{% endif %}
version = '{{ pkg_version }}'
pkg_name = '{{ pkg_name }}'
gitrepo = '{{ git_repo ... | true | true |
f7ffe8ade72a8d8c7bd87a0e343c39fbb201ee82 | 792 | py | Python | kaggle-classification/keras_trainer/custom_metrics.py | CyberFlameGO/conversationai-models | f82f66398b221d9fe3bcfd7641610af454b3db46 | [
"Apache-2.0"
] | 139 | 2018-03-05T16:34:41.000Z | 2022-03-09T01:36:13.000Z | kaggle-classification/keras_trainer/custom_metrics.py | CyberFlameGO/conversationai-models | f82f66398b221d9fe3bcfd7641610af454b3db46 | [
"Apache-2.0"
] | 125 | 2018-03-05T21:19:31.000Z | 2020-11-13T17:50:12.000Z | kaggle-classification/keras_trainer/custom_metrics.py | CyberFlameGO/conversationai-models | f82f66398b221d9fe3bcfd7641610af454b3db46 | [
"Apache-2.0"
] | 47 | 2018-03-21T19:37:14.000Z | 2022-03-09T01:36:21.000Z | """Custom metrics used by Keras models."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
def auc_roc(y_true, y_pred):
# any tensorflow metric
y_true = tf.to_int32(tf.greater(y_true, 0.5))
value, update_op = tf.metrics.auc(y... | 27.310345 | 74 | 0.738636 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
def auc_roc(y_true, y_pred):
y_true = tf.to_int32(tf.greater(y_true, 0.5))
value, update_op = tf.metrics.auc(y_true, y_pred)
metric_vars = [
i for i in tf.local_var... | true | true |
f7ffe92c13c3f191c4b7709360a2d1ca4865e69c | 18,296 | py | Python | libcloud/dns/drivers/gandi_live.py | Matir/libcloud | a496af770e91905e286f9565f84acfcabe2db7d5 | [
"Apache-2.0"
] | 1,435 | 2015-01-07T05:32:51.000Z | 2022-03-25T19:39:34.000Z | libcloud/dns/drivers/gandi_live.py | Matir/libcloud | a496af770e91905e286f9565f84acfcabe2db7d5 | [
"Apache-2.0"
] | 1,158 | 2015-01-04T18:08:42.000Z | 2022-03-24T14:34:57.000Z | libcloud/dns/drivers/gandi_live.py | Matir/libcloud | a496af770e91905e286f9565f84acfcabe2db7d5 | [
"Apache-2.0"
] | 832 | 2015-01-05T09:20:21.000Z | 2022-03-24T19:22:19.000Z | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | 37.723711 | 79 | 0.565643 |
from __future__ import with_statement
import copy
from libcloud.dns.types import Provider, RecordType
from libcloud.dns.types import RecordError
from libcloud.dns.types import ZoneDoesNotExistError, \
RecordDoesNotExistError, ZoneAlreadyExistsError, RecordAlreadyExistsError
from libcloud.dns.base i... | true | true |
f7ffe96eddd38d835bb2151aa9593ac17d333095 | 728 | py | Python | visualization/train.py | norveclibalikci/MyDeepLearning | d72e3d70aa11c8d8b05f0f72744a9cafa30e808a | [
"MIT"
] | 2 | 2018-05-15T10:28:48.000Z | 2018-09-28T13:38:11.000Z | visualization/train.py | norveclibalikci/MyDeepLearning | d72e3d70aa11c8d8b05f0f72744a9cafa30e808a | [
"MIT"
] | null | null | null | visualization/train.py | norveclibalikci/MyDeepLearning | d72e3d70aa11c8d8b05f0f72744a9cafa30e808a | [
"MIT"
] | 1 | 2019-10-25T13:24:05.000Z | 2019-10-25T13:24:05.000Z | from model import *
from utils import *
from dataloader import *
from torch.autograd import Variable
import pandas as pd
import torchvision.datasets as dset
from torch.utils.data import Dataset, DataLoader
NUM_TRAIN = 1000
NUM_VAL = 128
mnist_train = dset.MNIST('../datasets/MNIST', train=True, transform=T.ToTensor())... | 40.444444 | 91 | 0.68544 | from model import *
from utils import *
from dataloader import *
from torch.autograd import Variable
import pandas as pd
import torchvision.datasets as dset
from torch.utils.data import Dataset, DataLoader
NUM_TRAIN = 1000
NUM_VAL = 128
mnist_train = dset.MNIST('../datasets/MNIST', train=True, transform=T.ToTensor())... | true | true |
f7ffe9946f6207a94db033e357cc28b56d519864 | 199 | py | Python | server/favorites/apps.py | tosmak16/favorite-things | bf8e464c26f2fd2b595265d4de8153a7f14ed16e | [
"MIT"
] | 1 | 2019-08-12T18:15:11.000Z | 2019-08-12T18:15:11.000Z | server/favorites/apps.py | tosmak16/favorite-things | bf8e464c26f2fd2b595265d4de8153a7f14ed16e | [
"MIT"
] | 14 | 2020-06-05T22:44:47.000Z | 2022-02-26T15:01:20.000Z | server/favorites/apps.py | tosmak16/favorite-things | bf8e464c26f2fd2b595265d4de8153a7f14ed16e | [
"MIT"
] | 1 | 2020-02-09T01:53:26.000Z | 2020-02-09T01:53:26.000Z | from django.apps import AppConfig
class FavoritesConfig(AppConfig):
name = 'favorites'
def ready(self):
# everytime server restarts
import favorites.signals # noqa: F401
| 18.090909 | 46 | 0.683417 | from django.apps import AppConfig
class FavoritesConfig(AppConfig):
name = 'favorites'
def ready(self):
import favorites.signals
| true | true |
f7ffea4a142cffd73d6b28e0bc91eba7626e48fb | 3,378 | py | Python | configs/ttfnet/ttfnet_d53_beta02_3lr_1x.py | mrsempress/mmdetection | cb650560c97a2fe56a9b369a1abc8ec17e06583a | [
"Apache-2.0"
] | null | null | null | configs/ttfnet/ttfnet_d53_beta02_3lr_1x.py | mrsempress/mmdetection | cb650560c97a2fe56a9b369a1abc8ec17e06583a | [
"Apache-2.0"
] | null | null | null | configs/ttfnet/ttfnet_d53_beta02_3lr_1x.py | mrsempress/mmdetection | cb650560c97a2fe56a9b369a1abc8ec17e06583a | [
"Apache-2.0"
] | null | null | null | # model settings
model = dict(
type='TTFNet',
pretrained='./pretrain/darknet53.pth',
backbone=dict(
type='DarknetV3',
layers=[1, 2, 8, 8, 4],
inplanes=[3, 32, 64, 128, 256, 512],
planes=[32, 64, 128, 256, 512, 1024],
norm_cfg=dict(type='BN'),
out_indices=(1, 2... | 30.432432 | 86 | 0.625518 |
model = dict(
type='TTFNet',
pretrained='./pretrain/darknet53.pth',
backbone=dict(
type='DarknetV3',
layers=[1, 2, 8, 8, 4],
inplanes=[3, 32, 64, 128, 256, 512],
planes=[32, 64, 128, 256, 512, 1024],
norm_cfg=dict(type='BN'),
out_indices=(1, 2, 3, 4),
... | true | true |
f7ffead94838ee66fcacafa656afbc8bfe584c7b | 626 | py | Python | intouch/queryset_csv/views.py | intouch-smartwater/queryset-csv | ca390f677ff206609c6e559b8d2fdaef5a1f13dd | [
"MIT"
] | 1 | 2019-04-25T13:38:15.000Z | 2019-04-25T13:38:15.000Z | intouch/queryset_csv/views.py | intouch-smartwater/queryset-csv | ca390f677ff206609c6e559b8d2fdaef5a1f13dd | [
"MIT"
] | 1 | 2019-04-25T08:54:56.000Z | 2019-04-26T08:45:37.000Z | intouch/queryset_csv/views.py | intouch-smartwater/queryset-csv | ca390f677ff206609c6e559b8d2fdaef5a1f13dd | [
"MIT"
] | 1 | 2020-01-13T09:37:39.000Z | 2020-01-13T09:37:39.000Z | from django.apps.registry import apps
from django.views.generic.base import View
from intouch.queryset_csv.shortcuts import queryset_as_csv_response
from django.core.exceptions import PermissionDenied
class ModelAsCsvView(View):
def get(self, request, app, model):
Model = apps.get_model(app, m... | 31.3 | 81 | 0.710863 | from django.apps.registry import apps
from django.views.generic.base import View
from intouch.queryset_csv.shortcuts import queryset_as_csv_response
from django.core.exceptions import PermissionDenied
class ModelAsCsvView(View):
def get(self, request, app, model):
Model = apps.get_model(app, m... | true | true |
f7ffeaea9f8cebf4897d90d9cab71ff4dae91d81 | 127 | py | Python | copyxnat/__init__.py | tomdoel/copyxnat | 9fcce0ef584151feefbfc7b5c259f6a7bcd7b5f3 | [
"MIT"
] | null | null | null | copyxnat/__init__.py | tomdoel/copyxnat | 9fcce0ef584151feefbfc7b5c259f6a7bcd7b5f3 | [
"MIT"
] | 1 | 2021-02-22T14:13:21.000Z | 2021-02-23T22:27:29.000Z | copyxnat/__init__.py | tomdoel/copyxnat | 9fcce0ef584151feefbfc7b5c259f6a7bcd7b5f3 | [
"MIT"
] | null | null | null | # coding=utf-8
"""copyxnat"""
from copyxnat.utils.versioning import get_version
__version__ = get_version()
del get_version
| 14.111111 | 49 | 0.771654 |
from copyxnat.utils.versioning import get_version
__version__ = get_version()
del get_version
| true | true |
f7ffebeac00b00d4280016ea33be60bd01035b11 | 463 | py | Python | week1/ex7.py | bkwin66/pyclass | e3c8359a7f7461627b70c3f3819df3f6405e5dd6 | [
"Apache-2.0"
] | null | null | null | week1/ex7.py | bkwin66/pyclass | e3c8359a7f7461627b70c3f3819df3f6405e5dd6 | [
"Apache-2.0"
] | null | null | null | week1/ex7.py | bkwin66/pyclass | e3c8359a7f7461627b70c3f3819df3f6405e5dd6 | [
"Apache-2.0"
] | null | null | null | #Brian windle
import yaml
import json
from pprint import pprint
def output_format(my_list, my_str):
print '\n\n'
print '#' * 3
print '#' * 3 + my_str
print '#' * 3
pprint(my_list)
yaml_file = 'myyaml.yml'
json_file = 'myjson.json'
with open(yaml_file) as f:
yaml_list = yaml.load(f)
with op... | 15.965517 | 37 | 0.641469 |
import yaml
import json
from pprint import pprint
def output_format(my_list, my_str):
print '\n\n'
print '#' * 3
print '#' * 3 + my_str
print '#' * 3
pprint(my_list)
yaml_file = 'myyaml.yml'
json_file = 'myjson.json'
with open(yaml_file) as f:
yaml_list = yaml.load(f)
with open(json_file)... | false | true |
f7fff00def5778f70d4d972ab111d5fd66951d71 | 467 | py | Python | Languages/Python/power_in_logn.py | Nandini2901/Hacktoberfest-1 | ac5eff7c8678f3ce00041bdba20c63c416dac690 | [
"MIT"
] | 1 | 2021-07-14T19:04:48.000Z | 2021-07-14T19:04:48.000Z | Languages/Python/power_in_logn.py | Nandini2901/Hacktoberfest-1 | ac5eff7c8678f3ce00041bdba20c63c416dac690 | [
"MIT"
] | 1 | 2020-10-13T06:01:45.000Z | 2020-10-13T06:01:45.000Z | Languages/Python/power_in_logn.py | Nandini2901/Hacktoberfest-1 | ac5eff7c8678f3ce00041bdba20c63c416dac690 | [
"MIT"
] | 1 | 2020-10-13T10:41:27.000Z | 2020-10-13T10:41:27.000Z | def power(x, y):
res = 1
sign = y<0
if sign:
y = y* -1
while (y > 0):
if ((y & 1) == 1) :
res = res * x
y = y >> 1
x = x * x
if sign:
return 1/res
return res
print("Power is ",p... | 16.103448 | 32 | 0.372591 | def power(x, y):
res = 1
sign = y<0
if sign:
y = y* -1
while (y > 0):
if ((y & 1) == 1) :
res = res * x
y = y >> 1
x = x * x
if sign:
return 1/res
return res
print("Power is ",p... | true | true |
f7fff12c9de7d965576542633e24101a52624955 | 16,310 | py | Python | parlai/tasks/blended_skill_talk/agents.py | erekgit/parlai | 5d11848316b0b4fe7bf28ca19b215a37004ec668 | [
"MIT"
] | 41 | 2019-06-07T17:36:10.000Z | 2021-11-16T06:26:16.000Z | parlai/tasks/blended_skill_talk/agents.py | erekgit/parlai | 5d11848316b0b4fe7bf28ca19b215a37004ec668 | [
"MIT"
] | null | null | null | parlai/tasks/blended_skill_talk/agents.py | erekgit/parlai | 5d11848316b0b4fe7bf28ca19b215a37004ec668 | [
"MIT"
] | 11 | 2019-06-06T01:19:08.000Z | 2020-07-23T07:34:56.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import copy
import json
import os
import re
from collections import defaultdict
from typing import List, Optional, Dict
... | 38.018648 | 247 | 0.614715 |
import copy
import json
import os
import re
from collections import defaultdict
from typing import List, Optional, Dict
from tqdm import tqdm
from parlai.core.opt import Opt
from parlai.core.teachers import (
ParlAIDialogTeacher,
create_task_agent_from_taskname,
MultiTaskTeacher,
)
from parlai.tasks.... | true | true |
f7fff262cc16ee1944b9c7c01e1a4feef815e52e | 14,803 | py | Python | sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_file_services_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_file_services_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_file_services_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 43.538235 | 221 | 0.694656 |
import functools
from typing import Any, Callable, Dict, Generic, Optional, TypeVar
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.tran... | true | true |
f7fff6388d20cf11a663e38b2a0096c3fefada1f | 977 | py | Python | blog/migrations/0006_gin_indexes.py | simonw/simonwillisonblog | fd3170cd5473dbd6520d4e48c57923d2b894972d | [
"Apache-2.0"
] | 45 | 2017-10-01T23:21:22.000Z | 2022-03-31T08:20:46.000Z | blog/migrations/0006_gin_indexes.py | simonw/simonwillisonblog | fd3170cd5473dbd6520d4e48c57923d2b894972d | [
"Apache-2.0"
] | 109 | 2017-10-05T06:40:00.000Z | 2022-03-31T13:13:44.000Z | blog/migrations/0006_gin_indexes.py | simonw/simonwillisonblog | fd3170cd5473dbd6520d4e48c57923d2b894972d | [
"Apache-2.0"
] | 11 | 2017-10-17T15:16:26.000Z | 2022-02-20T07:22:32.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-10-01 01:48
import django.contrib.postgres.indexes
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("blog", "0005_search_document"),
]
operations = [
migrations.AddIndex(
m... | 27.914286 | 81 | 0.592631 |
import django.contrib.postgres.indexes
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("blog", "0005_search_document"),
]
operations = [
migrations.AddIndex(
model_name="blogmark",
index=django.contrib.postgres.indexes... | true | true |
f7fff664ca3755ab704f3cd271d7ec016e3ca1e2 | 483 | py | Python | dpybot/cogs/samplecog/converters.py | jack1142/DpyBot | 6be031c4556de8fb570ad99aac375580f04f947c | [
"Apache-2.0"
] | null | null | null | dpybot/cogs/samplecog/converters.py | jack1142/DpyBot | 6be031c4556de8fb570ad99aac375580f04f947c | [
"Apache-2.0"
] | null | null | null | dpybot/cogs/samplecog/converters.py | jack1142/DpyBot | 6be031c4556de8fb570ad99aac375580f04f947c | [
"Apache-2.0"
] | null | null | null | from discord.ext import commands
from .enums import Color
class SpecialColor(commands.Converter):
async def convert(self, ctx: commands.Context, arg: str) -> Color:
try:
number = int(arg)
except ValueError:
raise commands.BadArgument(f"`{arg}` is not a valid number!")
... | 30.1875 | 88 | 0.625259 | from discord.ext import commands
from .enums import Color
class SpecialColor(commands.Converter):
async def convert(self, ctx: commands.Context, arg: str) -> Color:
try:
number = int(arg)
except ValueError:
raise commands.BadArgument(f"`{arg}` is not a valid number!")
... | true | true |
f7fff89b764c635cc196776558a821e6aa38bdad | 824 | py | Python | plyer/platforms/linux/uniqueid.py | malverick/noti_improve | c8b379285e0de041f2133ec4d22b0affdf4a993e | [
"MIT"
] | 3 | 2020-07-17T16:23:14.000Z | 2021-05-25T21:00:49.000Z | plyer/platforms/linux/uniqueid.py | malverick/noti_improve | c8b379285e0de041f2133ec4d22b0affdf4a993e | [
"MIT"
] | 1 | 2021-05-25T20:54:22.000Z | 2021-05-26T20:22:30.000Z | plyer/platforms/linux/uniqueid.py | malverick/noti_improve | c8b379285e0de041f2133ec4d22b0affdf4a993e | [
"MIT"
] | 1 | 2019-05-17T09:45:00.000Z | 2019-05-17T09:45:00.000Z | from subprocess import Popen, PIPE
from plyer.facades import UniqueID
from plyer.utils import whereis_exe
from os import environ
class LinuxUniqueID(UniqueID):
def _get_uid(self):
old_lang = environ.get('LANG')
environ['LANG'] = 'C'
lshw_process = Popen(["lshw", "-quiet"], stdout=PIPE, st... | 26.580645 | 74 | 0.606796 | from subprocess import Popen, PIPE
from plyer.facades import UniqueID
from plyer.utils import whereis_exe
from os import environ
class LinuxUniqueID(UniqueID):
def _get_uid(self):
old_lang = environ.get('LANG')
environ['LANG'] = 'C'
lshw_process = Popen(["lshw", "-quiet"], stdout=PIPE, st... | true | true |
f7fffa531ddbbd10451622d9cb24b825c131564b | 662 | py | Python | setup.py | sapcc/osc-ccloud-server-group-member-changes | e9be3ecc963deb7e76c318da56af8fc2d45c398f | [
"Apache-2.0"
] | null | null | null | setup.py | sapcc/osc-ccloud-server-group-member-changes | e9be3ecc963deb7e76c318da56af8fc2d45c398f | [
"Apache-2.0"
] | null | null | null | setup.py | sapcc/osc-ccloud-server-group-member-changes | e9be3ecc963deb7e76c318da56af8fc2d45c398f | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 SAP SE
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | 31.52381 | 69 | 0.744713 |
import setuptools
setuptools.setup(
setup_requires=['pbr>=2.0.0'],
pbr=True)
| true | true |
f7fffaca3ceb9b4063aef2c03e704c87cfe9e3c2 | 223 | py | Python | Chapter10/Ch10/server/create_database.py | henrryyanez/Tkinter-GUI-Programming-by-Example | c8a326d6034b5e54f77605a8ec840cb8fac89412 | [
"MIT"
] | 127 | 2018-08-27T16:34:43.000Z | 2022-03-22T19:20:53.000Z | Chapter10/Ch10/server/create_database.py | PiotrAdaszewski/Tkinter-GUI-Programming-by-Example | c8a326d6034b5e54f77605a8ec840cb8fac89412 | [
"MIT"
] | 8 | 2019-04-11T06:47:36.000Z | 2022-03-11T23:23:42.000Z | Chapter10/Ch10/server/create_database.py | PiotrAdaszewski/Tkinter-GUI-Programming-by-Example | c8a326d6034b5e54f77605a8ec840cb8fac89412 | [
"MIT"
] | 85 | 2018-04-30T19:42:21.000Z | 2022-03-30T01:22:54.000Z | import sqlite3
database = sqlite3.connect("chat.db")
cursor = database.cursor()
create_users_sql = "CREATE TABLE users (username TEXT, real_name TEXT)"
cursor.execute(create_users_sql)
database.commit()
database.close()
| 20.272727 | 71 | 0.780269 | import sqlite3
database = sqlite3.connect("chat.db")
cursor = database.cursor()
create_users_sql = "CREATE TABLE users (username TEXT, real_name TEXT)"
cursor.execute(create_users_sql)
database.commit()
database.close()
| true | true |
f7fffadb472bb27e2b2411f95f54edd36b346e4c | 12,505 | py | Python | tmglow/nn/modules/flowUtils.py | zabaras/deep-turbulence | 0daca5daada449d4ba16bce37b703e20b444b6bc | [
"MIT"
] | 20 | 2020-12-01T14:58:01.000Z | 2022-03-15T07:40:10.000Z | tmglow/nn/modules/flowUtils.py | zabaras/deep-turbulence | 0daca5daada449d4ba16bce37b703e20b444b6bc | [
"MIT"
] | 2 | 2021-06-05T14:29:42.000Z | 2022-03-04T15:57:40.000Z | tmglow/nn/modules/flowUtils.py | zabaras/deep-turbulence | 0daca5daada449d4ba16bce37b703e20b444b6bc | [
"MIT"
] | 4 | 2020-09-04T06:11:04.000Z | 2021-09-05T10:47:16.000Z | '''
=====
Distributed by: Notre Dame SCAI Lab (MIT Liscense)
- Associated publication:
url: http://aimsciences.org//article/id/3a9f3d14-3421-4947-a45f-a9cc74edd097
doi: https://dx.doi.org/10.3934/fods.2020019
github: https://github.com/zabaras/deep-turbulence
=====
'''
import torch
import torch.nn as nn
import torch.nn... | 37.328358 | 125 | 0.601359 | import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import math
from torch.autograd import Variable
from torch.nn.modules.utils import _pair, _quadruple
class Squeeze(nn.Module):
def __init__(self, factor=2):
super(Squeeze, self).__init__()
assert factor >= 1
... | true | true |
f7fffc5072519c36d33dbea2959605cf69be1cab | 1,509 | py | Python | build/lib/oddstream/kde_estimation.py | tartaruszen/oddstream | c3f2a4d6cba9753052acf8be03e5df038d40b745 | [
"MIT"
] | 1 | 2021-11-15T08:47:52.000Z | 2021-11-15T08:47:52.000Z | oddstream/kde_estimation.py | tartaruszen/oddstream | c3f2a4d6cba9753052acf8be03e5df038d40b745 | [
"MIT"
] | null | null | null | oddstream/kde_estimation.py | tartaruszen/oddstream | c3f2a4d6cba9753052acf8be03e5df038d40b745 | [
"MIT"
] | null | null | null | from fastkde import fastKDE
import numpy as np
"""
Fast 2D Kernel Density Estimation with simple point evaluation
"""
class KDEEstimation2D(object):
def __init__(self, X):
self.pdf, self.axes = fastKDE.pdf(X[:, 0], X[:, 1])
def evaluate_points(self, X):
m = X.shape[0]
values = np.a... | 29.588235 | 66 | 0.542081 | from fastkde import fastKDE
import numpy as np
class KDEEstimation2D(object):
def __init__(self, X):
self.pdf, self.axes = fastKDE.pdf(X[:, 0], X[:, 1])
def evaluate_points(self, X):
m = X.shape[0]
values = np.array(range(0, m), dtype=float)
for i in range(0, m):
va... | true | true |
f7fffca807f6e130c47099320eb8a860afe7e2d3 | 1,567 | py | Python | tests/test_sheet.py | tomviner/dojo-monthly-emailer | 08c0bf9a28384cd3d8df8289c310a3028de7259d | [
"MIT"
] | null | null | null | tests/test_sheet.py | tomviner/dojo-monthly-emailer | 08c0bf9a28384cd3d8df8289c310a3028de7259d | [
"MIT"
] | 3 | 2017-08-29T02:43:57.000Z | 2018-02-12T15:04:34.000Z | tests/test_sheet.py | tomviner/dojo-monthly-emailer | 08c0bf9a28384cd3d8df8289c310a3028de7259d | [
"MIT"
] | null | null | null | "Integration tests. Makes actual calls to Google Spreadsheets API."
import re
from datetime import date
from dojo_emailer.app import (
GDOCS_URL_PREFIX,
GDOCS_URL_SHEET_NAME,
SPREADSHEET_NAME
)
from dojo_emailer.sheet import (
get_dojo_data_from_date,
get_first_cell_by_prefix,
get_spreadsheet_i... | 29.566038 | 77 | 0.716018 | import re
from datetime import date
from dojo_emailer.app import (
GDOCS_URL_PREFIX,
GDOCS_URL_SHEET_NAME,
SPREADSHEET_NAME
)
from dojo_emailer.sheet import (
get_dojo_data_from_date,
get_first_cell_by_prefix,
get_spreadsheet_id
)
def test_get_spreadsheet_id():
expected_id_regex = r'... | true | true |
f7fffd719a5cd8692bc4e44cdc86e3420276144d | 10,949 | py | Python | docs/conf.py | Pyco7/django-ajax-views | 5361936867b8c9b9b444d7e33bfc6ef1268b4611 | [
"MIT"
] | 6 | 2016-10-27T11:09:35.000Z | 2021-06-05T18:19:51.000Z | docs/conf.py | Pyco7/django-ajax-views | 5361936867b8c9b9b444d7e33bfc6ef1268b4611 | [
"MIT"
] | 3 | 2020-02-12T00:08:06.000Z | 2021-06-10T19:46:55.000Z | docs/conf.py | Pyco7/django-ajax-views | 5361936867b8c9b9b444d7e33bfc6ef1268b4611 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# django-ajax-views documentation build configuration file, created by
# sphinx-quickstart on Fri Sep 9 16:09:03 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in... | 28.965608 | 109 | 0.700521 |
import os
import sys
import django
from django.conf import settings
sys.path.insert(0, os.path.abspath('..'))
import ajaxviews
settings.configure(
INSTALLED_APPS=[
'django.contrib.auth',
'django.contrib.contenttypes',
]
)
django.setup()
extensions = [
'sphinx.... | true | true |
f7fffddbc301f3e555f75ad4cb2d067430628925 | 7,189 | py | Python | bluetooth/generate.py | ziransun/wpt | ab8f451eb39eb198584d547f5d965ef54df2a86a | [
"BSD-3-Clause"
] | 14,668 | 2015-01-01T01:57:10.000Z | 2022-03-31T23:33:32.000Z | bluetooth/generate.py | ziransun/wpt | ab8f451eb39eb198584d547f5d965ef54df2a86a | [
"BSD-3-Clause"
] | 7,642 | 2018-05-28T09:38:03.000Z | 2022-03-31T20:55:48.000Z | bluetooth/generate.py | ziransun/wpt | ab8f451eb39eb198584d547f5d965ef54df2a86a | [
"BSD-3-Clause"
] | 5,941 | 2015-01-02T11:32:21.000Z | 2022-03-31T16:35:46.000Z | # Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# TODO(509038): Delete the file in LayoutTests/bluetooth after all the script
# tests have been migrated to this directory.
"""Generator script for Web Blue... | 37.836842 | 119 | 0.678815 |
import fnmatch
import os
import re
import sys
import logging
TEMPLATES_DIR = 'script-tests'
class GeneratedTest:
def __init__(self, data, path, template):
self.data = data
self.path = path
self.template = template
def GetGeneratedTests():
bluetooth_tests_dir = os.path.dirnam... | true | true |
f7ffff2c3473af10e580059f64b75ea3164113cc | 119 | py | Python | examples/echo/submissions/partially_accepted/sol.py | jsannemo/problemtools | 591f24e99c8d66a819fc8dde82c5ec55173b3c83 | [
"MIT"
] | null | null | null | examples/echo/submissions/partially_accepted/sol.py | jsannemo/problemtools | 591f24e99c8d66a819fc8dde82c5ec55173b3c83 | [
"MIT"
] | null | null | null | examples/echo/submissions/partially_accepted/sol.py | jsannemo/problemtools | 591f24e99c8d66a819fc8dde82c5ec55173b3c83 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
input()
A = input()
B = input()
C = input()
D = input()
E = input()
print(A)
print(C)
print(E)
| 9.916667 | 22 | 0.579832 |
input()
A = input()
B = input()
C = input()
D = input()
E = input()
print(A)
print(C)
print(E)
| true | true |
f7ffff8e2c23d4349b4f870e5d0fb30bb2f3b2a3 | 12,427 | py | Python | cleverhans/train.py | iamgroot42/cleverhans | 53da9cd6daf9d7457800831c3eaa75f729a39145 | [
"MIT"
] | 21 | 2019-06-07T17:05:30.000Z | 2022-02-07T03:25:15.000Z | cleverhans/train.py | iamgroot42/cleverhans | 53da9cd6daf9d7457800831c3eaa75f729a39145 | [
"MIT"
] | 7 | 2019-12-16T22:20:01.000Z | 2022-02-10T00:45:21.000Z | cleverhans/train.py | iamgroot42/cleverhans | 53da9cd6daf9d7457800831c3eaa75f729a39145 | [
"MIT"
] | 8 | 2019-06-11T03:06:29.000Z | 2022-01-18T04:18:27.000Z | """
Multi-replica synchronous training
NOTE: This module is much more free to change than many other modules
in CleverHans. CleverHans is very conservative about changes to any
code that affects the output of benchmark tests (attacks, evaluation
methods, etc.). This module provides *model training* functionality
not ... | 40.087097 | 79 | 0.692042 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import os
import time
import warnings
import math
import numpy as np
from six.moves import xrange
import tensorflow as tf
from cleverhans import canary
f... | true | true |
790000c95e646d16c85155649652ef660ef0c928 | 64,381 | py | Python | python/ccxt/base/exchange.py | tssujt/ccxt | 95a8befe3540043bac408b36794342b0a9e724cd | [
"MIT"
] | null | null | null | python/ccxt/base/exchange.py | tssujt/ccxt | 95a8befe3540043bac408b36794342b0a9e724cd | [
"MIT"
] | null | null | null | python/ccxt/base/exchange.py | tssujt/ccxt | 95a8befe3540043bac408b36794342b0a9e724cd | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Base exchange class"""
# -----------------------------------------------------------------------------
__version__ = '1.17.322'
# -----------------------------------------------------------------------------
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import NetworkE... | 40.16282 | 185 | 0.600177 |
__version__ = '1.17.322'
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import NetworkError
from ccxt.base.errors import NotSupported
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import DDoSProtection
from ccxt.base.errors import RequestTimeout
from ccxt.base.errors i... | true | true |
790000ca60eca1b680d51304f349756cd85eaf86 | 1,321 | py | Python | src_old/tests/scripts/lambda/pdes/2d/ex10.py | toddrme2178/pyccel | deec37503ab0c5d0bcca1a035f7909f7ce8ef653 | [
"MIT"
] | null | null | null | src_old/tests/scripts/lambda/pdes/2d/ex10.py | toddrme2178/pyccel | deec37503ab0c5d0bcca1a035f7909f7ce8ef653 | [
"MIT"
] | null | null | null | src_old/tests/scripts/lambda/pdes/2d/ex10.py | toddrme2178/pyccel | deec37503ab0c5d0bcca1a035f7909f7ce8ef653 | [
"MIT"
] | null | null | null | # coding: utf-8
# ... import symbolic tools
weak_formulation = load('pyccel.symbolic.gelato', 'weak_formulation', True, 2)
glt_function = load('pyccel.symbolic.gelato', 'glt_function', True, 3)
Grad = load('pyccel.symbolic.gelato', 'Grad', False, 1)
Curl = load('pyccel.symbolic.gelato', 'Curl', False, 1)
... | 25.901961 | 78 | 0.549584 |
weak_formulation = load('pyccel.symbolic.gelato', 'weak_formulation', True, 2)
glt_function = load('pyccel.symbolic.gelato', 'glt_function', True, 3)
Grad = load('pyccel.symbolic.gelato', 'Grad', False, 1)
Curl = load('pyccel.symbolic.gelato', 'Curl', False, 1)
Div = load('pyccel.symbolic.gelato', 'Di... | true | true |
790000df29a505a4935451d347ad88914c76144d | 5,295 | py | Python | tableauserverclient/models/flow_item.py | essentia-team/server-client-python | c9375204c581c5288fe4b6abc3c84fea41a887b5 | [
"CC0-1.0",
"MIT"
] | 1 | 2019-10-24T02:00:52.000Z | 2019-10-24T02:00:52.000Z | tableauserverclient/models/flow_item.py | essentia-team/server-client-python | c9375204c581c5288fe4b6abc3c84fea41a887b5 | [
"CC0-1.0",
"MIT"
] | null | null | null | tableauserverclient/models/flow_item.py | essentia-team/server-client-python | c9375204c581c5288fe4b6abc3c84fea41a887b5 | [
"CC0-1.0",
"MIT"
] | 1 | 2022-03-29T23:19:43.000Z | 2022-03-29T23:19:43.000Z | import xml.etree.ElementTree as ET
from .exceptions import UnpopulatedPropertyError
from .property_decorators import property_not_nullable, property_is_boolean
from .tag_item import TagItem
from ..datetime_helpers import parse_datetime
import copy
class FlowItem(object):
def __init__(self, project_id, name=None):... | 32.484663 | 114 | 0.628706 | import xml.etree.ElementTree as ET
from .exceptions import UnpopulatedPropertyError
from .property_decorators import property_not_nullable, property_is_boolean
from .tag_item import TagItem
from ..datetime_helpers import parse_datetime
import copy
class FlowItem(object):
def __init__(self, project_id, name=None):... | true | true |
790004af7c8a455df790e5cce7f3ac3cfb392fef | 117 | py | Python | apps/common/templatetags/smhtags.py | TransparentHealth/smh-organization | ca32d1cbb7600e8b22e43e06edab83c323a2404d | [
"Apache-2.0"
] | 3 | 2019-03-03T22:41:00.000Z | 2020-04-16T04:07:07.000Z | apps/common/templatetags/smhtags.py | TransparentHealth/smh_app | ca32d1cbb7600e8b22e43e06edab83c323a2404d | [
"Apache-2.0"
] | 112 | 2019-03-04T14:20:50.000Z | 2020-04-29T21:32:07.000Z | apps/common/templatetags/smhtags.py | TransparentHealth/smh-organization | ca32d1cbb7600e8b22e43e06edab83c323a2404d | [
"Apache-2.0"
] | 2 | 2019-08-01T13:08:28.000Z | 2019-12-06T15:53:25.000Z | from django.template.defaulttags import register
@register.filter
def get(data, key):
return data.get(key, '')
| 16.714286 | 48 | 0.735043 | from django.template.defaulttags import register
@register.filter
def get(data, key):
return data.get(key, '')
| true | true |
790005d23316bbe70e998e38bb1dde32ad9767bf | 1,119 | py | Python | setup.py | nikitanovosibirsk/vedro-allure-reporter | da6bb3e89a13a1e67324f0e791458c65e162f18c | [
"Apache-2.0"
] | 1 | 2021-08-25T12:24:46.000Z | 2021-08-25T12:24:46.000Z | setup.py | nikitanovosibirsk/vedro-allure-reporter | da6bb3e89a13a1e67324f0e791458c65e162f18c | [
"Apache-2.0"
] | 1 | 2022-03-22T14:16:22.000Z | 2022-03-23T09:05:46.000Z | setup.py | nikitanovosibirsk/vedro-allure-reporter | da6bb3e89a13a1e67324f0e791458c65e162f18c | [
"Apache-2.0"
] | null | null | null | from setuptools import find_packages, setup
def find_required():
with open("requirements.txt") as f:
return f.read().splitlines()
def find_dev_required():
with open("requirements-dev.txt") as f:
return f.read().splitlines()
setup(
name="vedro-allure-reporter",
version="0.2.4",
... | 30.243243 | 69 | 0.662198 | from setuptools import find_packages, setup
def find_required():
with open("requirements.txt") as f:
return f.read().splitlines()
def find_dev_required():
with open("requirements-dev.txt") as f:
return f.read().splitlines()
setup(
name="vedro-allure-reporter",
version="0.2.4",
... | true | true |
7900061228d2b80ebd5bff942f29abd5c9db4230 | 12,351 | py | Python | utils/inverter.py | Twizwei/idinvert_pytorch | 11f1126aab517fbe32b488d92f6fdea339463d04 | [
"MIT"
] | null | null | null | utils/inverter.py | Twizwei/idinvert_pytorch | 11f1126aab517fbe32b488d92f6fdea339463d04 | [
"MIT"
] | null | null | null | utils/inverter.py | Twizwei/idinvert_pytorch | 11f1126aab517fbe32b488d92f6fdea339463d04 | [
"MIT"
] | null | null | null | # python 3.7
"""Utility functions to invert a given image back to a latent code."""
from tqdm import tqdm
import cv2
import numpy as np
import torch
from models.stylegan_generator import StyleGANGenerator
from models.stylegan_encoder import StyleGANEncoder
from models.perceptual_model import PerceptualModel
__all__... | 39.209524 | 80 | 0.6644 |
from tqdm import tqdm
import cv2
import numpy as np
import torch
from models.stylegan_generator import StyleGANGenerator
from models.stylegan_encoder import StyleGANEncoder
from models.perceptual_model import PerceptualModel
__all__ = ['StyleGANInverter']
def _softplus(x):
return torch.nn.functional.softplus(x... | true | true |
790006f1c3c27e3c020824f39a42af98da3f28b2 | 4,520 | py | Python | analysis/gen_db/mf_grc/gen_mf_locs_210518.py | htem/cb2_project_analysis | a677cbadc7e3bf0074975a94ed1d06b4801899c0 | [
"MIT"
] | null | null | null | analysis/gen_db/mf_grc/gen_mf_locs_210518.py | htem/cb2_project_analysis | a677cbadc7e3bf0074975a94ed1d06b4801899c0 | [
"MIT"
] | null | null | null | analysis/gen_db/mf_grc/gen_mf_locs_210518.py | htem/cb2_project_analysis | a677cbadc7e3bf0074975a94ed1d06b4801899c0 | [
"MIT"
] | null | null | null | import collections
from collections import defaultdict
import sys
import json
import random
from jsmin import jsmin
from io import StringIO
import numpy as np
import copy
import os
script_n = os.path.basename(__file__).split('.')[0]
script_n = script_n.split('_', 1)[1]
def to_ng(loc):
return (int(loc[0]/4), int(l... | 28.427673 | 122 | 0.623009 | import collections
from collections import defaultdict
import sys
import json
import random
from jsmin import jsmin
from io import StringIO
import numpy as np
import copy
import os
script_n = os.path.basename(__file__).split('.')[0]
script_n = script_n.split('_', 1)[1]
def to_ng(loc):
return (int(loc[0]/4), int(l... | true | true |
7900079cdf32747ee591880bae0317ca36a8f03e | 4,367 | py | Python | common/security-features/subresource/font.py | meyerweb/wpt | f04261533819893c71289614c03434c06856c13e | [
"BSD-3-Clause"
] | 14,668 | 2015-01-01T01:57:10.000Z | 2022-03-31T23:33:32.000Z | common/security-features/subresource/font.py | meyerweb/wpt | f04261533819893c71289614c03434c06856c13e | [
"BSD-3-Clause"
] | 7,642 | 2018-05-28T09:38:03.000Z | 2022-03-31T20:55:48.000Z | common/security-features/subresource/font.py | meyerweb/wpt | f04261533819893c71289614c03434c06856c13e | [
"BSD-3-Clause"
] | 5,941 | 2015-01-02T11:32:21.000Z | 2022-03-31T16:35:46.000Z | import os, sys
from base64 import decodebytes
from wptserve.utils import isomorphic_decode
import importlib
subresource = importlib.import_module("common.security-features.subresource.subresource")
def generate_payload(request, server_data):
data = (u'{"headers": %(headers)s}') % server_data
if b"id" in requ... | 56.714286 | 89 | 0.651477 | import os, sys
from base64 import decodebytes
from wptserve.utils import isomorphic_decode
import importlib
subresource = importlib.import_module("common.security-features.subresource.subresource")
def generate_payload(request, server_data):
data = (u'{"headers": %(headers)s}') % server_data
if b"id" in requ... | true | true |
790007dc0e8352ed637dd24396f6a69566b63345 | 10,359 | py | Python | homeassistant/components/mqtt/discovery.py | tylerball/home-assistant | 5b35317e1e9f3fe28298cd862525c6a386f267df | [
"Apache-2.0"
] | null | null | null | homeassistant/components/mqtt/discovery.py | tylerball/home-assistant | 5b35317e1e9f3fe28298cd862525c6a386f267df | [
"Apache-2.0"
] | null | null | null | homeassistant/components/mqtt/discovery.py | tylerball/home-assistant | 5b35317e1e9f3fe28298cd862525c6a386f267df | [
"Apache-2.0"
] | 1 | 2019-09-06T01:00:46.000Z | 2019-09-06T01:00:46.000Z | """
Support for MQTT discovery.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/mqtt/#discovery
"""
import asyncio
import json
import logging
import re
from homeassistant.components import mqtt
from homeassistant.components.mqtt import CONF_STATE_TOPIC,... | 36.734043 | 79 | 0.646491 | import asyncio
import json
import logging
import re
from homeassistant.components import mqtt
from homeassistant.components.mqtt import CONF_STATE_TOPIC, ATTR_DISCOVERY_HASH
from homeassistant.const import CONF_PLATFORM
from homeassistant.helpers.discovery import async_load_platform
from homeassistant.helpers.dispatch... | true | true |
790008bef397388425c61a748250859aaf874286 | 2,175 | py | Python | venv/lib/python3.7/site-packages/pyecharts/charts/kline.py | Amoswish/graduaction_design_pubgprediction | 3752943bc6bab813ec3a0ad60a5441df6f1e7baf | [
"Apache-2.0"
] | null | null | null | venv/lib/python3.7/site-packages/pyecharts/charts/kline.py | Amoswish/graduaction_design_pubgprediction | 3752943bc6bab813ec3a0ad60a5441df6f1e7baf | [
"Apache-2.0"
] | null | null | null | venv/lib/python3.7/site-packages/pyecharts/charts/kline.py | Amoswish/graduaction_design_pubgprediction | 3752943bc6bab813ec3a0ad60a5441df6f1e7baf | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
from pyecharts.chart import Chart
def kline_tooltip_formatter(params):
text = (
params[0].seriesName
+ "<br/>"
+ "- open:"
+ params[0].data[1]
+ "<br/>"
+ "- close:"
+ params[0].data[2]
+ "<br/>"
+ "- lowest:"
... | 27.884615 | 67 | 0.486437 |
from pyecharts.chart import Chart
def kline_tooltip_formatter(params):
text = (
params[0].seriesName
+ "<br/>"
+ "- open:"
+ params[0].data[1]
+ "<br/>"
+ "- close:"
+ params[0].data[2]
+ "<br/>"
+ "- lowest:"
+ param... | true | true |
790008f7d70f039760e35974e70eeda32a2c44ed | 8,724 | py | Python | validator/models/validation_run.py | wpreimes/qa4sm | 1e9c1c18d07d713a048ad13bac617b147240991c | [
"MIT"
] | 10 | 2019-02-27T15:05:15.000Z | 2022-03-10T21:13:40.000Z | validator/models/validation_run.py | awst-austria/qa4sm | e67c9c0ec75fedabbfc389e4400e1203aa2d8a57 | [
"MIT"
] | 69 | 2019-07-04T23:20:17.000Z | 2022-03-29T06:34:06.000Z | validator/models/validation_run.py | wpreimes/qa4sm | 1e9c1c18d07d713a048ad13bac617b147240991c | [
"MIT"
] | 10 | 2019-03-14T11:46:58.000Z | 2022-03-25T13:06:16.000Z | from datetime import timedelta
from os import path
from re import sub as regex_sub
from shutil import rmtree
import uuid
from django.conf import settings
from django.core.exceptions import ValidationError
from django.core.validators import MinValueValidator, MaxValueValidator
from django.db import models
from django.d... | 40.018349 | 118 | 0.673315 | from datetime import timedelta
from os import path
from re import sub as regex_sub
from shutil import rmtree
import uuid
from django.conf import settings
from django.core.exceptions import ValidationError
from django.core.validators import MinValueValidator, MaxValueValidator
from django.db import models
from django.d... | true | true |
79000906dcb627c39707b46c52140b350e7043eb | 1,573 | py | Python | backend/project404_t8/API/serializers.py | peterweckend/group-project-cmput404 | d59912dbe0252868452a2e142e4c20f953792740 | [
"MIT"
] | 5 | 2019-02-22T21:15:48.000Z | 2019-03-16T22:59:17.000Z | backend/project404_t8/API/serializers.py | cjlee1/group-project-cmput404 | 791ac00494b1005d5b3792492060806bcddc5cf6 | [
"MIT"
] | 66 | 2019-03-13T07:03:42.000Z | 2022-03-11T23:41:00.000Z | backend/project404_t8/API/serializers.py | cjlee1/group-project-cmput404 | 791ac00494b1005d5b3792492060806bcddc5cf6 | [
"MIT"
] | 7 | 2019-01-25T21:09:23.000Z | 2019-07-20T16:11:33.000Z | from rest_framework import serializers
from .models import Post, Comment, Friendship, Follow, Server, PostCategory, PostAuthorizedAuthor
# REST API Serializer JSON https://www.youtube.com/watch?v=V4NjlXiu5WI
from users.models import CustomUser
class UserSerializer(serializers.ModelSerializer):
class Meta:
... | 30.843137 | 97 | 0.682136 | from rest_framework import serializers
from .models import Post, Comment, Friendship, Follow, Server, PostCategory, PostAuthorizedAuthor
from users.models import CustomUser
class UserSerializer(serializers.ModelSerializer):
class Meta:
model = CustomUser
fields = '__all__'
... | true | true |
79000943f3bf01c0665850ee6e73413e916581d8 | 522 | py | Python | stubs/micropython-v1_16-esp32/uheapq.py | mattytrentini/micropython-stubs | 4d596273823b69e9e5bcf5fa67f249c374ee0bbc | [
"MIT"
] | null | null | null | stubs/micropython-v1_16-esp32/uheapq.py | mattytrentini/micropython-stubs | 4d596273823b69e9e5bcf5fa67f249c374ee0bbc | [
"MIT"
] | null | null | null | stubs/micropython-v1_16-esp32/uheapq.py | mattytrentini/micropython-stubs | 4d596273823b69e9e5bcf5fa67f249c374ee0bbc | [
"MIT"
] | null | null | null | """
Module: 'uheapq' on micropython-v1.16-esp32
"""
# MCU: {'ver': 'v1.16', 'port': 'esp32', 'arch': 'xtensawin', 'sysname': 'esp32', 'release': '1.16.0', 'name': 'micropython', 'mpy': 10757, 'version': '1.16.0', 'machine': 'ESP32 module (spiram) with ESP32', 'build': '', 'nodename': 'esp32', 'platform': 'esp32', 'fami... | 27.473684 | 287 | 0.58046 |
from typing import Any
def heapify(*args, **kwargs) -> Any:
...
def heappop(*args, **kwargs) -> Any:
...
def heappush(*args, **kwargs) -> Any:
...
| true | true |
79000958ca956d1f4ddd649980e8d598a155c6b0 | 251 | py | Python | bdd_example/login/urls.py | omiguelperez/DjangoLoginBDD | 9714a1cf31d95a0df2c3a82ccde5b8c00c92268d | [
"MIT"
] | null | null | null | bdd_example/login/urls.py | omiguelperez/DjangoLoginBDD | 9714a1cf31d95a0df2c3a82ccde5b8c00c92268d | [
"MIT"
] | null | null | null | bdd_example/login/urls.py | omiguelperez/DjangoLoginBDD | 9714a1cf31d95a0df2c3a82ccde5b8c00c92268d | [
"MIT"
] | null | null | null | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.login_root, name='login_root'),
url(r'^success/$', views.login_success, name='login_success'),
url(r'^fail/$', views.login_fail, name='login_fail'),
]
| 25.1 | 66 | 0.673307 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.login_root, name='login_root'),
url(r'^success/$', views.login_success, name='login_success'),
url(r'^fail/$', views.login_fail, name='login_fail'),
]
| true | true |
790009f836b12214d122c317d4c425d2cac87663 | 1,413 | py | Python | gold nanocluster synthesis/own_package/others.py | acceleratedmaterials/NUS_workshop | 8937111a4f4d252ed76e33897fd4be7d9582a491 | [
"MIT"
] | 3 | 2018-11-14T13:13:48.000Z | 2022-01-13T16:49:10.000Z | gold nanocluster synthesis/own_package/others.py | acceleratedmaterials/NUS_workshop | 8937111a4f4d252ed76e33897fd4be7d9582a491 | [
"MIT"
] | 17 | 2020-01-28T22:32:32.000Z | 2022-03-11T23:33:24.000Z | gold nanocluster synthesis/own_package/others.py | acceleratedmaterials/NUS_workshop | 8937111a4f4d252ed76e33897fd4be7d9582a491 | [
"MIT"
] | 10 | 2018-11-14T13:15:33.000Z | 2022-01-13T16:48:57.000Z | import numpy as np
import pandas as pd
from openpyxl import load_workbook
import sys
def print_array_to_excel(array, first_cell, ws, axis=2):
'''
Print an np array to excel using openpyxl
:param array: np array
:param first_cell: first cell to start dumping values in
:param ws: worksheet reference.... | 38.189189 | 96 | 0.610757 | import numpy as np
import pandas as pd
from openpyxl import load_workbook
import sys
def print_array_to_excel(array, first_cell, ws, axis=2):
if isinstance(array, (list,)):
array = np.array(array)
shape = array.shape
if axis == 0:
array.flatten()
for i in range(shape[0]):... | true | true |
79000aa5b4520916e6ece843d77d27a1c53957d8 | 1,394 | py | Python | audio_lab_pynq/AxisSwitch.py | cramsay/Audio-Lab-PYNQ | 8f4d1f767b2e697253c7c6dea6445d880401869f | [
"WTFPL"
] | 3 | 2020-04-20T21:48:01.000Z | 2022-01-31T11:24:01.000Z | audio_lab_pynq/AxisSwitch.py | cramsay/Audio-Lab-PYNQ | 8f4d1f767b2e697253c7c6dea6445d880401869f | [
"WTFPL"
] | null | null | null | audio_lab_pynq/AxisSwitch.py | cramsay/Audio-Lab-PYNQ | 8f4d1f767b2e697253c7c6dea6445d880401869f | [
"WTFPL"
] | 1 | 2022-01-31T11:24:05.000Z | 2022-01-31T11:24:05.000Z | from pynq import DefaultIP
# Things to fix up about this driver:
# * Add safety checks [a la C driver](https://github.com/Xilinx/embeddedsw/blob/master/XilinxProcessorIPLib/drivers/axis_switch/src/xaxis_switch_hw.h)
# * Think about better interface / language to control the routing
class AxisSwitch(DefaultIP):
... | 30.977778 | 151 | 0.658537 | from pynq import DefaultIP
class AxisSwitch(DefaultIP):
CTRL_OFFSET = 0x00
CFG_OFFSET = 0x40
CFG_GATE_MASK = 0x02
CFG_DISABLE_MASK = 0x80000000
def __init__(self, description):
super().__init__(description=description)
self.num_mi = int(description['parameters']['NUM_... | true | true |
79000b75fa842f24fb3c23d1a26f99744a99976d | 16,241 | py | Python | test/functional/mempool_accept.py | Mantle-One/mantlecoin | 61342ad672819d412b17ec110aca89a9d0205dcc | [
"MIT"
] | null | null | null | test/functional/mempool_accept.py | Mantle-One/mantlecoin | 61342ad672819d412b17ec110aca89a9d0205dcc | [
"MIT"
] | null | null | null | test/functional/mempool_accept.py | Mantle-One/mantlecoin | 61342ad672819d412b17ec110aca89a9d0205dcc | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2017-2020 The Mantle Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test mempool acceptance of raw transactions."""
from decimal import Decimal
from io import BytesIO
impo... | 48.050296 | 154 | 0.634382 |
from decimal import Decimal
from io import BytesIO
import math
from test_framework.test_framework import MantleTestFramework
from test_framework.key import ECKey
from test_framework.messages import (
BIP125_SEQUENCE_NUMBER,
COIN,
COutPoint,
CTransaction,
CTxOut,
MAX_BLOCK_BASE_SIZE,
MA... | true | true |
79000c0436d1ec7a629af2fb10decb61e631f8e2 | 18,203 | py | Python | tools/web_dev_style/css_checker_test.py | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 14,668 | 2015-01-01T01:57:10.000Z | 2022-03-31T23:33:32.000Z | tools/web_dev_style/css_checker_test.py | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 86 | 2015-10-21T13:02:42.000Z | 2022-03-14T07:50:50.000Z | tools/web_dev_style/css_checker_test.py | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 5,941 | 2015-01-02T11:32:21.000Z | 2022-03-31T16:35:46.000Z | #!/usr/bin/env python3
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from . import css_checker
from os import path as os_path
import re
from sys import path as sys_path
import unittest
_HERE = os_path.d... | 27.007418 | 121 | 0.658683 |
from . import css_checker
from os import path as os_path
import re
from sys import path as sys_path
import unittest
_HERE = os_path.dirname(os_path.abspath(__file__))
sys_path.append(os_path.join(_HERE, '..', '..'))
from PRESUBMIT_test_mocks import MockInputApi, MockOutputApi, MockFile
class CssCheckerTest(uni... | true | true |
79000c7280a32674d40fe7e6ce459bdae278b0b6 | 172,325 | py | Python | ma.py | azmi155/mu | d6863d432e047b4e5c4a925172757b0febb81633 | [
"MIT"
] | null | null | null | ma.py | azmi155/mu | d6863d432e047b4e5c4a925172757b0febb81633 | [
"MIT"
] | null | null | null | ma.py | azmi155/mu | d6863d432e047b4e5c4a925172757b0febb81633 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#Chucky_Bot
import LINETCR
from LINETCR.lib.curve.ttypes import *
from datetime import datetime
from bs4 import BeautifulSoup
from threading import Thread
from googletrans import Translator
from gtts import gTTS
import time,random,sys,json,codecs,threading,glob,urllib,urllib2,urllib3,re,ast,os,... | 40.951759 | 443 | 0.429363 |
import LINETCR
from LINETCR.lib.curve.ttypes import *
from datetime import datetime
from bs4 import BeautifulSoup
from threading import Thread
from googletrans import Translator
from gtts import gTTS
import time,random,sys,json,codecs,threading,glob,urllib,urllib2,urllib3,re,ast,os,subprocess,requests,tempfile
cl =... | false | true |
79000d6311ac146b82125d572258b1a5fc5a4487 | 4,283 | py | Python | selenium_test.py | sr-comp/Divar | dbbb6aa6b5cbbca25e17b3b16c2b3d57d2e455f0 | [
"Apache-2.0"
] | null | null | null | selenium_test.py | sr-comp/Divar | dbbb6aa6b5cbbca25e17b3b16c2b3d57d2e455f0 | [
"Apache-2.0"
] | null | null | null | selenium_test.py | sr-comp/Divar | dbbb6aa6b5cbbca25e17b3b16c2b3d57d2e455f0 | [
"Apache-2.0"
] | null | null | null | from openpyxl.workbook import Workbook
from scrapy import Selector
from selenium import webdriver
from selenium.webdriver.common.by import By
from webdriver_manager.chrome import ChromeDriverManager
import time
from csv import writer
driver_path = 'D:\\Application\\installers\\ChromeDriver\\chromedriver.exe'
def app... | 35.691667 | 111 | 0.676162 | from openpyxl.workbook import Workbook
from scrapy import Selector
from selenium import webdriver
from selenium.webdriver.common.by import By
from webdriver_manager.chrome import ChromeDriverManager
import time
from csv import writer
driver_path = 'D:\\Application\\installers\\ChromeDriver\\chromedriver.exe'
def app... | true | true |
79000d9eca5ada02eb7a74c14851876d049c94a2 | 26,196 | py | Python | debian/python-nova/usr/lib/python2.7/dist-packages/nova/tests/api/openstack/compute/test_extensions.py | bopopescu/stacklab-nova | 4ab1698659b663ef222255610d1a5c042706dd65 | [
"Apache-2.0"
] | null | null | null | debian/python-nova/usr/lib/python2.7/dist-packages/nova/tests/api/openstack/compute/test_extensions.py | bopopescu/stacklab-nova | 4ab1698659b663ef222255610d1a5c042706dd65 | [
"Apache-2.0"
] | null | null | null | debian/python-nova/usr/lib/python2.7/dist-packages/nova/tests/api/openstack/compute/test_extensions.py | bopopescu/stacklab-nova | 4ab1698659b663ef222255610d1a5c042706dd65 | [
"Apache-2.0"
] | 1 | 2020-07-24T08:31:57.000Z | 2020-07-24T08:31:57.000Z | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2011 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# ... | 39.098507 | 79 | 0.612193 |
import iso8601
from lxml import etree
import webob
from nova.api.openstack import compute
from nova.api.openstack.compute import extensions as compute_extensions
from nova.api.openstack import extensions as base_extensions
from nova.api.openstack import wsgi
from nova.api.openstack import xmlutil
fro... | true | true |
79000e7cbee758209869966d2a67b7b04c04c1a5 | 12,428 | py | Python | analyze_dataset.py | PDillis/coiltraine | a682aa62af5f6ecb95a837d33b70d893d3d261f6 | [
"MIT"
] | 1 | 2021-03-01T19:43:12.000Z | 2021-03-01T19:43:12.000Z | analyze_dataset.py | PDillis/coiltraine | a682aa62af5f6ecb95a837d33b70d893d3d261f6 | [
"MIT"
] | null | null | null | analyze_dataset.py | PDillis/coiltraine | a682aa62af5f6ecb95a837d33b70d893d3d261f6 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
import pandas as pd
import json
import glob
import os
import argparse
from typing import Tuple, Union, List
from collections import Counter
from tqdm import tqdm
from multiprocessing import Pool
pd.options.mode.chained_assignment = None # defa... | 39.833333 | 136 | 0.61466 | import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
import pandas as pd
import json
import glob
import os
import argparse
from typing import Tuple, Union, List
from collections import Counter
from tqdm import tqdm
from multiprocessing import Pool
pd.options.mode.chained_assignment = None
... | true | true |
79000fff9dd5b908998f890701e0187b67494624 | 145 | py | Python | yc208/799.py | c-yan/yukicoder | cdbbd65402177225dd989df7fe01f67908484a69 | [
"MIT"
] | null | null | null | yc208/799.py | c-yan/yukicoder | cdbbd65402177225dd989df7fe01f67908484a69 | [
"MIT"
] | null | null | null | yc208/799.py | c-yan/yukicoder | cdbbd65402177225dd989df7fe01f67908484a69 | [
"MIT"
] | null | null | null | A, B, C, D = map(int, input().split())
s1 = set(range(A, B + 1))
s2 = set(range(C, D + 1))
print(len(s1) * len(s2) - len(s1.intersection(s2)))
| 20.714286 | 51 | 0.551724 | A, B, C, D = map(int, input().split())
s1 = set(range(A, B + 1))
s2 = set(range(C, D + 1))
print(len(s1) * len(s2) - len(s1.intersection(s2)))
| true | true |
790010409f400cb3d51aa781eb051990e11bd6ee | 3,594 | py | Python | fork/consensus/default_constants.py | Fork-Network/fork-blockchain | 4e7c55b5787376dabacc8049eac49c0bb0bfd855 | [
"Apache-2.0"
] | 7 | 2021-07-23T22:06:56.000Z | 2022-02-09T04:30:23.000Z | fork/consensus/default_constants.py | Fork-Network/fork-blockchain | 4e7c55b5787376dabacc8049eac49c0bb0bfd855 | [
"Apache-2.0"
] | null | null | null | fork/consensus/default_constants.py | Fork-Network/fork-blockchain | 4e7c55b5787376dabacc8049eac49c0bb0bfd855 | [
"Apache-2.0"
] | 2 | 2021-07-29T10:11:56.000Z | 2021-08-01T19:37:18.000Z | from fork.util.ints import uint64
from .constants import ConsensusConstants
testnet_kwargs = {
"SLOT_BLOCKS_TARGET": 32,
"MIN_BLOCKS_PER_CHALLENGE_BLOCK": 16, # Must be less than half of SLOT_BLOCKS_TARGET
"MAX_SUB_SLOT_BLOCKS": 128, # Must be less than half of SUB_EPOCH_BLOCKS
"NUM_SPS_SUB_SLOT": 6... | 57.967742 | 118 | 0.741514 | from fork.util.ints import uint64
from .constants import ConsensusConstants
testnet_kwargs = {
"SLOT_BLOCKS_TARGET": 32,
"MIN_BLOCKS_PER_CHALLENGE_BLOCK": 16,
"MAX_SUB_SLOT_BLOCKS": 128,
"NUM_SPS_SUB_SLOT": 64,
"SUB_SLOT_ITERS_STARTING": 2 ** 27,
"DIFFICULTY_CONSTANT_FACTOR": 2... | true | true |
7900107e67259c846828bf5bc847ad5047773441 | 4,197 | py | Python | prototype/api/FlaskApp/FlaskApp/azure_components/azure/mgmt/common/filters.py | Grey-Peters/IanPeters | 3f3bb124ff9f340fad1057d96305594070ce8be9 | [
"Apache-2.0"
] | null | null | null | prototype/api/FlaskApp/FlaskApp/azure_components/azure/mgmt/common/filters.py | Grey-Peters/IanPeters | 3f3bb124ff9f340fad1057d96305594070ce8be9 | [
"Apache-2.0"
] | null | null | null | prototype/api/FlaskApp/FlaskApp/azure_components/azure/mgmt/common/filters.py | Grey-Peters/IanPeters | 3f3bb124ff9f340fad1057d96305594070ce8be9 | [
"Apache-2.0"
] | null | null | null | #-------------------------------------------------------------------------
# Copyright (c) Microsoft. 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.apa... | 31.088889 | 94 | 0.610674 |
import logging
import json
DEFAULT_LOG_NAME = 'azure.mgmt.common.filters'
DEFAULT_LOG_LEVEL = logging.DEBUG
DEFAULT_USER_AGENT = ''
class RequestFilter(object):
'''
Send the request.
'''
def __init__(self, session):
if session is None:
raise ValueError('session ca... | false | true |
790010e66a70ddcb69293dc906896900f0e63fe9 | 791 | py | Python | condition_variables/stingy_spendy_cond_variable.py | zahedul/multithreadinginpython | 52492b888191fd1acde8d43e7e5aa40cec445718 | [
"MIT"
] | 21 | 2020-09-24T00:13:15.000Z | 2022-03-09T03:31:11.000Z | condition_variables/stingy_spendy_cond_variable.py | zahedul/multithreadinginpython | 52492b888191fd1acde8d43e7e5aa40cec445718 | [
"MIT"
] | null | null | null | condition_variables/stingy_spendy_cond_variable.py | zahedul/multithreadinginpython | 52492b888191fd1acde8d43e7e5aa40cec445718 | [
"MIT"
] | 22 | 2020-10-23T00:02:33.000Z | 2022-03-28T13:29:44.000Z | import time
from threading import Thread, Condition
class StingySpendy:
money = 100
cv = Condition()
def stingy(self):
for i in range(1000000):
self.cv.acquire()
self.money += 10
self.cv.notify()
self.cv.release()
print("Stingy Done")
d... | 23.264706 | 50 | 0.539823 | import time
from threading import Thread, Condition
class StingySpendy:
money = 100
cv = Condition()
def stingy(self):
for i in range(1000000):
self.cv.acquire()
self.money += 10
self.cv.notify()
self.cv.release()
print("Stingy Done")
d... | true | true |
7900115e74f1993428ff8a05fc2b038f6f1693da | 9,058 | py | Python | test/units/modules/packaging/os/test_rhn_register.py | Container-Projects/ansible-provider-docs | 100b695b0b0c4d8d08af362069557ffc735d0d7e | [
"PSF-2.0",
"BSD-2-Clause",
"MIT"
] | 37 | 2017-08-15T15:02:43.000Z | 2021-07-23T03:44:31.000Z | test/units/modules/packaging/os/test_rhn_register.py | Container-Projects/ansible-provider-docs | 100b695b0b0c4d8d08af362069557ffc735d0d7e | [
"PSF-2.0",
"BSD-2-Clause",
"MIT"
] | 12 | 2018-01-10T05:25:25.000Z | 2021-11-28T06:55:48.000Z | test/units/modules/packaging/os/test_rhn_register.py | Container-Projects/ansible-provider-docs | 100b695b0b0c4d8d08af362069557ffc735d0d7e | [
"PSF-2.0",
"BSD-2-Clause",
"MIT"
] | 49 | 2017-08-15T09:52:13.000Z | 2022-03-21T17:11:54.000Z | import contextlib
import json
import os
from ansible.compat.tests.mock import mock_open
from ansible.module_utils import basic
from ansible.module_utils._text import to_native
import ansible.module_utils.six
from ansible.module_utils.six.moves import xmlrpc_client
from ansible.modules.packaging.os import rhn_register
... | 34.310606 | 143 | 0.611945 | import contextlib
import json
import os
from ansible.compat.tests.mock import mock_open
from ansible.module_utils import basic
from ansible.module_utils._text import to_native
import ansible.module_utils.six
from ansible.module_utils.six.moves import xmlrpc_client
from ansible.modules.packaging.os import rhn_register
... | true | true |
790012983e9e4e3686a41f81bc9c31837bf74a23 | 5,958 | py | Python | http/__init__.py | radon-h2020/radon-ctt-agent-plugins | 280769d2d4c68e719fa4475ed6f89c44da295ad0 | [
"Apache-2.0"
] | null | null | null | http/__init__.py | radon-h2020/radon-ctt-agent-plugins | 280769d2d4c68e719fa4475ed6f89c44da295ad0 | [
"Apache-2.0"
] | 1 | 2021-03-30T12:14:59.000Z | 2021-03-30T12:16:57.000Z | http/__init__.py | radon-h2020/radon-ctt-agent-plugins | 280769d2d4c68e719fa4475ed6f89c44da295ad0 | [
"Apache-2.0"
] | 3 | 2020-06-02T15:07:27.000Z | 2021-03-02T13:41:38.000Z | import json
import os
import pickle
import requests
import shutil
import tempfile
import uuid
from flask import Blueprint, current_app, jsonify, request, send_file
name = 'HTTP'
prefix = 'http'
storage_enabled = True
global storage_path
plugin = Blueprint(name, __name__)
def register(app, plugin_storage_path=None... | 33.661017 | 101 | 0.630916 | import json
import os
import pickle
import requests
import shutil
import tempfile
import uuid
from flask import Blueprint, current_app, jsonify, request, send_file
name = 'HTTP'
prefix = 'http'
storage_enabled = True
global storage_path
plugin = Blueprint(name, __name__)
def register(app, plugin_storage_path=None... | true | true |
7900154d2f66b972db2a166fdf4148c6452eff91 | 5,359 | py | Python | WindowsTelemetryViewer/PyQtJsonModel.py | KOLANICH/WindowsTelemetryViewer.py | bbdfef55760ab0be63de72ff7dde27046f1c7960 | [
"Unlicense"
] | 2 | 2021-11-30T15:40:57.000Z | 2021-11-30T15:41:00.000Z | WindowsTelemetryViewer/PyQtJsonModel.py | KOLANICH-tools/WindowsTelemetryViewer.py | a276fe62e309475261901a11bf61ae055fd01d02 | [
"Unlicense"
] | 1 | 2020-06-30T08:33:52.000Z | 2020-06-30T08:33:52.000Z | WindowsTelemetryViewer/PyQtJsonModel.py | KOLANICH/WindowsTelemetryViewer.py | bbdfef55760ab0be63de72ff7dde27046f1c7960 | [
"Unlicense"
] | null | null | null | __license__ = "MIT"
__copyright__ = r"""
MIT License
Copyright (c) 2017 Gregor Engberding
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 ri... | 24.810185 | 147 | 0.717485 | __license__ = "MIT"
__copyright__ = r"""
MIT License
Copyright (c) 2017 Gregor Engberding
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 ri... | true | true |
790015693b2d378a786146cdce2ad3b92a3dac4d | 2,250 | py | Python | ewah/hooks/aircall.py | Gemma-Analytics/ewah | 2971d9ba3135bfbcc0f101e1cb0e9822d22e8752 | [
"MIT"
] | 14 | 2020-05-05T08:29:23.000Z | 2022-01-11T11:23:36.000Z | ewah/hooks/aircall.py | Gemma-Analytics/ewah | 2971d9ba3135bfbcc0f101e1cb0e9822d22e8752 | [
"MIT"
] | 13 | 2020-06-15T13:53:27.000Z | 2021-11-24T22:15:29.000Z | ewah/hooks/aircall.py | Gemma-Analytics/ewah | 2971d9ba3135bfbcc0f101e1cb0e9822d22e8752 | [
"MIT"
] | 2 | 2020-10-15T12:39:27.000Z | 2021-01-24T03:49:09.000Z | from ewah.hooks.base import EWAHBaseHook
import requests
import time
class EWAHAircallHook(EWAHBaseHook):
_ATTR_RELABEL = {
"api_id": "login",
"api_token": "password",
}
conn_name_attr = "ewah_aircall_conn_id"
default_conn_name = "ewah_aircall_default"
conn_type = "ewah_aircall"... | 28.846154 | 69 | 0.549778 | from ewah.hooks.base import EWAHBaseHook
import requests
import time
class EWAHAircallHook(EWAHBaseHook):
_ATTR_RELABEL = {
"api_id": "login",
"api_token": "password",
}
conn_name_attr = "ewah_aircall_conn_id"
default_conn_name = "ewah_aircall_default"
conn_type = "ewah_aircall"... | true | true |
790015e43ecc627fad78e98ab220e3f1543e6df8 | 4,855 | py | Python | tensorflow_privacy/privacy/dp_query/gaussian_query.py | Juspem1980/privacy | d122e2d1c7182ba7195ecbcb1cb8da29b2a14d6f | [
"Apache-2.0"
] | null | null | null | tensorflow_privacy/privacy/dp_query/gaussian_query.py | Juspem1980/privacy | d122e2d1c7182ba7195ecbcb1cb8da29b2a14d6f | [
"Apache-2.0"
] | null | null | null | tensorflow_privacy/privacy/dp_query/gaussian_query.py | Juspem1980/privacy | d122e2d1c7182ba7195ecbcb1cb8da29b2a14d6f | [
"Apache-2.0"
] | 1 | 2021-01-13T06:34:19.000Z | 2021-01-13T06:34:19.000Z | # Copyright 2018, The TensorFlow 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 t... | 33.715278 | 80 | 0.72379 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
from distutils.version import LooseVersion
import tensorflow.compat.v1 as tf
from tensorflow_privacy.privacy.dp_query import dp_query
from tensorflow_privacy.privacy.dp_query... | true | true |
7900167ffa942e90d5bde8a9c494f63fb8cc5394 | 3,285 | py | Python | flye/assembly/repeat_graph.py | sebschmi/Flye | 7413f5c39b6c8e9ab9caa564e15e7edd4e727cfd | [
"BSD-3-Clause"
] | 1 | 2021-04-08T15:14:06.000Z | 2021-04-08T15:14:06.000Z | flye/assembly/repeat_graph.py | mingjuhao/Flye | 7041792f92add6f31401c12c39cb205578141417 | [
"BSD-3-Clause"
] | null | null | null | flye/assembly/repeat_graph.py | mingjuhao/Flye | 7041792f92add6f31401c12c39cb205578141417 | [
"BSD-3-Clause"
] | null | null | null | #(c) 2016 by Authors
#This file is a part of ABruijn program.
#Released under the BSD license (see LICENSE file)
"""
Runs repeat/contigger binary
"""
from __future__ import absolute_import
import subprocess
import logging
import os
from flye.utils.utils import which
REPEAT_BIN = "flye-modules"
CONTIGGER_BIN = "flye... | 33.865979 | 83 | 0.624353 |
from __future__ import absolute_import
import subprocess
import logging
import os
from flye.utils.utils import which
REPEAT_BIN = "flye-modules"
CONTIGGER_BIN = "flye-modules"
logger = logging.getLogger()
class RepeatException(Exception):
pass
def check_binaries():
if not which(REPEAT_BIN) or not whi... | true | true |
79001836abada63b22392713229f0a70ea8aa85c | 7,213 | py | Python | tools/config_style_checker.py | jdoxley/Swamp-Aux-Test | 0e3db46103d3acde94833e6916a68c44c98e2d46 | [
"MIT"
] | 1 | 2020-04-02T22:28:44.000Z | 2020-04-02T22:28:44.000Z | tools/config_style_checker.py | jdoxley/Swamp-Aux-Test | 0e3db46103d3acde94833e6916a68c44c98e2d46 | [
"MIT"
] | 1 | 2020-02-17T07:04:56.000Z | 2020-02-17T22:09:45.000Z | tools/config_style_checker.py | jdoxley/Swamp-Aux | 6a6d81fe221313468fa0343d4943737d1b862968 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import fnmatch
import os
import re
import ntpath
import sys
import argparse
excluded_files = []
def check_config_style(filepath):
bad_count_file = 0
def pushClosing(t):
closingStack.append(closing.expr)
closing << Literal( closingFor[t[0]] )
def popClosing():
... | 45.651899 | 164 | 0.539859 |
import fnmatch
import os
import re
import ntpath
import sys
import argparse
excluded_files = []
def check_config_style(filepath):
bad_count_file = 0
def pushClosing(t):
closingStack.append(closing.expr)
closing << Literal( closingFor[t[0]] )
def popClosing():
closing << closingS... | true | true |
7900188b2ad7be7f80e06943a10f23aa571e38e0 | 957 | py | Python | GemmyTheNerd/studentclass.py | GemmyTheGeek/GemmyTheNerd | 8484887cdea6fa2d5e08c0c949221178e9ac9132 | [
"MIT"
] | null | null | null | GemmyTheNerd/studentclass.py | GemmyTheGeek/GemmyTheNerd | 8484887cdea6fa2d5e08c0c949221178e9ac9132 | [
"MIT"
] | null | null | null | GemmyTheNerd/studentclass.py | GemmyTheGeek/GemmyTheNerd | 8484887cdea6fa2d5e08c0c949221178e9ac9132 | [
"MIT"
] | null | null | null | class Student:
def __init__(self,name):
self.name = name
self.exp = 0
self.lesson = 0
self.AddEXP(10)
def Hello(self):
print('Hello World! My name is {}!'.format(self.name))
def Coding(self):
print('{}: Currently coding...'.format(self.name))
self.exp += 5
self.lesson += 1
def Sho... | 20.804348 | 58 | 0.61233 | class Student:
def __init__(self,name):
self.name = name
self.exp = 0
self.lesson = 0
self.AddEXP(10)
def Hello(self):
print('Hello World! My name is {}!'.format(self.name))
def Coding(self):
print('{}: Currently coding...'.format(self.name))
self.exp += 5
self.lesson += 1
def Sho... | true | true |
790018d88b2e26eefe31f61c3e46c9a2e169c4c7 | 56 | py | Python | CodeWars/7 Kyu/Number Of Occurrences.py | anubhab-code/Competitive-Programming | de28cb7d44044b9e7d8bdb475da61e37c018ac35 | [
"MIT"
] | null | null | null | CodeWars/7 Kyu/Number Of Occurrences.py | anubhab-code/Competitive-Programming | de28cb7d44044b9e7d8bdb475da61e37c018ac35 | [
"MIT"
] | null | null | null | CodeWars/7 Kyu/Number Of Occurrences.py | anubhab-code/Competitive-Programming | de28cb7d44044b9e7d8bdb475da61e37c018ac35 | [
"MIT"
] | null | null | null | def number_of_occurrences(s, xs):
return xs.count(s) | 28 | 33 | 0.732143 | def number_of_occurrences(s, xs):
return xs.count(s) | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.