hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f734a7810a7e04bf77d068a86ee4ed61a560a6e3 | 2,872 | py | Python | bench_utils/timeit.py | drkostas/bench-utils | 0ec976238175ee8137a54101e679f0faf58996b9 | [
"Apache-2.0"
] | 3 | 2021-12-22T14:29:17.000Z | 2022-01-26T21:21:36.000Z | bench_utils/timeit.py | drkostas/bench-utils | 0ec976238175ee8137a54101e679f0faf58996b9 | [
"Apache-2.0"
] | null | null | null | bench_utils/timeit.py | drkostas/bench-utils | 0ec976238175ee8137a54101e679f0faf58996b9 | [
"Apache-2.0"
] | null | null | null | from contextlib import ContextDecorator
from typing import Callable, IO, Union
from functools import wraps
from time import time
from termcolor_logger import ColorLogger
time_logger = ColorLogger('Timeit', 'white')
class timeit(ContextDecorator):
custom_print: str
skip: bool
total: Union[float, None]
... | 35.02439 | 101 | 0.55188 | from contextlib import ContextDecorator
from typing import Callable, IO, Union
from functools import wraps
from time import time
from termcolor_logger import ColorLogger
time_logger = ColorLogger('Timeit', 'white')
class timeit(ContextDecorator):
custom_print: str
skip: bool
total: Union[float, None]
... | true | true |
f734a811ed32e5cecdcde508cdef13f526385529 | 120,801 | py | Python | menpowidgets/base.py | apapaion/menpowidgets | 237a39ddf4e65c57e8165f8a87f25a25f34d4698 | [
"BSD-3-Clause"
] | null | null | null | menpowidgets/base.py | apapaion/menpowidgets | 237a39ddf4e65c57e8165f8a87f25a25f34d4698 | [
"BSD-3-Clause"
] | null | null | null | menpowidgets/base.py | apapaion/menpowidgets | 237a39ddf4e65c57e8165f8a87f25a25f34d4698 | [
"BSD-3-Clause"
] | null | null | null | from collections import Sized, OrderedDict
import matplotlib.pyplot as plt
from matplotlib import collections as mc
import numpy as np
import ipywidgets
import IPython.display as ipydisplay
from menpo.base import name_of_callable
from menpo.image import MaskedImage, Image
from menpo.image.base import _convert_patches... | 42.550546 | 88 | 0.631021 | from collections import Sized, OrderedDict
import matplotlib.pyplot as plt
from matplotlib import collections as mc
import numpy as np
import ipywidgets
import IPython.display as ipydisplay
from menpo.base import name_of_callable
from menpo.image import MaskedImage, Image
from menpo.image.base import _convert_patches... | true | true |
f734a86b72c070548e64cd2ada2afc4598dd3bb2 | 758 | py | Python | resources/lib/streamlink/plugins/rtlxl.py | rrosajp/script.module.streamlink-1 | 2ad5076c9c4c38288af94825064cc471da8142d8 | [
"BSD-2-Clause"
] | 1 | 2021-04-25T16:09:09.000Z | 2021-04-25T16:09:09.000Z | resources/lib/streamlink/plugins/rtlxl.py | rrosajp/script.module.streamlink-1 | 2ad5076c9c4c38288af94825064cc471da8142d8 | [
"BSD-2-Clause"
] | null | null | null | resources/lib/streamlink/plugins/rtlxl.py | rrosajp/script.module.streamlink-1 | 2ad5076c9c4c38288af94825064cc471da8142d8 | [
"BSD-2-Clause"
] | null | null | null | import re
import json
from streamlink.plugin import Plugin
from streamlink.stream import HLSStream
_url_re = re.compile(r"http(?:s)?://(?:\w+\.)?rtl.nl/video/(?P<uuid>.*?)\Z", re.IGNORECASE)
class rtlxl(Plugin):
@classmethod
def can_handle_url(cls, url):
return _url_re.match(url)
def _get_strea... | 26.137931 | 93 | 0.666227 | import re
import json
from streamlink.plugin import Plugin
from streamlink.stream import HLSStream
_url_re = re.compile(r"http(?:s)?://(?:\w+\.)?rtl.nl/video/(?P<uuid>.*?)\Z", re.IGNORECASE)
class rtlxl(Plugin):
@classmethod
def can_handle_url(cls, url):
return _url_re.match(url)
def _get_strea... | true | true |
f734aab43acf3765f95a4b2ab60c56fad32168bf | 1,577 | py | Python | CodeSignal/Challenges/MZ/06_Quest_Efficiency_Item.py | Zubieta/CPP | fb4a3cbf2e4edcc590df15663cd28fb9ecab679c | [
"MIT"
] | 8 | 2017-03-02T07:56:45.000Z | 2021-08-07T20:20:19.000Z | CodeSignal/Challenges/MZ/06_Quest_Efficiency_Item.py | zubie7a/Algorithms | fb4a3cbf2e4edcc590df15663cd28fb9ecab679c | [
"MIT"
] | null | null | null | CodeSignal/Challenges/MZ/06_Quest_Efficiency_Item.py | zubie7a/Algorithms | fb4a3cbf2e4edcc590df15663cd28fb9ecab679c | [
"MIT"
] | 1 | 2021-08-07T20:20:20.000Z | 2021-08-07T20:20:20.000Z | # https://app.codesignal.com/company-challenges/mz/zCYv3tuxRE4JajQNY
def questEfficiencyItem(hours, points, time_for_quests):
# Time is short, you want to complete as many quests as possible
# but it's difficult to do so. So we want to maximize the points
# we can obtain with quests in a given limited time.... | 43.805556 | 82 | 0.665821 | def questEfficiencyItem(hours, points, time_for_quests):
# we can obtain with quests in a given limited time.
# hours: hours it takes to complete a quest
# points: points each quest gives you
# time_for_quests: the limit of time to do stuff.
# Recursively, at each position, decide whether t... | true | true |
f734ab273b7cc42f0ec809fb4d69086c50c004da | 4,047 | py | Python | tests/_fixers/_stdlib.py | eldorplus/importlib | 48047b7de74c0e75fecbc0b846864e523e57ecc6 | [
"PSF-2.0",
"BSD-2-Clause"
] | null | null | null | tests/_fixers/_stdlib.py | eldorplus/importlib | 48047b7de74c0e75fecbc0b846864e523e57ecc6 | [
"PSF-2.0",
"BSD-2-Clause"
] | null | null | null | tests/_fixers/_stdlib.py | eldorplus/importlib | 48047b7de74c0e75fecbc0b846864e523e57ecc6 | [
"PSF-2.0",
"BSD-2-Clause"
] | null | null | null | import os
import shutil
import sys
import tempfile
import types
from importlib2._fixers import (swap, SimpleNamespace, new_class,
_thread, builtins)
from importlib2._fixers._modules import mod_from_ns
def fix_builtins(builtins=builtins):
sys.modules.setdefault('builtins', builtins... | 28.702128 | 77 | 0.604151 | import os
import shutil
import sys
import tempfile
import types
from importlib2._fixers import (swap, SimpleNamespace, new_class,
_thread, builtins)
from importlib2._fixers._modules import mod_from_ns
def fix_builtins(builtins=builtins):
sys.modules.setdefault('builtins', builtins... | true | true |
f734ac2fb9831a1d3787413031ed1eda99d96841 | 1,869 | py | Python | daemons/build_tf_deploy_config.py | ucsc-cgp/cgp-data-store | 1d583d654a07a14df0c566a66fb6ba574be36cbc | [
"MIT"
] | 46 | 2017-03-24T15:56:09.000Z | 2021-03-15T19:49:07.000Z | daemons/build_tf_deploy_config.py | ucsc-cgp/cgp-data-store | 1d583d654a07a14df0c566a66fb6ba574be36cbc | [
"MIT"
] | 1,799 | 2017-04-04T17:54:28.000Z | 2020-11-19T12:30:13.000Z | daemons/build_tf_deploy_config.py | ucsc-cgp/cgp-data-store | 1d583d654a07a14df0c566a66fb6ba574be36cbc | [
"MIT"
] | 13 | 2017-03-27T23:49:35.000Z | 2021-01-18T07:39:49.000Z | #!/usr/bin/env python
"""
This script generates Terraform scripting needed for daemons that deploy infrastructure.
"""
import os
import glob
import json
import boto3
import argparse
daemons_root = os.path.abspath(os.path.dirname(__file__))
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("... | 26.7 | 98 | 0.702515 |
import os
import glob
import json
import boto3
import argparse
daemons_root = os.path.abspath(os.path.dirname(__file__))
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("daemon")
args = parser.parse_args()
env_vars_to_lambda = os.environ['EXPORT_ENV_VARS_TO_LAMBDA'].split()
terraform_... | true | true |
f734ac3225b00088002daa226213683a43e43d53 | 8,450 | py | Python | view/__init__.py | mstrechen/pacman | fc9b609857476588fa269dff4acee744f51d9fbb | [
"MIT"
] | null | null | null | view/__init__.py | mstrechen/pacman | fc9b609857476588fa269dff4acee744f51d9fbb | [
"MIT"
] | null | null | null | view/__init__.py | mstrechen/pacman | fc9b609857476588fa269dff4acee744f51d9fbb | [
"MIT"
] | null | null | null | import typing as t
import pygame
from labyrinth.labyrinth import Labyrinth
from view.banana import Banana
from view.dot import Dot
from view.ghost import Ghost
from view.pacman import Pacman
MAX_DISPLAY_WIDTH = 1000
MAX_DISPLAY_HEIGHT = 500
class View:
cell_size: int
sprites: t.Dict[str, pygame.sprite.Spri... | 38.235294 | 122 | 0.539053 | import typing as t
import pygame
from labyrinth.labyrinth import Labyrinth
from view.banana import Banana
from view.dot import Dot
from view.ghost import Ghost
from view.pacman import Pacman
MAX_DISPLAY_WIDTH = 1000
MAX_DISPLAY_HEIGHT = 500
class View:
cell_size: int
sprites: t.Dict[str, pygame.sprite.Spri... | true | true |
f734ac4222c50c3f665746f358b2578f221a455c | 4,696 | py | Python | tools/utils/crawl_urls.py | p3t3r67x0/purple_jo | a58e89c8597aaa612b3f2784ff3259342b7b9fe6 | [
"MIT"
] | 8 | 2020-03-25T21:06:14.000Z | 2022-02-17T03:22:06.000Z | tools/utils/crawl_urls.py | webtobesocial/purple_jo | a58e89c8597aaa612b3f2784ff3259342b7b9fe6 | [
"MIT"
] | 7 | 2021-03-31T19:31:44.000Z | 2022-03-12T00:08:20.000Z | tools/utils/crawl_urls.py | webtobesocial/purple_jo | a58e89c8597aaa612b3f2784ff3259342b7b9fe6 | [
"MIT"
] | 3 | 2020-11-21T22:07:08.000Z | 2021-11-03T09:10:49.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import re
import time
import requests
import multiprocessing
import argparse
from lxml import html
from urllib.parse import urljoin
from urllib.parse import urlparse
from fake_useragent import UserAgent
from lxml.etree import ParserError
from lxml.etree import XMLSyntaxE... | 28.460606 | 147 | 0.664608 |
import re
import time
import requests
import multiprocessing
import argparse
from lxml import html
from urllib.parse import urljoin
from urllib.parse import urlparse
from fake_useragent import UserAgent
from lxml.etree import ParserError
from lxml.etree import XMLSyntaxError
from requests.exceptions import Timeout
f... | true | true |
f734ae1b367f0cd2d5054b2947d084a9683c0171 | 2,106 | py | Python | multilingual_t5/baseline_mr/baseline_mr.py | sumanthd17/mt5 | c99b4e3ad1c69908c852c730a1323ccb52d48f58 | [
"Apache-2.0"
] | null | null | null | multilingual_t5/baseline_mr/baseline_mr.py | sumanthd17/mt5 | c99b4e3ad1c69908c852c730a1323ccb52d48f58 | [
"Apache-2.0"
] | null | null | null | multilingual_t5/baseline_mr/baseline_mr.py | sumanthd17/mt5 | c99b4e3ad1c69908c852c730a1323ccb52d48f58 | [
"Apache-2.0"
] | null | null | null | """baseline_mr dataset."""
import tensorflow_datasets as tfds
import tensorflow as tf
# TODO(baseline_mr): Markdown description that will appear on the catalog page.
_DESCRIPTION = """
Description is **formatted** as markdown.
It should also contain any processing which has been applied (if any),
(e.g. corrupted ex... | 33.967742 | 136 | 0.672365 |
import tensorflow_datasets as tfds
import tensorflow as tf
_DESCRIPTION = """
Description is **formatted** as markdown.
It should also contain any processing which has been applied (if any),
(e.g. corrupted example skipped, images cropped,...):
"""
_CITATION = """
"""
class BaselineMr(tfds.core.GeneratorBasedBuil... | true | true |
f734ae3edb3e3e64c8d186b6444c1c175228a9b2 | 4,769 | py | Python | lib-dynload/_recordclass/lib/recordclass/test/test_litelist.py | tabulon-ext/dedupsqlfs | 9dfbed17450e7f2a499a7381e0368d08ae3c700d | [
"MIT"
] | 22 | 2015-04-09T09:00:00.000Z | 2022-03-23T00:16:04.000Z | lib-dynload/_recordclass/lib/recordclass/test/test_litelist.py | tabulon-ext/dedupsqlfs | 9dfbed17450e7f2a499a7381e0368d08ae3c700d | [
"MIT"
] | 119 | 2015-02-11T21:39:27.000Z | 2021-07-27T23:04:49.000Z | lib-dynload/_recordclass/lib/recordclass/test/test_litelist.py | tabulon-ext/dedupsqlfs | 9dfbed17450e7f2a499a7381e0368d08ae3c700d | [
"MIT"
] | 7 | 2016-03-16T11:53:45.000Z | 2022-02-24T13:47:31.000Z | import unittest
from recordclass import litelist
import gc
import pickle
import sys
class litelistTest(unittest.TestCase):
def test_len(self):
a = litelist([])
self.assertEqual(len(a), 0)
a = litelist([1])
self.assertEqual(len(a), 1)
def test_items(self):
a = ... | 28.728916 | 66 | 0.528413 | import unittest
from recordclass import litelist
import gc
import pickle
import sys
class litelistTest(unittest.TestCase):
def test_len(self):
a = litelist([])
self.assertEqual(len(a), 0)
a = litelist([1])
self.assertEqual(len(a), 1)
def test_items(self):
a = ... | true | true |
f734afa1170846a895fc159dcf6c25886daf9a07 | 3,509 | py | Python | gnes/preprocessor/video/shotdetect.py | dixiak/gnes | 12513d29157a06bd22923717fd0c19a856f20193 | [
"Apache-2.0"
] | null | null | null | gnes/preprocessor/video/shotdetect.py | dixiak/gnes | 12513d29157a06bd22923717fd0c19a856f20193 | [
"Apache-2.0"
] | null | null | null | gnes/preprocessor/video/shotdetect.py | dixiak/gnes | 12513d29157a06bd22923717fd0c19a856f20193 | [
"Apache-2.0"
] | null | null | null | # Tencent is pleased to support the open source community by making GNES available.
#
# Copyright (C) 2019 THL A29 Limited, a Tencent company. 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... | 37.329787 | 94 | 0.620405 |
from typing import List
import numpy as np
from ..base import BaseVideoPreprocessor
from ..helper import compute_descriptor, compare_descriptor, detect_peak_boundary, compare_ecr
from ..io_utils import video as video_util
from ...proto import gnes_pb2, array2blob
class ShotDetectPreprocessor(BaseVideoPreprocessor)... | true | true |
f734afad97f1d8801b5285aa420eeebbfb4adc49 | 6,967 | py | Python | src/flappy_bird_gym/envs/flappy_bird_env_simple.py | chokyzhou/gym-flappy-bird | ffe1089501f3e2e113a8868cd27480653dbe0ef7 | [
"MIT"
] | null | null | null | src/flappy_bird_gym/envs/flappy_bird_env_simple.py | chokyzhou/gym-flappy-bird | ffe1089501f3e2e113a8868cd27480653dbe0ef7 | [
"MIT"
] | null | null | null | src/flappy_bird_gym/envs/flappy_bird_env_simple.py | chokyzhou/gym-flappy-bird | ffe1089501f3e2e113a8868cd27480653dbe0ef7 | [
"MIT"
] | null | null | null | #
# Copyright (c) 2020 Gabriel Nogueira (Talendar)
#
# 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 rights
# to use, copy, modify, merge... | 39.140449 | 80 | 0.604564 |
from typing import Dict, Tuple, Optional, Union
import gym
import numpy as np
import pygame
from flappy_bird_gym.envs.game_logic import FlappyBirdLogic
from flappy_bird_gym.envs.game_logic import PIPE_WIDTH, PIPE_HEIGHT
from flappy_bird_gym.envs.game_logic import PLAYER_WIDTH, PLAYER_HEIGHT
from flappy_bird_gym.env... | true | true |
f734afd4fd2b3089c11565e92f2a38f6324a6e63 | 4,769 | py | Python | pkg/ampcor/products/OffsetMap.py | aivazis/ampcor | a673e6fd12ac29086c88002ce999a8eabdf406cd | [
"BSD-2-Clause"
] | 3 | 2018-12-16T14:16:51.000Z | 2020-11-12T17:33:02.000Z | pkg/ampcor/products/OffsetMap.py | aivazis/ampcor | a673e6fd12ac29086c88002ce999a8eabdf406cd | [
"BSD-2-Clause"
] | null | null | null | pkg/ampcor/products/OffsetMap.py | aivazis/ampcor | a673e6fd12ac29086c88002ce999a8eabdf406cd | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# michael a.g. aïvázis <michael.aivazis@para-sim.com>
# parasim
# (c) 1998-2021 all rights reserved
#
# the framework
import ampcor
# the extension
from ampcor.ext import ampcor as libampcor
# declaration
class OffsetMap(ampcor.flow.product,
family="ampcor.products.offsets.... | 25.639785 | 91 | 0.556511 |
import ampcor
from ampcor.ext import ampcor as libampcor
class OffsetMap(ampcor.flow.product,
family="ampcor.products.offsets.offsets", implements=ampcor.specs.offsets):
shape = ampcor.properties.tuple(schema=ampcor.properties.int())
shape.default = (0,0)
shape.doc = "the shape of ... | true | true |
f734b04a077be3478e1741e20f6f998dfde15758 | 2,542 | py | Python | Competitive Programming/Blind 75 Must Do Leetcode/Maximum Subarray.py | shreejitverma/GeeksforGeeks | d7bcb166369fffa9a031a258e925b6aff8d44e6c | [
"MIT"
] | 2 | 2022-02-18T05:14:28.000Z | 2022-03-08T07:00:08.000Z | Competitive Programming/Blind 75 Must Do Leetcode/Maximum Subarray.py | shivaniverma1/Competitive-Programming-1 | d7bcb166369fffa9a031a258e925b6aff8d44e6c | [
"MIT"
] | 6 | 2022-01-13T04:31:04.000Z | 2022-03-12T01:06:16.000Z | Competitive Programming/Blind 75 Must Do Leetcode/Maximum Subarray.py | shivaniverma1/Competitive-Programming-1 | d7bcb166369fffa9a031a258e925b6aff8d44e6c | [
"MIT"
] | 2 | 2022-02-14T19:53:53.000Z | 2022-02-18T05:14:30.000Z | '''https://leetcode.com/problems/maximum-subarray/
53. Maximum Subarray
Easy
15507
728
Add to List
Share
Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum.
A subarray is a contiguous part of an array.
Example 1:
Input: nums ... | 22.900901 | 136 | 0.597168 |
class Solution:
def maxSubArray(self, nums: List[int]) -> int:
ans = nums[0]
cur_sum = 0
for i in range(len(nums)):
if cur_sum > 0:
cur_sum += nums[i]
else:
cur_sum = nums[i]
ans = max(ans, cur_sum)
return ans
de... | true | true |
f734b04aea02cf19e100ce06a3b561cc7a0bf7dc | 7,054 | py | Python | iot_services_sdk/sensor.py | sap-archive/iot-services-sdk | 157e607b0c8b3a7b77836336aa31d89ebd8e9f86 | [
"CNRI-Python"
] | 4 | 2019-05-02T07:51:13.000Z | 2019-09-25T12:14:06.000Z | iot_services_sdk/sensor.py | sap-archive/iot-services-sdk | 157e607b0c8b3a7b77836336aa31d89ebd8e9f86 | [
"CNRI-Python"
] | 2 | 2019-09-13T15:36:32.000Z | 2019-11-15T06:01:09.000Z | iot_services_sdk/sensor.py | sap-archive/iot-services-sdk | 157e607b0c8b3a7b77836336aa31d89ebd8e9f86 | [
"CNRI-Python"
] | 1 | 2020-01-17T15:44:52.000Z | 2020-01-17T15:44:52.000Z | """ Author: Philipp Steinrötter (steinroe) """
from .tenant_iot_service import TenantIoTService
from .utils import build_query
from .response import Response
class SensorService(TenantIoTService):
def __init__(self,
instance,
user,
password,
ten... | 44.36478 | 294 | 0.601503 |
from .tenant_iot_service import TenantIoTService
from .utils import build_query
from .response import Response
class SensorService(TenantIoTService):
def __init__(self,
instance,
user,
password,
tenant_id):
self.service = '/sensors'
... | true | true |
f734b0be4b39646d3f90ce887df36ee68dd8bc06 | 541 | py | Python | users/models.py | DarkoR12/dafi-system | f923ea4273b04f7acc7016b2f7d03e51eb00b85b | [
"MIT"
] | null | null | null | users/models.py | DarkoR12/dafi-system | f923ea4273b04f7acc7016b2f7d03e51eb00b85b | [
"MIT"
] | null | null | null | users/models.py | DarkoR12/dafi-system | f923ea4273b04f7acc7016b2f7d03e51eb00b85b | [
"MIT"
] | null | null | null | from datetime import datetime
from django.contrib.auth.models import AbstractUser
from django.db import models
def current_year():
return datetime.now().year
class User(AbstractUser):
telegram_user = models.CharField('usuario de telegram', max_length=64, blank=True)
telegram_id = models.IntegerField('I... | 28.473684 | 86 | 0.733826 | from datetime import datetime
from django.contrib.auth.models import AbstractUser
from django.db import models
def current_year():
return datetime.now().year
class User(AbstractUser):
telegram_user = models.CharField('usuario de telegram', max_length=64, blank=True)
telegram_id = models.IntegerField('I... | true | true |
f734b13f88fa172c6f4bf050b1997c8b370e45cb | 15,421 | py | Python | mistral/mistral/tests/unit/engine/test_default_engine.py | Toure/openstack_mistral_wip | 1c3d028cb7c918de74a3cb018c84d6c5ee42e3f1 | [
"Apache-2.0"
] | null | null | null | mistral/mistral/tests/unit/engine/test_default_engine.py | Toure/openstack_mistral_wip | 1c3d028cb7c918de74a3cb018c84d6c5ee42e3f1 | [
"Apache-2.0"
] | null | null | null | mistral/mistral/tests/unit/engine/test_default_engine.py | Toure/openstack_mistral_wip | 1c3d028cb7c918de74a3cb018c84d6c5ee42e3f1 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 - Mirantis, Inc.
# Copyright 2015 - StackStorm, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... | 30.237255 | 79 | 0.611828 |
import datetime
import mock
from oslo_config import cfg
from oslo_messaging.rpc import client as rpc_client
from oslo_utils import uuidutils
from mistral.db.v2 import api as db_api
from mistral.db.v2.sqlalchemy import models
from mistral.engine import default_engine as d_eng
from mistral.engine.rpc_backend import rp... | true | true |
f734b394aa62228b86d84da1a5347056479a101d | 1,575 | py | Python | hsse_api/migrations/0032_auto_20181112_2011.py | JEpifanio90/HSSE_APIv2 | 7b8e8fee9cffa932884f979d24658f08726b656d | [
"MIT"
] | null | null | null | hsse_api/migrations/0032_auto_20181112_2011.py | JEpifanio90/HSSE_APIv2 | 7b8e8fee9cffa932884f979d24658f08726b656d | [
"MIT"
] | null | null | null | hsse_api/migrations/0032_auto_20181112_2011.py | JEpifanio90/HSSE_APIv2 | 7b8e8fee9cffa932884f979d24658f08726b656d | [
"MIT"
] | 1 | 2018-12-07T03:43:32.000Z | 2018-12-07T03:43:32.000Z | # Generated by Django 2.1 on 2018-11-13 01:11
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('hsse_api', '0031_auto_20181111_1424'),
]
operations = [
migrations.AlterField(
model_name='auditinspection',
name='cre... | 29.166667 | 54 | 0.568889 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('hsse_api', '0031_auto_20181111_1424'),
]
operations = [
migrations.AlterField(
model_name='auditinspection',
name='created_on',
field=models.DateField(a... | true | true |
f734b4ee525907aaa86b2d3ec604fe9872b56b26 | 129 | py | Python | sandbox/partner/partner/apps.py | ApsRajput/oscar-extend | 8828d66b78ae139a73d5ca707c0fe0710eac890a | [
"BSD-3-Clause"
] | null | null | null | sandbox/partner/partner/apps.py | ApsRajput/oscar-extend | 8828d66b78ae139a73d5ca707c0fe0710eac890a | [
"BSD-3-Clause"
] | null | null | null | sandbox/partner/partner/apps.py | ApsRajput/oscar-extend | 8828d66b78ae139a73d5ca707c0fe0710eac890a | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
from django.apps import AppConfig
class AccountConfig(AppConfig):
name = 'account' | 18.428571 | 39 | 0.79845 | from __future__ import unicode_literals
from django.apps import AppConfig
class AccountConfig(AppConfig):
name = 'account' | true | true |
f734b5ebe426a14ff0e314fceef43f9af09ce111 | 680 | py | Python | project/app.py | mapattacker/flask-serverless | 9612b7cbc5157770d88f352e0676911658c4de9a | [
"Apache-2.0"
] | null | null | null | project/app.py | mapattacker/flask-serverless | 9612b7cbc5157770d88f352e0676911658c4de9a | [
"Apache-2.0"
] | null | null | null | project/app.py | mapattacker/flask-serverless | 9612b7cbc5157770d88f352e0676911658c4de9a | [
"Apache-2.0"
] | null | null | null | import pickle
import traceback
import numpy as np
from flask import Flask, request
from config import MODELPATH, DEBUG
app = Flask(__name__)
model = pickle.load(open(MODELPATH, 'rb'))
@app.route("/predict", methods=["POST"])
def predict():
"""{"input": [5.8, 2.8, 5.1, 2.4]}"""
try:
content = reque... | 21.935484 | 54 | 0.623529 | import pickle
import traceback
import numpy as np
from flask import Flask, request
from config import MODELPATH, DEBUG
app = Flask(__name__)
model = pickle.load(open(MODELPATH, 'rb'))
@app.route("/predict", methods=["POST"])
def predict():
try:
content = request.json
sample = content["input"]
... | true | true |
f734b60ccd490cc86dc23fd7c60141903b7a603e | 1,049 | py | Python | generate_refs.py | life4/gweb | 396bcca71dd05e492b28ccbaa9fb3f9ae1c27502 | [
"MIT"
] | 185 | 2020-02-10T17:54:01.000Z | 2022-03-23T06:12:03.000Z | generate_refs.py | life4/gweb | 396bcca71dd05e492b28ccbaa9fb3f9ae1c27502 | [
"MIT"
] | 1 | 2020-10-05T06:56:38.000Z | 2020-10-05T06:56:38.000Z | generate_refs.py | life4/gweb | 396bcca71dd05e492b28ccbaa9fb3f9ae1c27502 | [
"MIT"
] | 15 | 2020-10-02T17:32:50.000Z | 2022-01-24T14:58:31.000Z | import re
from collections import defaultdict
from pathlib import Path
base_url = 'https://developer.mozilla.org/en-US/docs/Web/API/'
doc_base_url = 'https://pkg.go.dev/github.com/life4/gweb/{package}#{obj}'
link = re.escape(f'// {base_url}')
rex = re.compile(rf'(?:{link}([a-zA-Z/-]+))+\nfunc \([a-z]+ \*?([a-zA-Z]+)\)... | 31.787879 | 90 | 0.614871 | import re
from collections import defaultdict
from pathlib import Path
base_url = 'https://developer.mozilla.org/en-US/docs/Web/API/'
doc_base_url = 'https://pkg.go.dev/github.com/life4/gweb/{package}#{obj}'
link = re.escape(f'// {base_url}')
rex = re.compile(rf'(?:{link}([a-zA-Z/-]+))+\nfunc \([a-z]+ \*?([a-zA-Z]+)\)... | true | true |
f734b703f0a22b5a0f6e899df15bfb9827e5dc49 | 1,999 | py | Python | 5_Quadrature Formulas/Algoritmi_Quadratura.py | LeonardoSaccotelli/Numerical-Calculus-Project | becb480a611c9a57416127f6b0289085fe180ee4 | [
"MIT"
] | null | null | null | 5_Quadrature Formulas/Algoritmi_Quadratura.py | LeonardoSaccotelli/Numerical-Calculus-Project | becb480a611c9a57416127f6b0289085fe180ee4 | [
"MIT"
] | null | null | null | 5_Quadrature Formulas/Algoritmi_Quadratura.py | LeonardoSaccotelli/Numerical-Calculus-Project | becb480a611c9a57416127f6b0289085fe180ee4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Apr 7 17:58:09 2020
@author: Leonardo Saccotelli
"""
import numpy as np
"""
FORMULA DEI TRAPEZI
Al metodo vengono passati:
- la funzione integranda
- l'estremo inferiore di integrazione
- l'estremo superiore di integrazione
"""
def Trapezoid(f_x, a, b):
... | 21.042105 | 55 | 0.595798 |
import numpy as np
def Trapezoid(f_x, a, b):
T = (b-a)*(f_x(a)+f_x(b))/2
return T
def CompositeTrapezoid(f_x, a, b, N):
#Estrpolo N+1 intervalli equidistanti da [a,b]
z = np.linspace(a,b,N+1)
#Calcolo f_x() in ogni punto di z
fz = f_x(z)
S = 0
#Calcolo del trapezio compo... | true | true |
f734b7c8a2993ef120151e812e8f2a1a91a1d8ae | 6,204 | py | Python | airbyte-integrations/connectors/source-facebook-marketing/unit_tests/test_client.py | aadityasinha-dotcom/airbyte | 7f6dd9b6fc4288260532fe1beaf7901633f13c88 | [
"MIT"
] | 1 | 2021-11-24T17:36:54.000Z | 2021-11-24T17:36:54.000Z | airbyte-integrations/connectors/source-facebook-marketing/unit_tests/test_client.py | aadityasinha-dotcom/airbyte | 7f6dd9b6fc4288260532fe1beaf7901633f13c88 | [
"MIT"
] | 2 | 2022-03-16T16:17:37.000Z | 2022-03-24T19:00:41.000Z | airbyte-integrations/connectors/source-facebook-marketing/unit_tests/test_client.py | aadityasinha-dotcom/airbyte | 7f6dd9b6fc4288260532fe1beaf7901633f13c88 | [
"MIT"
] | null | null | null | #
# Copyright (c) 2021 Airbyte, Inc., all rights reserved.
#
import json
from datetime import datetime
import pendulum
import pytest
from airbyte_cdk.models import SyncMode
from facebook_business import FacebookAdsApi, FacebookSession
from facebook_business.exceptions import FacebookRequestError
from source_facebook_... | 38.296296 | 137 | 0.598001 |
import json
from datetime import datetime
import pendulum
import pytest
from airbyte_cdk.models import SyncMode
from facebook_business import FacebookAdsApi, FacebookSession
from facebook_business.exceptions import FacebookRequestError
from source_facebook_marketing.api import API
from source_facebook_marketing.strea... | true | true |
f734b7e22b114bcf1c5f0a73a9a92dfaa783b0aa | 7,751 | py | Python | bertviz/pytorch_pretrained_bert/file_utils.py | whaleloops/bertviz | 3c6323fa3a3e03e7399a0ad6ab8463c320179323 | [
"Apache-2.0"
] | 58 | 2019-09-16T07:24:23.000Z | 2021-12-30T09:04:38.000Z | bertviz/pytorch_pretrained_bert/file_utils.py | whaleloops/bertviz | 3c6323fa3a3e03e7399a0ad6ab8463c320179323 | [
"Apache-2.0"
] | 4 | 2021-09-09T03:02:18.000Z | 2022-03-24T13:55:55.000Z | bertviz/pytorch_pretrained_bert/file_utils.py | whaleloops/bertviz | 3c6323fa3a3e03e7399a0ad6ab8463c320179323 | [
"Apache-2.0"
] | 32 | 2019-07-30T17:47:21.000Z | 2022-03-29T22:33:29.000Z | """
Utilities for working with the local dataset cache.
This file is adapted from the AllenNLP library at https://github.com/allenai/allennlp
Copyright by the AllenNLP authors.
"""
import os
import logging
import shutil
import tempfile
import json
from urllib.parse import urlparse
from pathlib import Path
from typing ... | 33.123932 | 98 | 0.650239 |
import os
import logging
import shutil
import tempfile
import json
from urllib.parse import urlparse
from pathlib import Path
from typing import Optional, Tuple, Union, IO, Callable, Set
from hashlib import sha256
from functools import wraps
from tqdm import tqdm
import boto3
from botocore.exceptions import ClientEr... | true | true |
f734b81b788e1e3bc224c74ce6cddaa03e354b05 | 1,010 | py | Python | bindings/python/tests/test_wrapper.py | kamino/dragonffi | 3c983cc8c091d5472f7cdeab1b06dc3b1902e1be | [
"Apache-2.0"
] | 523 | 2018-02-02T08:07:24.000Z | 2022-03-21T15:44:39.000Z | bindings/python/tests/test_wrapper.py | kamino/dragonffi | 3c983cc8c091d5472f7cdeab1b06dc3b1902e1be | [
"Apache-2.0"
] | 28 | 2018-02-02T20:58:13.000Z | 2022-02-06T15:03:41.000Z | bindings/python/tests/test_wrapper.py | kamino/dragonffi | 3c983cc8c091d5472f7cdeab1b06dc3b1902e1be | [
"Apache-2.0"
] | 28 | 2018-02-02T12:05:55.000Z | 2021-09-16T21:05:05.000Z | # Copyright 2018 Adrien Guinet <adrien@guinet.me>
#
# 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 o... | 27.297297 | 74 | 0.70099 |
import unittest
import pydffi
from common import DFFITest
class WrapperTest(DFFITest):
def test_wrapper(self):
CU = self.FFI.compile('''
struct A {
int a;
int b;
};
struct A init_A(int a, int b) {
struct A ret = {a,b};
return ret;
}
''')
FTy = pydffi.typeof(CU.funcs.init_A)
... | true | true |
f734b8650bc5950384be7f02d5e473f74c10c65c | 7,897 | py | Python | third_party/retdec-3.2/scripts/retdec-unpacker.py | Fimbure/icebox-1 | 0b81992a53e1b410955ca89bdb6f8169d6f2da86 | [
"MIT"
] | 521 | 2019-03-29T15:44:08.000Z | 2022-03-22T09:46:19.000Z | third_party/retdec-3.2/scripts/retdec-unpacker.py | Fimbure/icebox-1 | 0b81992a53e1b410955ca89bdb6f8169d6f2da86 | [
"MIT"
] | 30 | 2019-06-04T17:00:49.000Z | 2021-09-08T20:44:19.000Z | third_party/retdec-3.2/scripts/retdec-unpacker.py | Fimbure/icebox-1 | 0b81992a53e1b410955ca89bdb6f8169d6f2da86 | [
"MIT"
] | 99 | 2019-03-29T16:04:13.000Z | 2022-03-28T16:59:34.000Z | #!/usr/bin/env python3
"""
The script tries to unpack the given executable file by using any
of the supported unpackers, which are at present:
* generic unpacker
* upx
Required argument:
* (packed) binary file
Optional arguments:
* desired name of unpacked file
* use extended exit codes
Returns:
*... | 36.391705 | 142 | 0.607193 |
import argparse
import os
import shutil
import sys
import importlib
config = importlib.import_module('retdec-config')
utils = importlib.import_module('retdec-utils')
CmdRunner = utils.CmdRunner
sys.stdout = utils.Unbuffered(sys.stdout)
def parse_args(_args):
parser = argparse.ArgumentParser(description=__doc_... | true | true |
f734b8e77edfbc9b357701255382e772aa6650eb | 4,072 | py | Python | data/get_dataset.py | KristinaRay/english-arabic-nmt-bot | 1e0baddc81b829b3ee1abe95143cdef5c1206dd2 | [
"MIT"
] | 1 | 2022-01-31T11:48:01.000Z | 2022-01-31T11:48:01.000Z | data/get_dataset.py | KristinaRay/english-arabic-nmt-bot | 1e0baddc81b829b3ee1abe95143cdef5c1206dd2 | [
"MIT"
] | null | null | null | data/get_dataset.py | KristinaRay/english-arabic-nmt-bot | 1e0baddc81b829b3ee1abe95143cdef5c1206dd2 | [
"MIT"
] | null | null | null | import os
import tqdm
import numpy as np
import requests
import youtokentome as yttm
from argparse import ArgumentParser
from zipfile import ZipFile
from config import *
from data.preprocessing import *
from utils import *
DATA_FILE_PATH = f'{DATA_PATH}/data.zip'
DATA_URL = 'https://opus.nlpl.eu/download.php?f=OpenSu... | 37.357798 | 130 | 0.653242 | import os
import tqdm
import numpy as np
import requests
import youtokentome as yttm
from argparse import ArgumentParser
from zipfile import ZipFile
from config import *
from data.preprocessing import *
from utils import *
DATA_FILE_PATH = f'{DATA_PATH}/data.zip'
DATA_URL = 'https://opus.nlpl.eu/download.php?f=OpenSu... | true | true |
f734b98f59acd1949a167b610f57a6d37d0e9a9e | 584 | py | Python | codes/DBN.py | NoSRPKU/GradD | c74af028d4a93e2f645a61316a5c339ecf690bf1 | [
"MIT"
] | null | null | null | codes/DBN.py | NoSRPKU/GradD | c74af028d4a93e2f645a61316a5c339ecf690bf1 | [
"MIT"
] | null | null | null | codes/DBN.py | NoSRPKU/GradD | c74af028d4a93e2f645a61316a5c339ecf690bf1 | [
"MIT"
] | null | null | null | import numpy
import theano
import theano.tensor as T
from deeplearning import rbm
class DBN():
def __init__(self, vsize=None, hsizes=[], lr=None, bsize=10, seed=123):
assert vsize and hsizes and lr
input = T.dmatrix('global_input')
self.layers = []
for hsize in hsizes:
... | 23.36 | 75 | 0.583904 | import numpy
import theano
import theano.tensor as T
from deeplearning import rbm
class DBN():
def __init__(self, vsize=None, hsizes=[], lr=None, bsize=10, seed=123):
assert vsize and hsizes and lr
input = T.dmatrix('global_input')
self.layers = []
for hsize in hsizes:
... | true | true |
f734ba16367e8b66e709a083cd83399a14c6eb48 | 1,169 | py | Python | Model_codebase_2_flask.py | anmolmore/Chatbot-for-COVID-19-FAQ-using-Dialogflow | f80670e9ee67e18c790da85d49e9c9617753c6f8 | [
"MIT"
] | 1 | 2021-01-02T06:37:41.000Z | 2021-01-02T06:37:41.000Z | Model_codebase_2_flask.py | anmolmore/Chatbot-for-COVID-19-FAQ-using-Dialogflow | f80670e9ee67e18c790da85d49e9c9617753c6f8 | [
"MIT"
] | null | null | null | Model_codebase_2_flask.py | anmolmore/Chatbot-for-COVID-19-FAQ-using-Dialogflow | f80670e9ee67e18c790da85d49e9c9617753c6f8 | [
"MIT"
] | null | null | null | #11915010 Raghu Punnamraju
#11915043 Anmol More
#11915001 Sriganesh Balamurugan
#11915052 Kapil Bindal
import pandas as pd
from ast import literal_eval
from cdqa.utils.filters import filter_paragraphs
from cdqa.utils.download import download_model, download_bnpp_data
from cdqa.pipeline.cdqa_sklearn import QAPipeline
... | 32.472222 | 79 | 0.763901 |
import pandas as pd
from ast import literal_eval
from cdqa.utils.filters import filter_paragraphs
from cdqa.utils.download import download_model, download_bnpp_data
from cdqa.pipeline.cdqa_sklearn import QAPipeline
df = pd.read_csv('data/dataset_collected.csv', usecols=['question', 'context'])
df['paragraphs'] = df... | true | true |
f734bb4107b6567f1e96ae7b325230b167696c84 | 1,053 | py | Python | best_single_model/focal_loss.py | hellopikaqiu/AIchallenger_MachineReadingComprehension | 03c8d4ab60f6ac9c7f777fd2c932cc01300b5c42 | [
"MIT"
] | 94 | 2018-12-17T09:12:48.000Z | 2021-03-15T02:56:22.000Z | best_single_model/focal_loss.py | 1120327383/AIchallenger2018_MachineReadingComprehension | 03c8d4ab60f6ac9c7f777fd2c932cc01300b5c42 | [
"MIT"
] | 4 | 2019-03-10T03:20:18.000Z | 2020-06-02T05:10:46.000Z | best_single_model/focal_loss.py | 1120327383/AIchallenger2018_MachineReadingComprehension | 03c8d4ab60f6ac9c7f777fd2c932cc01300b5c42 | [
"MIT"
] | 24 | 2018-12-17T09:13:49.000Z | 2020-01-15T09:14:41.000Z | """
AI Challenger观点型问题阅读理解
focal_loss.py
@author: yuhaitao
"""
# -*- coding:utf-8 -*-
import tensorflow as tf
def sparse_focal_loss(logits, labels, gamma=2):
"""
Computer focal loss for multi classification
Args:
labels: A int32 tensor of shape [batch_size].
logits: A float32 tensor of shape... | 29.25 | 75 | 0.62868 | import tensorflow as tf
def sparse_focal_loss(logits, labels, gamma=2):
with tf.name_scope("focal_loss"):
y_pred = tf.nn.softmax(logits, dim=-1) labels = tf.one_hot(labels, depth=y_pred.shape[1])
L = -labels * ((1 - y_pred)**gamma) * tf.log(y_pred)
L = tf.reduce_sum(L, axis=1)
... | true | true |
f734bc2a2a57c1eac2aa84d6d7661a74990feb17 | 72,645 | py | Python | python/ccxt/bitmex.py | Joukahainen/ccxt | 82823a85b96cee336853f0deb353474df2122b88 | [
"MIT"
] | 2 | 2022-03-10T15:21:49.000Z | 2022-03-10T15:22:01.000Z | python/ccxt/bitmex.py | alimogh/ccxt | 518ea1a6d212605aa19deed74991bc525470e5c9 | [
"MIT"
] | 4 | 2021-12-14T06:19:10.000Z | 2022-03-19T02:39:29.000Z | python/ccxt/bitmex.py | alimogh/ccxt | 518ea1a6d212605aa19deed74991bc525470e5c9 | [
"MIT"
] | 2 | 2022-03-08T20:43:26.000Z | 2022-03-14T19:28:27.000Z | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from cc... | 42.284633 | 233 | 0.457664 |
from ccxt.base.exchange import Exchange
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import PermissionDenied
from ccxt.base.errors import ArgumentsRequired
from ccxt.base.errors import BadRequest
from ccxt.base.errors import BadSymbol
from ccxt.base... | true | true |
f734bd64143a5c11cb97eb8dad029aafd37b792e | 951 | py | Python | setup.py | DavidNKraemer/WordleBot | 856108445ae881edf71d0e4360ec3219c9ed9fe4 | [
"MIT"
] | 1 | 2022-02-11T00:22:14.000Z | 2022-02-11T00:22:14.000Z | setup.py | DavidNKraemer/WordleBot | 856108445ae881edf71d0e4360ec3219c9ed9fe4 | [
"MIT"
] | 1 | 2022-02-07T02:35:49.000Z | 2022-02-15T14:27:57.000Z | setup.py | DavidNKraemer/Gym-Wordle | 856108445ae881edf71d0e4360ec3219c9ed9fe4 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
with open('README.md', 'r', encoding='utf-8') as fh:
long_description = fh.read()
setup(
name='gym_wordle',
version='0.1.3',
author='David Kraemer',
author_email='david.kraemer@stonybrook.edu',
description='OpenAI gym environment for training agents ... | 26.416667 | 71 | 0.599369 | from setuptools import setup, find_packages
with open('README.md', 'r', encoding='utf-8') as fh:
long_description = fh.read()
setup(
name='gym_wordle',
version='0.1.3',
author='David Kraemer',
author_email='david.kraemer@stonybrook.edu',
description='OpenAI gym environment for training agents ... | true | true |
f734bda982fdfb5c124c2601234d24204182ffb0 | 4,957 | py | Python | pywikibot/editor.py | valhallasw/pywikibot-core | 32a8c3c1298a5cb077381fe202daefde82c1c5d3 | [
"MIT"
] | null | null | null | pywikibot/editor.py | valhallasw/pywikibot-core | 32a8c3c1298a5cb077381fe202daefde82c1c5d3 | [
"MIT"
] | null | null | null | pywikibot/editor.py | valhallasw/pywikibot-core | 32a8c3c1298a5cb077381fe202daefde82c1c5d3 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""Text editor class for your favourite editor."""
from __future__ import unicode_literals
#
# (C) Gerrit Holl, 2004
# (C) Pywikibot team, 2004-2015
#
# Distributed under the terms of the MIT license.
#
__version__ = '$Id: f734bda982fdfb5c124c2601234d24204182ffb0 $'
#
import ... | 39.031496 | 84 | 0.586443 | from __future__ import unicode_literals
__version__ = '$Id: f734bda982fdfb5c124c2601234d24204182ffb0 $'
import codecs
import os
import subprocess
import tempfile
import pywikibot
from pywikibot import config
from pywikibot.tools import deprecated
try:
from pywikibot.userinterfaces import gui except ImportErro... | true | true |
f734bee389dc8207340f0fc6a99ba2f167fd79e7 | 29,991 | py | Python | flax_models/t5x/train.py | muell-monster/google-research | 04d2024f4723bc4be3d639a668c19fb1f6a31478 | [
"Apache-2.0"
] | 1 | 2020-12-25T01:18:50.000Z | 2020-12-25T01:18:50.000Z | flax_models/t5x/train.py | thomascherickal/google-research | 294a888bbb6678ac255c6422fd703c325cbb0772 | [
"Apache-2.0"
] | null | null | null | flax_models/t5x/train.py | thomascherickal/google-research | 294a888bbb6678ac255c6422fd703c325cbb0772 | [
"Apache-2.0"
] | 1 | 2021-09-27T03:17:14.000Z | 2021-09-27T03:17:14.000Z | # coding=utf-8
# Copyright 2020 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 40.419137 | 100 | 0.681038 |
from concurrent.futures import thread
import functools
import importlib
import os
from typing import Any, Mapping, Sequence, Tuple
from absl import app
from absl import flags
from absl import logging
os.environ['FLAX_PROFILE'] = 'true'
from flax import linen as nn
from flax import optim
from flax.metrics import tens... | true | true |
f734bfd8dda478c4a821955f2b8d8d088ca859db | 47,394 | py | Python | botcity/core/bot.py | lf2a/botcity-framework-core-python-2 | eaa073a4f0b5099b0684400533f7427e001648e5 | [
"Apache-2.0"
] | null | null | null | botcity/core/bot.py | lf2a/botcity-framework-core-python-2 | eaa073a4f0b5099b0684400533f7427e001648e5 | [
"Apache-2.0"
] | null | null | null | botcity/core/bot.py | lf2a/botcity-framework-core-python-2 | eaa073a4f0b5099b0684400533f7427e001648e5 | [
"Apache-2.0"
] | null | null | null | import os
import functools
import multiprocessing
import platform
import random
import subprocess
import time
import webbrowser
import pyautogui
import pyperclip
from PIL import Image
from botcity.base import BaseBot, State
from botcity.base.utils import is_retina, only_if_element
from . import config, os_compat
try... | 32.044625 | 115 | 0.573617 | import os
import functools
import multiprocessing
import platform
import random
import subprocess
import time
import webbrowser
import pyautogui
import pyperclip
from PIL import Image
from botcity.base import BaseBot, State
from botcity.base.utils import is_retina, only_if_element
from . import config, os_compat
try... | true | true |
f734c01585f2ae4014ad72f125f7748b1f3b18d9 | 4,174 | py | Python | aleph/tests/test_collections_api.py | gavinrozzi/aleph | a8e3d10ec34b0d0a05b4daf3fdd2d09b96928b35 | [
"MIT"
] | null | null | null | aleph/tests/test_collections_api.py | gavinrozzi/aleph | a8e3d10ec34b0d0a05b4daf3fdd2d09b96928b35 | [
"MIT"
] | null | null | null | aleph/tests/test_collections_api.py | gavinrozzi/aleph | a8e3d10ec34b0d0a05b4daf3fdd2d09b96928b35 | [
"MIT"
] | null | null | null | import json
from aleph.core import db
from aleph.model import Entity
from aleph.tests.util import TestCase
class CollectionsApiTestCase(TestCase):
def setUp(self):
super(CollectionsApiTestCase, self).setUp()
self.rolex = self.create_user(foreign_id='user_3')
self.col = self.create_collec... | 36.938053 | 68 | 0.546957 | import json
from aleph.core import db
from aleph.model import Entity
from aleph.tests.util import TestCase
class CollectionsApiTestCase(TestCase):
def setUp(self):
super(CollectionsApiTestCase, self).setUp()
self.rolex = self.create_user(foreign_id='user_3')
self.col = self.create_collec... | true | true |
f734c05d8d611e2e78373da2d10eb3ba7f634a15 | 18,048 | py | Python | scripts/icml_2018_experiment.py | davidinouye/destructive-deep-learning | 632add7a9731347e050d271ceebb24251e1d8e01 | [
"BSD-3-Clause"
] | 21 | 2018-06-19T21:23:32.000Z | 2021-03-03T03:29:00.000Z | scripts/icml_2018_experiment.py | davidinouye/destructive-deep-learning | 632add7a9731347e050d271ceebb24251e1d8e01 | [
"BSD-3-Clause"
] | 39 | 2018-06-19T16:45:51.000Z | 2020-09-15T12:53:20.000Z | scripts/icml_2018_experiment.py | davidinouye/destructive-deep-learning | 632add7a9731347e050d271ceebb24251e1d8e01 | [
"BSD-3-Clause"
] | 5 | 2018-10-01T22:58:32.000Z | 2019-11-12T20:41:16.000Z | """ICML 2018 experiment for MNIST and CIFAR-10."""
import argparse
import logging
import os
import subprocess
import sys
import time
import warnings
import numpy as np
import scipy.stats # Needed for standard error of the mean scipy.stats.sem
from sklearn.base import clone
from sklearn.decomposition import PCA
# Add... | 37.757322 | 99 | 0.624224 | import argparse
import logging
import os
import subprocess
import sys
import time
import warnings
import numpy as np
import scipy.stats from sklearn.base import clone
from sklearn.decomposition import PCA
sys.path.append(os.path.dirname(os.path.realpath(__file__))) sys.path.append(os.path.join(os.path.dirname(os.pat... | true | true |
f734c2997557807df9822443ec26bb97e6121bc8 | 8,265 | py | Python | samples/pubsub.py | KernelGamut32/aws-iot-device-sdk-python-v2 | 1eb65095261c431c8fc6f1168ec490a5fc87ed34 | [
"Apache-2.0"
] | null | null | null | samples/pubsub.py | KernelGamut32/aws-iot-device-sdk-python-v2 | 1eb65095261c431c8fc6f1168ec490a5fc87ed34 | [
"Apache-2.0"
] | null | null | null | samples/pubsub.py | KernelGamut32/aws-iot-device-sdk-python-v2 | 1eb65095261c431c8fc6f1168ec490a5fc87ed34 | [
"Apache-2.0"
] | null | null | null | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0.
import argparse
from awscrt import io, mqtt, auth, http
from awsiot import mqtt_connection_builder
import sys
import threading
import time
from uuid import uuid4
import json
# This sample uses the Message Broke... | 45.916667 | 116 | 0.684453 |
import argparse
from awscrt import io, mqtt, auth, http
from awsiot import mqtt_connection_builder
import sys
import threading
import time
from uuid import uuid4
import json
parser = argparse.ArgumentParser(description="Send and receive messages through and MQTT connection.")
parser.add_argument('--endpoint', requir... | true | true |
f734c331e3defaefc8932cce380c4f0de759d187 | 24,299 | py | Python | pandas/tests/scalar/timestamp/test_timestamp.py | guitargeek/pandas | a6c1f6cccee6bbccfb29488a94664ed07db024d9 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2022-01-07T12:43:15.000Z | 2022-01-07T12:43:15.000Z | pandas/tests/scalar/timestamp/test_timestamp.py | guitargeek/pandas | a6c1f6cccee6bbccfb29488a94664ed07db024d9 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/tests/scalar/timestamp/test_timestamp.py | guitargeek/pandas | a6c1f6cccee6bbccfb29488a94664ed07db024d9 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | """ test the scalar Timestamp """
import calendar
from datetime import (
datetime,
timedelta,
)
import locale
import pickle
import unicodedata
from dateutil.tz import tzutc
import numpy as np
import pytest
import pytz
from pytz import (
timezone,
utc,
)
from pandas._libs.tslibs.timezones import (
... | 35.318314 | 88 | 0.59381 |
import calendar
from datetime import (
datetime,
timedelta,
)
import locale
import pickle
import unicodedata
from dateutil.tz import tzutc
import numpy as np
import pytest
import pytz
from pytz import (
timezone,
utc,
)
from pandas._libs.tslibs.timezones import (
dateutil_gettz as gettz,
get_... | true | true |
f734c4c022c88b66d3fcb77381bcb51601a9d8af | 992 | py | Python | backend/web_item.py | ldrozdz/Webforming | ded27ee72da1753b4f3d83e8a4abda1884528a8b | [
"Apache-2.0"
] | null | null | null | backend/web_item.py | ldrozdz/Webforming | ded27ee72da1753b4f3d83e8a4abda1884528a8b | [
"Apache-2.0"
] | null | null | null | backend/web_item.py | ldrozdz/Webforming | ded27ee72da1753b4f3d83e8a4abda1884528a8b | [
"Apache-2.0"
] | null | null | null | class WebItem(object):
def __init__(self):
self.post_id = None
self.parent_id = None
self.thread_starter_id = None
self.post_url = None
self.site_url = None
self.source_id = None
self.type = None
self.hash = None
self.post_date = None
self.parsed_post_date = None
self.crawl... | 27.555556 | 38 | 0.680444 | class WebItem(object):
def __init__(self):
self.post_id = None
self.parent_id = None
self.thread_starter_id = None
self.post_url = None
self.site_url = None
self.source_id = None
self.type = None
self.hash = None
self.post_date = None
self.parsed_post_date = None
self.crawl... | true | true |
f734c5a16a4fb88f97b1cf255529a1b8023df50f | 1,216 | py | Python | _unittests/ut_packaged/test_diff.py | sdpython/pymyinstall | 72b3a56a29def0694e34ccae910bf288a95cf4a5 | [
"MIT"
] | 8 | 2015-08-24T21:01:49.000Z | 2018-01-04T06:34:51.000Z | _unittests/ut_packaged/test_diff.py | sdpython/pymyinstall | 72b3a56a29def0694e34ccae910bf288a95cf4a5 | [
"MIT"
] | 66 | 2015-06-14T22:04:58.000Z | 2021-11-11T13:46:03.000Z | _unittests/ut_packaged/test_diff.py | sdpython/pymyinstall | 72b3a56a29def0694e34ccae910bf288a95cf4a5 | [
"MIT"
] | 5 | 2016-09-13T18:14:46.000Z | 2021-08-23T12:03:28.000Z | """
@brief test log(time=200s)
"""
import unittest
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import ExtTestCase
from pymyinstall.packaged import small_set
class TestDifference(ExtTestCase):
def test_diff(self):
fLOG(
__file__,
self._testMethodName,
... | 25.87234 | 78 | 0.535362 | import unittest
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import ExtTestCase
from pymyinstall.packaged import small_set
class TestDifference(ExtTestCase):
def test_diff(self):
fLOG(
__file__,
self._testMethodName,
OutputPrint=__name__ == "__mai... | true | true |
f734c5b8ff6599d9412f3021b918a8bb7dc23ee8 | 553 | py | Python | bot/cogs/guilds/sheeptrainer.py | issuemeaname/rammus-discord-bot | 23bcb02af11b8b764d75fa974149164f0086c1ea | [
"MIT"
] | 1 | 2020-07-07T05:02:40.000Z | 2020-07-07T05:02:40.000Z | bot/cogs/guilds/sheeptrainer.py | issuemeaname/rammus-discord-bot | 23bcb02af11b8b764d75fa974149164f0086c1ea | [
"MIT"
] | null | null | null | bot/cogs/guilds/sheeptrainer.py | issuemeaname/rammus-discord-bot | 23bcb02af11b8b764d75fa974149164f0086c1ea | [
"MIT"
] | 2 | 2019-02-07T18:26:43.000Z | 2021-07-04T16:58:41.000Z | # import discord
from discord.ext import commands
import bot.checks
class Sheeptrainer(commands.Cog, command_attrs={"hidden": True}):
_GUILD = 296463400064647168
def __init__(self, bot):
self.bot = bot
@bot.checks.in_guild(_GUILD)
async def cog_check(self, ctx):
print("a")
r... | 21.269231 | 65 | 0.641953 | from discord.ext import commands
import bot.checks
class Sheeptrainer(commands.Cog, command_attrs={"hidden": True}):
_GUILD = 296463400064647168
def __init__(self, bot):
self.bot = bot
@bot.checks.in_guild(_GUILD)
async def cog_check(self, ctx):
print("a")
return True
@... | true | true |
f734c651842c525dc107baa1fc6c1a5c794093b3 | 1,458 | py | Python | setup.py | pyarnold/Mailpile | a7c0a0c6257da167207200f3b214b0e66bb93a10 | [
"Apache-2.0"
] | 2 | 2017-02-03T07:00:57.000Z | 2020-12-18T01:07:34.000Z | setup.py | cz8s/Mailpile | a7c0a0c6257da167207200f3b214b0e66bb93a10 | [
"Apache-2.0"
] | null | null | null | setup.py | cz8s/Mailpile | a7c0a0c6257da167207200f3b214b0e66bb93a10 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python2
from datetime import date
from setuptools import setup, find_packages
import os
import re
from glob import glob
APPVER = (
line.strip() for line in open('mailpile/defaults.py', 'r')
if re.match(r'^APPVER\s*=', line)
).next().split('"')[1]
try:
# This borks sdist.
os.remove('.SEL... | 25.578947 | 76 | 0.633059 | from datetime import date
from setuptools import setup, find_packages
import os
import re
from glob import glob
APPVER = (
line.strip() for line in open('mailpile/defaults.py', 'r')
if re.match(r'^APPVER\s*=', line)
).next().split('"')[1]
try:
# This borks sdist.
os.remove('.SELF')
except:
pass
d... | true | true |
f734c7ad29376309ca2140ef6f5ab05ea0760b35 | 3,037 | py | Python | Code/main.py | Orelbenr/acoustic-fencing | 2d8c6121c915d2f12fae3c9d776e6339f028e35a | [
"MIT"
] | null | null | null | Code/main.py | Orelbenr/acoustic-fencing | 2d8c6121c915d2f12fae3c9d776e6339f028e35a | [
"MIT"
] | null | null | null | Code/main.py | Orelbenr/acoustic-fencing | 2d8c6121c915d2f12fae3c9d776e6339f028e35a | [
"MIT"
] | null | null | null | import sys
from train import train
from separate import separate
import os
from os.path import join as pjoin
import logging
from datetime import datetime
def get_logger(logger_name, file_name):
logger = logging.getLogger(logger_name)
file_handler = logging.FileHandler(file_name)
stream_handler = logging.S... | 43.385714 | 131 | 0.638459 | import sys
from train import train
from separate import separate
import os
from os.path import join as pjoin
import logging
from datetime import datetime
def get_logger(logger_name, file_name):
logger = logging.getLogger(logger_name)
file_handler = logging.FileHandler(file_name)
stream_handler = logging.S... | true | true |
f734ca6ded8fd6b46244078e8a884dc84331652f | 18,494 | py | Python | lasagne/tests/layers/test_conv.py | JeffreyDF/Lasagne | 6dd88f5fada20768087f29ae89cbd83980fe0a4e | [
"MIT"
] | 60 | 2015-01-29T21:54:04.000Z | 2019-11-12T07:38:15.000Z | lasagne/tests/layers/test_conv.py | JeffreyDF/Lasagne | 6dd88f5fada20768087f29ae89cbd83980fe0a4e | [
"MIT"
] | 5 | 2015-06-15T00:21:47.000Z | 2017-09-14T10:24:40.000Z | lasagne/tests/layers/test_conv.py | JeffreyDF/Lasagne | 6dd88f5fada20768087f29ae89cbd83980fe0a4e | [
"MIT"
] | 20 | 2015-04-28T00:21:41.000Z | 2019-09-16T01:10:37.000Z | import numpy as np
import pytest
import importlib
import theano
import lasagne
from lasagne.utils import floatX, as_tuple
def conv2d(input, kernel, pad):
"""Execute a 2D convolution.
Parameters
----------
input : numpy array
kernel : numpy array
pad : {0, 'valid', 'same', 'full'}
Return... | 37.513185 | 79 | 0.568779 | import numpy as np
import pytest
import importlib
import theano
import lasagne
from lasagne.utils import floatX, as_tuple
def conv2d(input, kernel, pad):
if pad not in ['valid', 'same', 'full']:
pad = as_tuple(pad, 2, int)
input = np.pad(input,
((0, 0), (0, 0), (pad[0], pad... | true | true |
f734caef5c5d450dabd683c8724747521c21a4ff | 21,738 | py | Python | tensorflow/python/distribute/tpu_values.py | EricLi404/tensorflow | 23759800d89f7b5362c338d9a3fd72a6810c3e22 | [
"Apache-2.0"
] | 74 | 2020-07-06T17:11:39.000Z | 2022-01-28T06:31:28.000Z | tensorflow/python/distribute/tpu_values.py | EricLi404/tensorflow | 23759800d89f7b5362c338d9a3fd72a6810c3e22 | [
"Apache-2.0"
] | 9 | 2020-10-13T23:25:29.000Z | 2022-02-10T06:54:48.000Z | tensorflow/python/distribute/tpu_values.py | EricLi404/tensorflow | 23759800d89f7b5362c338d9a3fd72a6810c3e22 | [
"Apache-2.0"
] | 12 | 2020-07-08T07:27:17.000Z | 2021-12-27T08:54:27.000Z | # Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 36.351171 | 112 | 0.699006 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import contextlib
from tensorflow.python.distribute import packed_distributed_variable as packed
from tensorflow.python.distribute import values
from tensorflow.python.distribute import values_util
from tenso... | true | true |
f734cb4823063b2767bd39361c8b9837fb410f99 | 2,294 | py | Python | Exercise-3/sensor_stick/src/sensor_stick/features.py | antoszy/RoboND-perception-exercises | 8c725e77316162ae485ccee94085fd2314be7ae0 | [
"MIT"
] | null | null | null | Exercise-3/sensor_stick/src/sensor_stick/features.py | antoszy/RoboND-perception-exercises | 8c725e77316162ae485ccee94085fd2314be7ae0 | [
"MIT"
] | null | null | null | Exercise-3/sensor_stick/src/sensor_stick/features.py | antoszy/RoboND-perception-exercises | 8c725e77316162ae485ccee94085fd2314be7ae0 | [
"MIT"
] | null | null | null | import matplotlib.colors
import matplotlib.pyplot as plt
import numpy as np
from pcl_helper import *
nbinscol = 32
nbinsnor = 20
def rgb_to_hsv(rgb_list):
rgb_normalized = [1.0*rgb_list[0]/255, 1.0*rgb_list[1]/255, 1.0*rgb_list[2]/255]
hsv_normalized = matplotlib.colors.rgb_to_hsv([[rgb_normalized]])[0][0]
... | 32.309859 | 84 | 0.725806 | import matplotlib.colors
import matplotlib.pyplot as plt
import numpy as np
from pcl_helper import *
nbinscol = 32
nbinsnor = 20
def rgb_to_hsv(rgb_list):
rgb_normalized = [1.0*rgb_list[0]/255, 1.0*rgb_list[1]/255, 1.0*rgb_list[2]/255]
hsv_normalized = matplotlib.colors.rgb_to_hsv([[rgb_normalized]])[0][0]
... | true | true |
f734cb94f1c618b92f07fe70c5d48199f6e127ba | 2,737 | py | Python | .Config/FslBuildGen/Xml/SubPackageSupportConfig.py | alejandrolozano2/OpenGL_DemoFramework | 5fd85f05c98cc3d0c0a68bac438035df8cabaee7 | [
"MIT",
"BSD-3-Clause"
] | 3 | 2019-01-19T20:21:24.000Z | 2021-08-10T02:11:32.000Z | .Config/FslBuildGen/Xml/SubPackageSupportConfig.py | alejandrolozano2/OpenGL_DemoFramework | 5fd85f05c98cc3d0c0a68bac438035df8cabaee7 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | .Config/FslBuildGen/Xml/SubPackageSupportConfig.py | alejandrolozano2/OpenGL_DemoFramework | 5fd85f05c98cc3d0c0a68bac438035df8cabaee7 | [
"MIT",
"BSD-3-Clause"
] | 1 | 2021-08-10T02:11:33.000Z | 2021-08-10T02:11:33.000Z | #!/usr/bin/env python3
#****************************************************************************************************************************************************
# Copyright (c) 2014 Freescale Semiconductor, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
#... | 58.234043 | 162 | 0.656924 |
from FslBuildGen.DataTypes import PackageType
from FslBuildGen.DataTypes import SubPackageSupport
class SubPackageSupportConfig(object):
def __init__(self, packageType: int, subPackageSupport: int) -> None:
super(SubPackageSupportConfig, self).__init__()
self.Type = packageType ... | true | true |
f734cd4cfbc6e0bc534a4349136cc39749e30092 | 8,442 | py | Python | magnum/objects/x509keypair.py | mjbrewer/testIndex | 420dc071d4240a89b6f266e8d2575cedb39bfea0 | [
"Apache-2.0"
] | null | null | null | magnum/objects/x509keypair.py | mjbrewer/testIndex | 420dc071d4240a89b6f266e8d2575cedb39bfea0 | [
"Apache-2.0"
] | null | null | null | magnum/objects/x509keypair.py | mjbrewer/testIndex | 420dc071d4240a89b6f266e8d2575cedb39bfea0 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
#
#
# 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 writi... | 41.586207 | 85 | 0.622957 |
from oslo_versionedobjects import fields
from magnum.common import exception
from magnum.common import utils
from magnum.db import api as dbapi
from magnum.objects import base
@base.MagnumObjectRegistry.register
class X509KeyPair(base.MagnumPersistentObject, base.MagnumObject,
base.MagnumObjectDic... | true | true |
f734cdbc4784f67ad314325d7468e7791ca4a293 | 2,093 | py | Python | modules/cluster_xyz.py | fonsecag/TBD | d4cb9dec96e753708950e223f921a29ab7bcb9dd | [
"MIT"
] | 6 | 2021-03-04T06:58:11.000Z | 2022-01-30T02:28:48.000Z | modules/cluster_xyz.py | fonsecag/TBD | d4cb9dec96e753708950e223f921a29ab7bcb9dd | [
"MIT"
] | null | null | null | modules/cluster_xyz.py | fonsecag/TBD | d4cb9dec96e753708950e223f921a29ab7bcb9dd | [
"MIT"
] | null | null | null | from run import MainHandler
from .cluster import ClusterHandler
from util import *
class ClusterXYZHandler(ClusterHandler):
def __init__(self, args, **kwargs):
super().__init__(args, **kwargs)
self.n_stages = self.n_main_stages + self.n_substages
n_substages = ClusterHandler.n_substages # o... | 29.9 | 77 | 0.572862 | from run import MainHandler
from .cluster import ClusterHandler
from util import *
class ClusterXYZHandler(ClusterHandler):
def __init__(self, args, **kwargs):
super().__init__(args, **kwargs)
self.n_stages = self.n_main_stages + self.n_substages
n_substages = ClusterHandler.n_substages
... | true | true |
f734ce2104b99a837e3511b1075b8cf719ab35b6 | 482 | py | Python | pyxrf/db_config/hxn_db_config.py | andrewmkiss/PyXRF | 61de2029c255f77279ba5bc3896107c1a2e4212f | [
"BSD-3-Clause"
] | 19 | 2016-05-25T21:40:41.000Z | 2022-01-19T01:58:15.000Z | pyxrf/db_config/hxn_db_config.py | andrewmkiss/PyXRF | 61de2029c255f77279ba5bc3896107c1a2e4212f | [
"BSD-3-Clause"
] | 90 | 2016-01-11T17:22:05.000Z | 2021-12-02T15:59:58.000Z | pyxrf/db_config/hxn_db_config.py | andrewmkiss/PyXRF | 61de2029c255f77279ba5bc3896107c1a2e4212f | [
"BSD-3-Clause"
] | 22 | 2016-10-16T17:19:19.000Z | 2022-02-18T21:45:08.000Z | try:
from databroker.v0 import Broker
except ModuleNotFoundError:
from databroker import Broker
from hxntools.handlers.xspress3 import Xspress3HDF5Handler
from hxntools.handlers.timepix import TimepixHDF5Handler
db = Broker.named("hxn")
# db_analysis = Broker.named('hxn_analysis')
db.reg.register_handler(Xsp... | 34.428571 | 94 | 0.8361 | try:
from databroker.v0 import Broker
except ModuleNotFoundError:
from databroker import Broker
from hxntools.handlers.xspress3 import Xspress3HDF5Handler
from hxntools.handlers.timepix import TimepixHDF5Handler
db = Broker.named("hxn")
db.reg.register_handler(Xspress3HDF5Handler.HANDLER_NAME, Xspress3HDF5Ha... | true | true |
f734ce5df7ac9a87c9b31d2c6162e94261ab7b86 | 1,031 | bzl | Python | examples/test.bzl | Aghassi/rules_nodejs | 3eb42603c440f7e8496f2e6812337eb47827ff6a | [
"Apache-2.0"
] | 1 | 2021-06-20T18:37:14.000Z | 2021-06-20T18:37:14.000Z | examples/test.bzl | Aghassi/rules_nodejs | 3eb42603c440f7e8496f2e6812337eb47827ff6a | [
"Apache-2.0"
] | 12 | 2020-04-06T21:50:34.000Z | 2022-03-25T18:06:41.000Z | examples/test.bzl | Aghassi/rules_nodejs | 3eb42603c440f7e8496f2e6812337eb47827ff6a | [
"Apache-2.0"
] | 1 | 2018-03-07T13:48:39.000Z | 2018-03-07T13:48:39.000Z | "Define a convenience macro for examples integration testing"
load("@build_bazel_rules_nodejs//internal/bazel_integration_test:bazel_integration_test.bzl", "rules_nodejs_integration_test")
load("//:tools/defaults.bzl", "codeowners")
def example_integration_test(name, owners = [], **kwargs):
"Set defaults for the ... | 33.258065 | 126 | 0.57129 |
load("@build_bazel_rules_nodejs//internal/bazel_integration_test:bazel_integration_test.bzl", "rules_nodejs_integration_test")
load("//:tools/defaults.bzl", "codeowners")
def example_integration_test(name, owners = [], **kwargs):
dirname = name[len("examples_"):]
native.filegroup(
name = "_%s_sources"... | true | true |
f734ce7aa3455146cd42a264d89384c7c91362c6 | 701 | py | Python | send_sms.py | bthaman/noaa_precip | 7c1b33760584fb4591e10eeb59e5904df48a17d0 | [
"Python-2.0",
"OLDAP-2.7"
] | null | null | null | send_sms.py | bthaman/noaa_precip | 7c1b33760584fb4591e10eeb59e5904df48a17d0 | [
"Python-2.0",
"OLDAP-2.7"
] | null | null | null | send_sms.py | bthaman/noaa_precip | 7c1b33760584fb4591e10eeb59e5904df48a17d0 | [
"Python-2.0",
"OLDAP-2.7"
] | null | null | null | # we import the Twilio client from the dependency we just installed
# from twilio.rest import TwilioRestClient
from twilio.rest import Client
def send_text(message):
# the following line needs your Twilio Account SID and Auth Token
client = Client("AC3e84e9cae2390af9a661c1ab35955444", "4a8bf26cb30107ec85d98f6... | 43.8125 | 93 | 0.723252 | from twilio.rest import Client
def send_text(message):
client = Client("AC3e84e9cae2390af9a661c1ab35955444", "4a8bf26cb30107ec85d98f6bf1182522")
client.messages.create(to="+15129146948", from_="+17372105122",
body=message)
if __name__ == '__main__':
send_text('H... | true | true |
f734cefe7c40ffddafb7ca7ca8a4bd256d52efd5 | 840 | py | Python | tests/v1/test_event_alert_type.py | MichaelTROEHLER/datadog-api-client-python | 12c46626622fb1277bb1e172753b342c671348bd | [
"Apache-2.0"
] | null | null | null | tests/v1/test_event_alert_type.py | MichaelTROEHLER/datadog-api-client-python | 12c46626622fb1277bb1e172753b342c671348bd | [
"Apache-2.0"
] | null | null | null | tests/v1/test_event_alert_type.py | MichaelTROEHLER/datadog-api-client-python | 12c46626622fb1277bb1e172753b342c671348bd | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from __future__ import absolute_import
import sys
import unittest
im... | 24.705882 | 108 | 0.72381 |
from __future__ import absolute_import
import sys
import unittest
import datadog_api_client.v1
from datadog_api_client.v1.model.event_alert_type import EventAlertType
class TestEventAlertType(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def testEventAlertType(s... | true | true |
f734cfda1c639c31c88584c85e5043ba791d021a | 3,000 | py | Python | english/data_processing/lessons/code/vslide1.py | hrutkabence/tutorials | bd76294860804aee8ecda5e1445464506bf02ee0 | [
"CC0-1.0"
] | null | null | null | english/data_processing/lessons/code/vslide1.py | hrutkabence/tutorials | bd76294860804aee8ecda5e1445464506bf02ee0 | [
"CC0-1.0"
] | null | null | null | english/data_processing/lessons/code/vslide1.py | hrutkabence/tutorials | bd76294860804aee8ecda5e1445464506bf02ee0 | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from math import hypot, atan2, sin, cos, pi, degrees
import numpy as np
from matplotlib import pyplot as plt
def vplain(x1, y1, x2, y2):
""" set up line equation
vp[0] * x + vp[1] * y + vp[2] = 0
x1, y1 - horizontal coordinates of the start point o... | 30.927835 | 80 | 0.576667 |
import sys
from math import hypot, atan2, sin, cos, pi, degrees
import numpy as np
from matplotlib import pyplot as plt
def vplain(x1, y1, x2, y2):
vp = np.zeros((3,))
vp[0] = y1 - y2
vp[1] = x2 - x1
vp[2] = x1 * y2 - x2 * y1
vp = vp / hypot(vp[0], vp[1]) return vp
def section(pc, x1, y1, x2... | true | true |
f734d00b0261768c9a37cb2968bbdc5343c8ba0c | 1,292 | py | Python | demo_guided.py | MrJohnsson77/bat-country | 894af13bd777ab8aa989baf520db074b97cfad9a | [
"MIT"
] | 274 | 2015-07-06T14:29:09.000Z | 2022-02-06T18:06:14.000Z | demo_guided.py | amsimoes/bat-country | c0d29a0b32c196ca3d4c40fbaf960432b507e8bb | [
"MIT"
] | 11 | 2015-07-13T23:54:15.000Z | 2022-03-11T23:11:38.000Z | demo_guided.py | amsimoes/bat-country | c0d29a0b32c196ca3d4c40fbaf960432b507e8bb | [
"MIT"
] | 68 | 2015-07-06T15:16:53.000Z | 2021-08-09T19:03:31.000Z | # USAGE
# python demo_guided.py --base-model $CAFFE_ROOT/models/bvlc_googlenet \
# --image initial_images/clouds.jpg \
# --guide-image initial_images/seed_images/starry_night.jpg \
# --output examples/output/seeded/clouds_and_starry_night.jpg
# import the necessary packages
from batcountry import BatCountry
from PIL i... | 39.151515 | 81 | 0.755418 |
from batcountry import BatCountry
from PIL import Image
import numpy as np
import argparse
ap = argparse.ArgumentParser()
ap.add_argument("-b", "--base-model", required=True, help="base model path")
ap.add_argument("-l", "--layer", type=str, default="inception_4c/output",
help="layer of CNN to use")
ap.add_argument(... | true | true |
f734d00b18af99f6b7b1b6eeaf82cc30c32aef02 | 3,245 | py | Python | polling_stations/apps/data_collection/management/commands/import_harborough.py | mtravis/UK-Polling-Stations | 26e0331dc29253dc436a0462ffaa01e974c5dc52 | [
"BSD-3-Clause"
] | null | null | null | polling_stations/apps/data_collection/management/commands/import_harborough.py | mtravis/UK-Polling-Stations | 26e0331dc29253dc436a0462ffaa01e974c5dc52 | [
"BSD-3-Clause"
] | null | null | null | polling_stations/apps/data_collection/management/commands/import_harborough.py | mtravis/UK-Polling-Stations | 26e0331dc29253dc436a0462ffaa01e974c5dc52 | [
"BSD-3-Clause"
] | null | null | null | from data_collection.management.commands import BaseXpressDemocracyClubCsvImporter
class Command(BaseXpressDemocracyClubCsvImporter):
council_id = "E07000131"
addresses_name = (
"local.2019-05-02/Version 1/Democracy_Club__02May2019 Harborough DC.tsv"
)
stations_name = (
"local.2019-05-... | 55.948276 | 132 | 0.642527 | from data_collection.management.commands import BaseXpressDemocracyClubCsvImporter
class Command(BaseXpressDemocracyClubCsvImporter):
council_id = "E07000131"
addresses_name = (
"local.2019-05-02/Version 1/Democracy_Club__02May2019 Harborough DC.tsv"
)
stations_name = (
"local.2019-05-... | true | true |
f734d0ce5e31881671bde02a0d35ed0eb21415f4 | 2,857 | py | Python | data/transcoder_evaluation_gfg/python/STOOGE_SORT.py | mxl1n/CodeGen | e5101dd5c5e9c3720c70c80f78b18f13e118335a | [
"MIT"
] | 241 | 2021-07-20T08:35:20.000Z | 2022-03-31T02:39:08.000Z | data/transcoder_evaluation_gfg/python/STOOGE_SORT.py | mxl1n/CodeGen | e5101dd5c5e9c3720c70c80f78b18f13e118335a | [
"MIT"
] | 49 | 2021-07-22T23:18:42.000Z | 2022-03-24T09:15:26.000Z | data/transcoder_evaluation_gfg/python/STOOGE_SORT.py | mxl1n/CodeGen | e5101dd5c5e9c3720c70c80f78b18f13e118335a | [
"MIT"
] | 71 | 2021-07-21T05:17:52.000Z | 2022-03-29T23:49:28.000Z | # Copyright (c) 2019-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
def f_gold ( arr , l , h ) :
if l >= h :
return
if arr [ l ] > arr [ h ] :
t = arr [ l ]
arr [ l... | 52.907407 | 165 | 0.431222 | def f_gold ( arr , l , h ) :
if l >= h :
return
if arr [ l ] > arr [ h ] :
t = arr [ l ]
arr [ l ] = arr [ h ]
arr [ h ] = t
if h - l + 1 > 2 :
t = ( int ) ( ( h - l + 1 ) / 3 )
f_gold ( arr , l , ( h - t ) )
f_gold ( arr , l + t , ( h ) )
f_go... | true | true |
f734d1983e0e270444f39c71128b6e3bc933d71c | 1,442 | py | Python | aliyun-python-sdk-linkwan/aliyunsdklinkwan/request/v20190301/GetLocalConfigSyncTaskRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 1,001 | 2015-07-24T01:32:41.000Z | 2022-03-25T01:28:18.000Z | aliyun-python-sdk-linkwan/aliyunsdklinkwan/request/v20190301/GetLocalConfigSyncTaskRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 363 | 2015-10-20T03:15:00.000Z | 2022-03-08T12:26:19.000Z | aliyun-python-sdk-linkwan/aliyunsdklinkwan/request/v20190301/GetLocalConfigSyncTaskRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 682 | 2015-09-22T07:19:02.000Z | 2022-03-22T09:51:46.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... | 37.947368 | 89 | 0.768377 |
from aliyunsdkcore.request import RpcRequest
from aliyunsdklinkwan.endpoint import endpoint_data
class GetLocalConfigSyncTaskRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'LinkWAN', '2019-03-01', 'GetLocalConfigSyncTask','linkwan')
self.set_method('POST')
if hasattr(self, "endpoint_map")... | true | true |
f734d1e49cc32d7b6f5465291abd73c61b5e8638 | 1,175 | py | Python | File.py | jessedeveloperinvestor/Multiple-Jesse-Projects | f66a6eed79117fd005668f79e0bee3d8ac76e2b8 | [
"Apache-2.0"
] | null | null | null | File.py | jessedeveloperinvestor/Multiple-Jesse-Projects | f66a6eed79117fd005668f79e0bee3d8ac76e2b8 | [
"Apache-2.0"
] | null | null | null | File.py | jessedeveloperinvestor/Multiple-Jesse-Projects | f66a6eed79117fd005668f79e0bee3d8ac76e2b8 | [
"Apache-2.0"
] | null | null | null | y={0:{'Jesse Leite',23,'Best computer Engineer'},1:{'Lana Rhoades',22,'Best pleasure professional'}}
with open('file.txt', 'w') as file:
file.write("Python and Jesse built this file!")
with open('file.txt', 'a') as file:
file.write('\nJesse\n'+str(y)+'\n'+str(y))
inf=[]
with open('file.data', 'r') as file:
fo... | 35.606061 | 147 | 0.560851 | y={0:{'Jesse Leite',23,'Best computer Engineer'},1:{'Lana Rhoades',22,'Best pleasure professional'}}
with open('file.txt', 'w') as file:
file.write("Python and Jesse built this file!")
with open('file.txt', 'a') as file:
file.write('\nJesse\n'+str(y)+'\n'+str(y))
inf=[]
with open('file.data', 'r') as file:
fo... | true | true |
f734d1f2191f58f7a8e4dabb4fc3ba6dbc11ad51 | 158 | py | Python | depth/core/evaluation/__init__.py | zhyever/Monocular-Depth-Estimation-Toolbox | c591b9711321450387ffa7322ec1db9a340347c2 | [
"Apache-2.0"
] | 21 | 2022-03-12T01:42:05.000Z | 2022-03-31T17:01:45.000Z | depth/core/evaluation/__init__.py | zhyever/Monocular-Depth-Estimation-Toolbox | c591b9711321450387ffa7322ec1db9a340347c2 | [
"Apache-2.0"
] | 2 | 2022-03-29T10:50:33.000Z | 2022-03-30T10:40:53.000Z | depth/core/evaluation/__init__.py | zhyever/Monocular-Depth-Estimation-Toolbox | c591b9711321450387ffa7322ec1db9a340347c2 | [
"Apache-2.0"
] | 3 | 2022-03-26T11:52:44.000Z | 2022-03-30T21:24:16.000Z | # Copyright (c) OpenMMLab. All rights reserved.
from .metrics import metrics, eval_metrics, pre_eval_to_metrics
from .eval_hooks import EvalHook, DistEvalHook | 52.666667 | 63 | 0.829114 | from .metrics import metrics, eval_metrics, pre_eval_to_metrics
from .eval_hooks import EvalHook, DistEvalHook | true | true |
f734d27754536095a51f7b1e9025b5c86e2bfe24 | 3,601 | py | Python | amplimap/coverage.py | koelling/amplimap | cbd5b7b8c2f703982d8964a3c77bd350a47f08a6 | [
"Apache-2.0"
] | 11 | 2019-04-08T15:41:50.000Z | 2020-11-04T14:25:19.000Z | amplimap/coverage.py | koelling/amplimap | cbd5b7b8c2f703982d8964a3c77bd350a47f08a6 | [
"Apache-2.0"
] | 5 | 2018-05-23T10:30:18.000Z | 2021-06-29T09:33:17.000Z | amplimap/coverage.py | koelling/amplimap | cbd5b7b8c2f703982d8964a3c77bd350a47f08a6 | [
"Apache-2.0"
] | 9 | 2019-04-08T15:16:04.000Z | 2021-06-09T15:14:09.000Z | # -*- coding: utf-8 -*-
"""
This module contains methods for processing and aggregating coverage files generated by ``bedtools``.
"""
import pandas as pd
import numpy as np
import re
import os
from .reader import read_sample_info
cov_cols = ['Target', 'min_coverage', 'sum_coverage', 'basepairs', 'cov_per_bp', 'fract... | 36.744898 | 159 | 0.663149 |
import pandas as pd
import numpy as np
import re
import os
from .reader import read_sample_info
cov_cols = ['Target', 'min_coverage', 'sum_coverage', 'basepairs', 'cov_per_bp', 'fraction_zero_coverage', 'fraction_10x_coverage', 'fraction_30x_coverage']
cov_cols_dtypes = dict(zip(cov_cols, [str, int, int, int, float,... | true | true |
f734d2d7c65ce3567f24d550214f74a82b5809d1 | 4,413 | py | Python | src/streamlink/plugins/vimeo.py | kyldery/streamlink | ef36240408c194a543557fb31e4535b0426ec153 | [
"BSD-2-Clause"
] | 1 | 2022-02-25T20:14:03.000Z | 2022-02-25T20:14:03.000Z | src/streamlink/plugins/vimeo.py | kyldery/streamlink | ef36240408c194a543557fb31e4535b0426ec153 | [
"BSD-2-Clause"
] | null | null | null | src/streamlink/plugins/vimeo.py | kyldery/streamlink | ef36240408c194a543557fb31e4535b0426ec153 | [
"BSD-2-Clause"
] | 12 | 2022-01-30T23:34:18.000Z | 2022-03-26T17:09:43.000Z | """
$description Global live streaming and video hosting social platform.
$url vimeo.com
$type live, vod
$notes Password protected streams are not supported
"""
import logging
import re
from html import unescape as html_unescape
from urllib.parse import urlparse
from streamlink.plugin import Plugin, PluginArgument, P... | 37.084034 | 98 | 0.554498 |
import logging
import re
from html import unescape as html_unescape
from urllib.parse import urlparse
from streamlink.plugin import Plugin, PluginArgument, PluginArguments, pluginmatcher
from streamlink.plugin.api import validate
from streamlink.stream.dash import DASHStream
from streamlink.stream.ffmpegmux import Mu... | true | true |
f734d363117a1d24b35c8edb306662ee55c567e1 | 625 | py | Python | flatland/database/population/node/diagram_type_instances.py | lelandstarr/flatland-model-diagram-editor | dfbd10d80542359c6951d7b039a5a4e3da2a0f50 | [
"MIT"
] | 10 | 2021-01-03T16:47:34.000Z | 2022-03-30T18:47:07.000Z | flatland/database/population/node/diagram_type_instances.py | lelandstarr/flatland-model-diagram-editor | dfbd10d80542359c6951d7b039a5a4e3da2a0f50 | [
"MIT"
] | 91 | 2021-01-09T02:14:13.000Z | 2022-02-24T10:24:10.000Z | flatland/database/population/node/diagram_type_instances.py | lelandstarr/flatland-model-diagram-editor | dfbd10d80542359c6951d7b039a5a4e3da2a0f50 | [
"MIT"
] | 1 | 2021-01-13T22:13:19.000Z | 2021-01-13T22:13:19.000Z | """
diagram_type_instances.py
"""
population = [
{'Name': 'class', 'Abbreviation': 'CD',
'About': 'Show data, logic and constraints in a domain'},
{'Name': 'state machine', 'Abbreviation': 'SMD',
'About': 'lifecycle of a class or assigner relationship'},
{'Name': 'class collaboration', 'Abbreviat... | 39.0625 | 92 | 0.6512 |
population = [
{'Name': 'class', 'Abbreviation': 'CD',
'About': 'Show data, logic and constraints in a domain'},
{'Name': 'state machine', 'Abbreviation': 'SMD',
'About': 'lifecycle of a class or assigner relationship'},
{'Name': 'class collaboration', 'Abbreviation': 'CCD',
'About': 'Shows ... | true | true |
f734d3c25a06993d61e3d706c674c3425718395c | 12,885 | py | Python | python/paddle/fluid/tests/unittests/xpu/test_softmax_with_cross_entropy_op_xpu.py | joey12300/Paddle | 59102c6dcd2def3091f5c37816354ac69d669809 | [
"Apache-2.0"
] | 1 | 2020-12-03T05:11:47.000Z | 2020-12-03T05:11:47.000Z | python/paddle/fluid/tests/unittests/xpu/test_softmax_with_cross_entropy_op_xpu.py | joey12300/Paddle | 59102c6dcd2def3091f5c37816354ac69d669809 | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/tests/unittests/xpu/test_softmax_with_cross_entropy_op_xpu.py | joey12300/Paddle | 59102c6dcd2def3091f5c37816354ac69d669809 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 32.374372 | 80 | 0.632906 |
from __future__ import print_function
import sys
sys.path.append("..")
from test_softmax_op import stable_softmax
from op_test import OpTest
import paddle.fluid.core as core
import paddle
import unittest
import numpy as np
def cross_entropy(softmax, label, soft_label, axis, ignore_index=-1):
if soft_label:
... | true | true |
f734d4b1af0cc7fc43f7f8c7fe07948454d387eb | 5,473 | py | Python | tensorflow/python/kernel_tests/math_ops/argmax_op_test.py | computationalartist/tensorflow | b89cf636c412abdff53b3e8f201bde671c92209d | [
"Apache-2.0"
] | 190,993 | 2015-11-09T13:17:30.000Z | 2022-03-31T23:05:27.000Z | tensorflow/python/kernel_tests/math_ops/argmax_op_test.py | computationalartist/tensorflow | b89cf636c412abdff53b3e8f201bde671c92209d | [
"Apache-2.0"
] | 48,461 | 2015-11-09T14:21:11.000Z | 2022-03-31T23:17:33.000Z | tensorflow/python/kernel_tests/math_ops/argmax_op_test.py | computationalartist/tensorflow | b89cf636c412abdff53b3e8f201bde671c92209d | [
"Apache-2.0"
] | 104,981 | 2015-11-09T13:40:17.000Z | 2022-03-31T19:51:54.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 34.20625 | 80 | 0.661794 | import functools
import numpy as np
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import test_util
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import math_ops
from tensorflow.python.platform import test
class ArgMaxTest(test.TestCase):
def _testArg(sel... | true | true |
f734d54a61d5c8de8595c92a6ae6ea4360716489 | 14,386 | py | Python | pyscf/grad/casci.py | QuESt-Calculator/pyscf | 0ed03633b699505c7278f1eb501342667d0aa910 | [
"Apache-2.0"
] | 501 | 2018-12-06T23:48:17.000Z | 2022-03-31T11:53:18.000Z | pyscf/grad/casci.py | QuESt-Calculator/pyscf | 0ed03633b699505c7278f1eb501342667d0aa910 | [
"Apache-2.0"
] | 710 | 2018-11-26T22:04:52.000Z | 2022-03-30T03:53:12.000Z | pyscf/grad/casci.py | QuESt-Calculator/pyscf | 0ed03633b699505c7278f1eb501342667d0aa910 | [
"Apache-2.0"
] | 273 | 2018-11-26T10:10:24.000Z | 2022-03-30T12:25:28.000Z | #!/usr/bin/env python
# Copyright 2014-2020 The PySCF Developers. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# U... | 39.740331 | 100 | 0.605172 |
import sys
from functools import reduce
import numpy
from pyscf import lib
from pyscf import ao2mo
from pyscf.lib import logger
from pyscf.grad import rhf as rhf_grad
from pyscf.grad.mp2 import _shell_prange
from pyscf.scf import cphf
if sys.version_info < (3,):
RANGE_TYPE = list
else:
RANGE_TYPE = range
... | true | true |
f734d5b2ccd738ec641aa3b8d778120e95269d71 | 18,438 | py | Python | keras/utils/layer_utils_test.py | tsheaff/keras | ee227dda766d769b7499a5549e8ed77b5e88105b | [
"Apache-2.0"
] | 1 | 2020-02-02T04:43:33.000Z | 2020-02-02T04:43:33.000Z | keras/utils/layer_utils_test.py | tsheaff/keras | ee227dda766d769b7499a5549e8ed77b5e88105b | [
"Apache-2.0"
] | 1 | 2022-03-31T16:40:51.000Z | 2022-03-31T16:40:51.000Z | keras/utils/layer_utils_test.py | tsheaff/keras | ee227dda766d769b7499a5549e8ed77b5e88105b | [
"Apache-2.0"
] | 1 | 2020-12-13T22:14:48.000Z | 2020-12-13T22:14:48.000Z | # Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 37.628571 | 255 | 0.558087 |
import keras
import tensorflow.compat.v2 as tf
import collections
import contextlib
import multiprocessing.dummy
import os
import pickle
import shutil
import sys
import time
import timeit
import numpy as np
from keras.utils import io_utils
from keras.utils import layer_utils
_PICKLEABLE_CALL_COUNT = collections.Co... | true | true |
f734d64a2d3fe42732aa1ee1e867be66cb0f7bf3 | 47,046 | py | Python | ranger/config_ranger/commands_full.py | nexayq/dot_files | 473614b8ecdb4efb3ae7098ef3d8687da0585260 | [
"MIT"
] | null | null | null | ranger/config_ranger/commands_full.py | nexayq/dot_files | 473614b8ecdb4efb3ae7098ef3d8687da0585260 | [
"MIT"
] | null | null | null | ranger/config_ranger/commands_full.py | nexayq/dot_files | 473614b8ecdb4efb3ae7098ef3d8687da0585260 | [
"MIT"
] | 2 | 2016-10-24T08:36:03.000Z | 2018-09-09T15:32:21.000Z | # -*- coding: utf-8 -*-
# This file is part of ranger, the console file manager.
# This configuration file is licensed under the same terms as ranger.
# ===================================================================
#
# NOTE: If you copied this file to ~/.config/ranger/commands_full.py,
# then it will NOT be loade... | 30.728935 | 111 | 0.57244 | # It's all in python; lines beginning with # are comments.
# But make sure you update your configs when you update ranger.
#
# ===================================================================
# Every class defined here which is a subclass of `Command' will be used as a
#
# ===========================================... | true | true |
f734d8142392b73526b2bc0c75d4fbafc3612f58 | 3,661 | py | Python | python_modules/dagster/setup.py | davemasino/dagster | cec365242853579c7100bfd87a9ee4f36bdd8344 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/setup.py | davemasino/dagster | cec365242853579c7100bfd87a9ee4f36bdd8344 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/setup.py | davemasino/dagster | cec365242853579c7100bfd87a9ee4f36bdd8344 | [
"Apache-2.0"
] | null | null | null | from setuptools import find_packages, setup
def long_description():
return """
## Dagster
Dagster is a data orchestrator for machine learning, analytics, and ETL.
Dagster lets you define pipelines in terms of the data flow between reusable, logical components,
then test locally and run anywhere. With a unified v... | 39.365591 | 136 | 0.589183 | from setuptools import find_packages, setup
def long_description():
return """
## Dagster
Dagster is a data orchestrator for machine learning, analytics, and ETL.
Dagster lets you define pipelines in terms of the data flow between reusable, logical components,
then test locally and run anywhere. With a unified v... | true | true |
f734d818565dc62e225a1b3a231c734bfd459388 | 1,802 | py | Python | pre_tokenize.py | vyraun/awesome-align | 9871098b94be589f45c505a9732e943fa409cf4d | [
"BSD-3-Clause"
] | null | null | null | pre_tokenize.py | vyraun/awesome-align | 9871098b94be589f45c505a9732e943fa409cf4d | [
"BSD-3-Clause"
] | null | null | null | pre_tokenize.py | vyraun/awesome-align | 9871098b94be589f45c505a9732e943fa409cf4d | [
"BSD-3-Clause"
] | null | null | null | import argparse
import random
import itertools
import os
import tempfile
import warnings
warnings.filterwarnings("ignore")
from awesome_align.tokenization_bert import BasicTokenizer
def main():
parser = argparse.ArgumentParser()
parser.add_argument(
"--data_file", default=None, type=str, required=True,... | 30.033333 | 116 | 0.630411 | import argparse
import random
import itertools
import os
import tempfile
import warnings
warnings.filterwarnings("ignore")
from awesome_align.tokenization_bert import BasicTokenizer
def main():
parser = argparse.ArgumentParser()
parser.add_argument(
"--data_file", default=None, type=str, required=True,... | true | true |
f734d8a1c4282ee4aefbee1bf86ab99face93065 | 930 | py | Python | py3server/swagger_server/test/test_evidence_controller.py | lhannest/pythonBeaconServerStub | 3fee2505f5f7afda9184277b5f6308ff05832e35 | [
"MIT"
] | null | null | null | py3server/swagger_server/test/test_evidence_controller.py | lhannest/pythonBeaconServerStub | 3fee2505f5f7afda9184277b5f6308ff05832e35 | [
"MIT"
] | null | null | null | py3server/swagger_server/test/test_evidence_controller.py | lhannest/pythonBeaconServerStub | 3fee2505f5f7afda9184277b5f6308ff05832e35 | [
"MIT"
] | null | null | null | # coding: utf-8
from __future__ import absolute_import
from swagger_server.models.inline_response2004 import InlineResponse2004
from . import BaseTestCase
from six import BytesIO
from flask import json
class TestEvidenceController(BaseTestCase):
""" EvidenceController integration test stubs """
def test_ge... | 29.0625 | 108 | 0.611828 |
from __future__ import absolute_import
from swagger_server.models.inline_response2004 import InlineResponse2004
from . import BaseTestCase
from six import BytesIO
from flask import json
class TestEvidenceController(BaseTestCase):
def test_get_evidence(self):
query_string = [('keywords', 'keywords_examp... | true | true |
f734d8a2dc5aaa3965dc9b461bc243e1cfe6a270 | 1,081 | py | Python | recipes/cpp-peglib/0.x.x/conanfile.py | rockandsalt/conan-center-index | d739adcec3e4dd4c250eff559ceb738e420673dd | [
"MIT"
] | 562 | 2019-09-04T12:23:43.000Z | 2022-03-29T16:41:43.000Z | recipes/cpp-peglib/0.x.x/conanfile.py | rockandsalt/conan-center-index | d739adcec3e4dd4c250eff559ceb738e420673dd | [
"MIT"
] | 9,799 | 2019-09-04T12:02:11.000Z | 2022-03-31T23:55:45.000Z | recipes/cpp-peglib/0.x.x/conanfile.py | rockandsalt/conan-center-index | d739adcec3e4dd4c250eff559ceb738e420673dd | [
"MIT"
] | 1,126 | 2019-09-04T11:57:46.000Z | 2022-03-31T16:43:38.000Z | from conans import ConanFile, tools
required_conan_version = ">=1.33.0"
class CpppeglibConan(ConanFile):
name = "cpp-peglib"
description = "A single file C++11 header-only PEG (Parsing Expression Grammars) library."
license = "MIT"
topics = ("conan", "cpp-peglib", "peg", "parser", "header-only")
... | 31.794118 | 94 | 0.655874 | from conans import ConanFile, tools
required_conan_version = ">=1.33.0"
class CpppeglibConan(ConanFile):
name = "cpp-peglib"
description = "A single file C++11 header-only PEG (Parsing Expression Grammars) library."
license = "MIT"
topics = ("conan", "cpp-peglib", "peg", "parser", "header-only")
... | true | true |
f734da1f0b7a9ab56219579fceb1f161ba893075 | 14,951 | py | Python | tests/cli/test_rasa_train.py | chaneyjd/rasa | 104a9591fc10b96eaa7fe402b6d64ca652b7ebe2 | [
"Apache-2.0"
] | null | null | null | tests/cli/test_rasa_train.py | chaneyjd/rasa | 104a9591fc10b96eaa7fe402b6d64ca652b7ebe2 | [
"Apache-2.0"
] | 52 | 2020-10-03T11:58:14.000Z | 2022-02-01T13:17:52.000Z | tests/cli/test_rasa_train.py | chaneyjd/rasa | 104a9591fc10b96eaa7fe402b6d64ca652b7ebe2 | [
"Apache-2.0"
] | null | null | null | import os
import tempfile
from pathlib import Path
import pytest
from typing import Callable
from _pytest.pytester import RunResult
import rasa.shared.utils.io
from rasa import model
from rasa.nlu.model import Metadata
from rasa.shared.nlu.training_data import training_data
# noinspection PyProtectedMember
from rasa... | 30.826804 | 92 | 0.590596 | import os
import tempfile
from pathlib import Path
import pytest
from typing import Callable
from _pytest.pytester import RunResult
import rasa.shared.utils.io
from rasa import model
from rasa.nlu.model import Metadata
from rasa.shared.nlu.training_data import training_data
from rasa.cli.train import _get_valid_conf... | true | true |
f734da6aa6ab9faacbf6cc70f08d939bab727772 | 146 | py | Python | old/03/08.py | systemquant/book-pandas-for-finance | 90b7eb9be1de20a12ae72b9bb5d51424a979b174 | [
"MIT"
] | 10 | 2021-02-04T12:49:56.000Z | 2022-03-26T11:28:11.000Z | old/03/08.py | systemquant/book-pandas-for-finance | 90b7eb9be1de20a12ae72b9bb5d51424a979b174 | [
"MIT"
] | 1 | 2022-03-24T03:47:14.000Z | 2022-03-24T03:54:52.000Z | old/03/08.py | systemquant/book-pandas-for-finance | 90b7eb9be1de20a12ae72b9bb5d51424a979b174 | [
"MIT"
] | 4 | 2021-07-17T16:50:15.000Z | 2022-03-22T05:55:34.000Z | from pandas import Series
data = [1000, 2000, 3000]
index = ["메로나", "구구콘", "하겐다즈"]
s = Series(data=data, index=index)
print(s.loc['메로나':'구구콘'])
| 18.25 | 34 | 0.636986 | from pandas import Series
data = [1000, 2000, 3000]
index = ["메로나", "구구콘", "하겐다즈"]
s = Series(data=data, index=index)
print(s.loc['메로나':'구구콘'])
| true | true |
f734daed1be6b52d4591d0e3cbfdf1517893f84d | 5,975 | py | Python | proper_forms/fields/field.py | jpsca/hyperform | d5c450ad8684a853fed26f8c2606877151125a9e | [
"MIT"
] | 2 | 2020-09-30T22:41:00.000Z | 2020-12-04T16:47:17.000Z | proper_forms/fields/field.py | jpsca/hyperform | d5c450ad8684a853fed26f8c2606877151125a9e | [
"MIT"
] | null | null | null | proper_forms/fields/field.py | jpsca/hyperform | d5c450ad8684a853fed26f8c2606877151125a9e | [
"MIT"
] | null | null | null | import re
from .field_renderable import FieldRenderable
__all__ = ("Field", )
default_error_messages = {
"required": "This field is required.",
"type": "Invalid type.",
"min_num": "You need at least {num} values.",
"max_num": "You can have at most {num} values.",
}
HARD_MAX_NUM = 1000
class Fiel... | 25.105042 | 87 | 0.554477 | import re
from .field_renderable import FieldRenderable
__all__ = ("Field", )
default_error_messages = {
"required": "This field is required.",
"type": "Invalid type.",
"min_num": "You need at least {num} values.",
"max_num": "You can have at most {num} values.",
}
HARD_MAX_NUM = 1000
class Fiel... | true | true |
f734dbc58f6d9f310e99ffbb6ea2299976b3b377 | 1,078 | py | Python | src/genie/libs/parser/iosxe/tests/ShowPlatformSoftwareFedSwitchActivePtpInterfaceInterface/cli/equal/golden_output1_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | null | null | null | src/genie/libs/parser/iosxe/tests/ShowPlatformSoftwareFedSwitchActivePtpInterfaceInterface/cli/equal/golden_output1_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | null | null | null | src/genie/libs/parser/iosxe/tests/ShowPlatformSoftwareFedSwitchActivePtpInterfaceInterface/cli/equal/golden_output1_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | null | null | null | expected_output = {
"interface":{
"if_id":"2a",
"clock_mode":"BOUNDARY CLOCK",
"delay_mechanism":"End-to-End",
"delay_req_seq_num":0,
"domain_value":0,
"log_mean_delay_interval":0,
"log_mean_sync_interval":0,
"num_info":{
"num_delay_requests_received":0,
"num_d... | 27.641026 | 51 | 0.592764 | expected_output = {
"interface":{
"if_id":"2a",
"clock_mode":"BOUNDARY CLOCK",
"delay_mechanism":"End-to-End",
"delay_req_seq_num":0,
"domain_value":0,
"log_mean_delay_interval":0,
"log_mean_sync_interval":0,
"num_info":{
"num_delay_requests_received":0,
"num_d... | true | true |
f734dca4d057e52d82e93c9c2cb00c6a673f1488 | 1,303 | py | Python | azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_instance_view_statuses_summary.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 4 | 2016-06-17T23:25:29.000Z | 2022-03-30T22:37:45.000Z | azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_instance_view_statuses_summary.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 2 | 2016-09-30T21:40:24.000Z | 2017-11-10T18:16:18.000Z | azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/virtual_machine_scale_set_instance_view_statuses_summary.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 3 | 2016-05-03T20:49:46.000Z | 2017-10-05T21:05:27.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 ... | 34.289474 | 98 | 0.649271 |
from msrest.serialization import Model
class VirtualMachineScaleSetInstanceViewStatusesSummary(Model):
_validation = {
'statuses_summary': {'readonly': True},
}
_attribute_map = {
'statuses_summary': {'key': 'statusesSummary', 'type': '[VirtualMachineStatusCodeCount]'},
}
def _... | true | true |
f734dd1ef6c0c61d40522bf0bb879127537e3d4f | 1,272 | py | Python | exporter/myapp.py | zeshahid/websitecheck_exporter | 282e5f19d9e778479bbf9e00b468e1313060acba | [
"MIT"
] | null | null | null | exporter/myapp.py | zeshahid/websitecheck_exporter | 282e5f19d9e778479bbf9e00b468e1313060acba | [
"MIT"
] | null | null | null | exporter/myapp.py | zeshahid/websitecheck_exporter | 282e5f19d9e778479bbf9e00b468e1313060acba | [
"MIT"
] | null | null | null | from typing import Counter
from prometheus_client import start_http_server, Summary, Counter, Gauge ,__all__ ,Histogram
import random
import time
from requests import get
import requests
from requests.api import post
urls =["https://httpstat.us/503","https://httpstat.us/200"]
sitestatus = Gauge('sample_external_url_... | 34.378378 | 103 | 0.699686 | from typing import Counter
from prometheus_client import start_http_server, Summary, Counter, Gauge ,__all__ ,Histogram
import random
import time
from requests import get
import requests
from requests.api import post
urls =["https://httpstat.us/503","https://httpstat.us/200"]
sitestatus = Gauge('sample_external_url_... | true | true |
f734dd86bad4fa348424eff36dc67fc52e519284 | 32 | py | Python | HRM.py | asheu96/bme590hrm | c5d3b494149859a38f75452d1e61f6fc1c8bbea3 | [
"MIT"
] | null | null | null | HRM.py | asheu96/bme590hrm | c5d3b494149859a38f75452d1e61f6fc1c8bbea3 | [
"MIT"
] | null | null | null | HRM.py | asheu96/bme590hrm | c5d3b494149859a38f75452d1e61f6fc1c8bbea3 | [
"MIT"
] | null | null | null | # module for heart rate monitor
| 16 | 31 | 0.78125 | true | true | |
f734ddcdfbef18b57cb25db07dab576af78ed413 | 2,141 | py | Python | services.py | vida18electronic/barcode | 265318d893a9dabc71231424252b2476926577ec | [
"Apache-2.0"
] | null | null | null | services.py | vida18electronic/barcode | 265318d893a9dabc71231424252b2476926577ec | [
"Apache-2.0"
] | null | null | null | services.py | vida18electronic/barcode | 265318d893a9dabc71231424252b2476926577ec | [
"Apache-2.0"
] | null | null | null | import json
import requests
import sys
import os
import socket
import fcntl
import struct
#info_device={"MAC_ADDRESS":"xx","IP_ADDRESS":"xxx","BLOCK_ID":"01","STOP_ID":"xxx"}
#info_buncher={"BUNCHER_ID":"xx","BUNCH_ID":"xx","COMPOSITION_ID":"xx","TUB_ID":"xx","TxR":"xx","GR":"xx","VARIETY_ID":"xx","BLOCK_ID":"xx"}
d... | 29.328767 | 140 | 0.627744 | import json
import requests
import sys
import os
import socket
import fcntl
import struct
def getMAC(interface='wlan0'):
try:
str = open('/sys/class/net/%s/address' %interface).read()
except:
str = "00:00:00:00:00:00"
return str[0:17]
def get_local_ip_address(target):
ipaddr = ''
try:
s = s... | true | true |
f734ddfee0c273d99cb4d87ab366012e453afc2e | 7,323 | py | Python | tests/test_memory_leak.py | fintzd/rasa | 6359be5509c7d87cd29c2ab5149bc45e843fea85 | [
"Apache-2.0"
] | 9,701 | 2019-04-16T15:46:27.000Z | 2022-03-31T11:52:18.000Z | tests/test_memory_leak.py | fintzd/rasa | 6359be5509c7d87cd29c2ab5149bc45e843fea85 | [
"Apache-2.0"
] | 6,420 | 2019-04-16T15:58:22.000Z | 2022-03-31T17:54:35.000Z | tests/test_memory_leak.py | fintzd/rasa | 6359be5509c7d87cd29c2ab5149bc45e843fea85 | [
"Apache-2.0"
] | 3,063 | 2019-04-16T15:23:52.000Z | 2022-03-31T00:01:12.000Z | import abc
import json
import subprocess
import sys
import tempfile
import time
from pathlib import Path
from typing import Text, List, Tuple, Optional, Union
import memory_profiler
import psutil
import pytest
import rasa
import rasa.shared.utils.io
PROFILING_INTERVAL = 0.1
# Enable this to plot the results locally... | 31.294872 | 87 | 0.583777 | import abc
import json
import subprocess
import sys
import tempfile
import time
from pathlib import Path
from typing import Text, List, Tuple, Optional, Union
import memory_profiler
import psutil
import pytest
import rasa
import rasa.shared.utils.io
PROFILING_INTERVAL = 0.1
WRITE_RESULTS_TO_DISK = False
def _cust... | true | true |
f734dead270c5ec9243064030981190070a9e1f6 | 83 | py | Python | FusionIIIT/applications/hostel_management/urls.py | suyash-code/Fusion-op | eb1242d184482cd6585988028afb182b37abc25c | [
"bzip2-1.0.6"
] | null | null | null | FusionIIIT/applications/hostel_management/urls.py | suyash-code/Fusion-op | eb1242d184482cd6585988028afb182b37abc25c | [
"bzip2-1.0.6"
] | null | null | null | FusionIIIT/applications/hostel_management/urls.py | suyash-code/Fusion-op | eb1242d184482cd6585988028afb182b37abc25c | [
"bzip2-1.0.6"
] | 3 | 2021-04-19T14:26:01.000Z | 2021-04-22T13:34:48.000Z | from django.conf.urls import url
app_name = 'hostel_management'
urlpatterns = []
| 13.833333 | 32 | 0.759036 | from django.conf.urls import url
app_name = 'hostel_management'
urlpatterns = []
| true | true |
f734ded5634d3062fbab77a54c8816eaf43cb21c | 327 | py | Python | setup.py | PyUnchained/pickle_storage | c0a978701ae59a9feeb3e14026ff0b2353b2e7f5 | [
"MIT"
] | null | null | null | setup.py | PyUnchained/pickle_storage | c0a978701ae59a9feeb3e14026ff0b2353b2e7f5 | [
"MIT"
] | null | null | null | setup.py | PyUnchained/pickle_storage | c0a978701ae59a9feeb3e14026ff0b2353b2e7f5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(name='pickle-storage',
version='0.1',
description='Python Pickle-Based Data Storage',
author='Tatenda Tambo',
author_email='tatendatambo@gmail.com',
packages=find_packages(),
install_requires=['wrapt>=1.12.1']
... | 27.25 | 53 | 0.669725 |
from setuptools import setup, find_packages
setup(name='pickle-storage',
version='0.1',
description='Python Pickle-Based Data Storage',
author='Tatenda Tambo',
author_email='tatendatambo@gmail.com',
packages=find_packages(),
install_requires=['wrapt>=1.12.1']
) | true | true |
f734dee5533468bd89adc7a9869f9458710bc490 | 5,368 | py | Python | models.py | vidursatija/SongWCT | c892c2833ff9f85cfb31788babf016699c5eec8f | [
"MIT"
] | null | null | null | models.py | vidursatija/SongWCT | c892c2833ff9f85cfb31788babf016699c5eec8f | [
"MIT"
] | null | null | null | models.py | vidursatija/SongWCT | c892c2833ff9f85cfb31788babf016699c5eec8f | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
try:
from torch.hub import load_state_dict_from_url
except ImportError:
from torch.utils.model_zoo import load_url as load_state_dict_from_url
from torchsummary import summary
import numpy as np
class X_Enc(nn.Module):
def __init__(self, layers, num_classes=1000, init_we... | 32.731707 | 91 | 0.575075 | import torch
import torch.nn as nn
try:
from torch.hub import load_state_dict_from_url
except ImportError:
from torch.utils.model_zoo import load_url as load_state_dict_from_url
from torchsummary import summary
import numpy as np
class X_Enc(nn.Module):
def __init__(self, layers, num_classes=1000, init_we... | true | true |
f734df57e7a00474f077f260bc9b03ce6ece41c0 | 492 | py | Python | apps/gradings/migrations/0001_initial.py | cloudartisan/dojomaster | 9d5efa0345c659636f8d8b556302d0d7bb2055a8 | [
"MIT"
] | 1 | 2019-02-21T14:47:31.000Z | 2019-02-21T14:47:31.000Z | apps/gradings/migrations/0001_initial.py | cloudartisan/dojomaster | 9d5efa0345c659636f8d8b556302d0d7bb2055a8 | [
"MIT"
] | null | null | null | apps/gradings/migrations/0001_initial.py | cloudartisan/dojomaster | 9d5efa0345c659636f8d8b556302d0d7bb2055a8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-09-30 23:43
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Gradin... | 21.391304 | 114 | 0.599593 | from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Grading',
fields=[
('id', models.AutoField(auto_cre... | true | true |
f734df86fba52bb0e5b0075c1880a25fc79ec783 | 113 | py | Python | Python/pythonProject/exercise/ex047.py | JoaoMoreira2002/Linguagens-de-programacao | b91a902188428238a567c8f52b2ac9028378c4df | [
"MIT"
] | null | null | null | Python/pythonProject/exercise/ex047.py | JoaoMoreira2002/Linguagens-de-programacao | b91a902188428238a567c8f52b2ac9028378c4df | [
"MIT"
] | null | null | null | Python/pythonProject/exercise/ex047.py | JoaoMoreira2002/Linguagens-de-programacao | b91a902188428238a567c8f52b2ac9028378c4df | [
"MIT"
] | null | null | null | for x in range(0, 11):
for c in range(0, 11):
print(x, 'x', c, '= {}'.format(x * c))
print('\t')
| 22.6 | 46 | 0.442478 | for x in range(0, 11):
for c in range(0, 11):
print(x, 'x', c, '= {}'.format(x * c))
print('\t')
| true | true |
f734e032d4a7eeaed6fa44b9a554d7707bbd9ef9 | 6,038 | py | Python | reading_data.py | eembees/solar_flares | 9022f92c0577efaf06d7425002995e4fa4df74b4 | [
"MIT"
] | null | null | null | reading_data.py | eembees/solar_flares | 9022f92c0577efaf06d7425002995e4fa4df74b4 | [
"MIT"
] | null | null | null | reading_data.py | eembees/solar_flares | 9022f92c0577efaf06d7425002995e4fa4df74b4 | [
"MIT"
] | null | null | null | from pathlib import Path
import ijson
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
from json import JSONDecoder, JSONDecodeError # for reading the JSON data files
import re # for regular expressions
import os # for os related operations
from sklearn.pre... | 29.598039 | 86 | 0.61792 | from pathlib import Path
import ijson
import numpy as np import pandas as pd from json import JSONDecoder, JSONDecodeError import re import os from sklearn.preprocessing import maxabs_scale
def decode_obj(line, pos=0, decoder=JSONDecoder()):
no_white_space_regex = re.compile(r'[^\s]')
while True:
... | true | true |
f734e09b76bc265ceb72504136dbcb9a86e98111 | 5,912 | py | Python | CORE/engines/constraint.py | geoffreynyaga/ostrich-project | 157cd7a3c3d9014e31ef21ca21de43f04d039997 | [
"MIT"
] | 15 | 2017-11-08T10:03:26.000Z | 2021-12-21T07:02:44.000Z | CORE/engines/constraint.py | geoffreynyaga/ostrich-project | 157cd7a3c3d9014e31ef21ca21de43f04d039997 | [
"MIT"
] | 9 | 2020-01-17T15:09:22.000Z | 2022-03-25T19:02:05.000Z | CORE/engines/constraint.py | geoffreynyaga/ostrich-project | 157cd7a3c3d9014e31ef21ca21de43f04d039997 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
##################################################################################
# File: c:\Projects\KENYA ONE PROJECT\CORE\engines\constraint.py #
# Project: c:\Projects\KENYA ONE PROJECT\CORE\engines #
# Created Date: Thur... | 38.894737 | 88 | 0.508965 |
import sys
sys.path.append("../")
from CORE.API.db_API import write_to_db, read_from_db
import numpy as np import matplotlib.pylab as plt
a = np.arange(50)
ws = np.arange(10, 35, 0.01)
cdmin: float = 0.025
write_to_db("cdMin", cdmin)
do = read_from_db("rhoSL")
dalt = read_from_db("altitudeDens... | true | true |
f734e0e3ddd024eab587865ded77a0ef1faf2c77 | 4,984 | py | Python | DEPRECATED_PYTHON_SRC/component/_brz_win.py | 17701253801/firefly-proxy | 153e0d343d93d68a803bba6b89497f7bc2b96bc8 | [
"BSD-2-Clause"
] | 5,895 | 2015-01-01T14:33:17.000Z | 2022-03-19T03:08:48.000Z | DEPRECATED_PYTHON_SRC/component/_brz_win.py | BIGMONK/firefly-proxy | 60161af7b239ab400d39a23b61ab312f84b94570 | [
"BSD-2-Clause"
] | 626 | 2015-01-07T22:09:26.000Z | 2022-03-24T01:56:50.000Z | DEPRECATED_PYTHON_SRC/component/_brz_win.py | BIGMONK/firefly-proxy | 60161af7b239ab400d39a23b61ab312f84b94570 | [
"BSD-2-Clause"
] | 1,145 | 2015-01-04T06:50:54.000Z | 2022-03-15T13:12:17.000Z | # Copied from https://github.com/downloadam/client/blob/master/client/registry/win.py
import logging
import sys
import os
from contextlib import contextmanager
import subprocess
import _winreg as winreg
from _winreg import HKEY_CLASSES_ROOT, HKEY_LOCAL_MACHINE, HKEY_CURRENT_USER, \
KEY_QUERY_VALUE, REG_SZ, KEY_ALL_ACC... | 33.006623 | 151 | 0.611758 | import logging
import sys
import os
from contextlib import contextmanager
import subprocess
import _winreg as winreg
from _winreg import HKEY_CLASSES_ROOT, HKEY_LOCAL_MACHINE, HKEY_CURRENT_USER, \
KEY_QUERY_VALUE, REG_SZ, KEY_ALL_ACCESS, KEY_WRITE, KEY_CREATE_SUB_KEY, KEY_SET_VALUE
log = logging.getLogger(__name__)
... | true | true |
f734e2ae995f4f0b1438b926ddce732f5c03bcb5 | 2,949 | py | Python | students/k3342/laboratory_works/Shaidullina_Regina/laboratory_work_1/leaderboard/migrations/0001_initial.py | TonikX/ITMO_ICT_-WebProgramming_2020 | ba566c1b3ab04585665c69860b713741906935a0 | [
"MIT"
] | 10 | 2020-03-20T09:06:12.000Z | 2021-07-27T13:06:02.000Z | students/k3342/laboratory_works/Shaidullina_Regina/laboratory_work_1/leaderboard/migrations/0001_initial.py | TonikX/ITMO_ICT_-WebProgramming_2020 | ba566c1b3ab04585665c69860b713741906935a0 | [
"MIT"
] | 134 | 2020-03-23T09:47:48.000Z | 2022-03-12T01:05:19.000Z | students/k3342/laboratory_works/Shaidullina_Regina/laboratory_work_1/leaderboard/migrations/0001_initial.py | TonikX/ITMO_ICT_-WebProgramming_2020 | ba566c1b3ab04585665c69860b713741906935a0 | [
"MIT"
] | 71 | 2020-03-20T12:45:56.000Z | 2021-10-31T19:22:25.000Z | # Generated by Django 3.0.4 on 2020-04-18 12:38
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Car',
fields=[
... | 43.367647 | 418 | 0.528654 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Car',
fields=[
('id', models.AutoField(auto_created=True, ... | true | true |
f734e32ec87c1cc2ff0c847206e45f81f0a44682 | 5,052 | py | Python | kubernetes/client/models/v1beta1_allowed_host_path.py | lp67/python | 33c5ea9835356410ce4a9fa54a02c6a2a22143c6 | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/v1beta1_allowed_host_path.py | lp67/python | 33c5ea9835356410ce4a9fa54a02c6a2a22143c6 | [
"Apache-2.0"
] | 4 | 2019-11-19T10:33:47.000Z | 2022-03-01T03:33:52.000Z | kubernetes/client/models/v1beta1_allowed_host_path.py | mohramadan911/PythonClientAPI | 5d111812c81b7a573ac8661d1aec60bb97072412 | [
"Apache-2.0"
] | 2 | 2021-08-10T16:35:31.000Z | 2021-09-14T04:53:06.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.20
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... | 33.456954 | 294 | 0.615796 |
import pprint
import re
import six
from kubernetes.client.configuration import Configuration
class V1beta1AllowedHostPath(object):
openapi_types = {
'path_prefix': 'str',
'read_only': 'bool'
}
attribute_map = {
'path_prefix': 'pathPrefix',
'read_only': 'readOnly'
... | true | true |
f734e3a1ce3a24d57c1f838699b9ec656d8a897c | 7,219 | py | Python | src/antidote/_constants.py | Finistere/antidote | 97751e0e6a1b8bd638a1c33212345c7a84ad97b8 | [
"MIT"
] | 52 | 2017-12-17T19:52:37.000Z | 2022-03-29T10:24:04.000Z | src/antidote/_constants.py | Finistere/antidote | 97751e0e6a1b8bd638a1c33212345c7a84ad97b8 | [
"MIT"
] | 32 | 2018-11-02T08:49:16.000Z | 2022-03-25T22:23:30.000Z | src/antidote/_constants.py | Finistere/antidote | 97751e0e6a1b8bd638a1c33212345c7a84ad97b8 | [
"MIT"
] | 5 | 2019-05-17T18:26:14.000Z | 2021-12-25T23:13:31.000Z | from typing import (Any, Dict, Generic, Hashable, Optional, TYPE_CHECKING, Tuple, Type,
TypeVar, Union, cast, overload)
from ._compatibility.typing import final, Protocol
from ._internal import API
from ._internal.utils import AbstractMeta, Default, FinalImmutable, FinalMeta, debug_repr
from ._inte... | 33.892019 | 89 | 0.575842 | from typing import (Any, Dict, Generic, Hashable, Optional, TYPE_CHECKING, Tuple, Type,
TypeVar, Union, cast, overload)
from ._compatibility.typing import final, Protocol
from ._internal import API
from ._internal.utils import AbstractMeta, Default, FinalImmutable, FinalMeta, debug_repr
from ._inte... | true | true |
f734e42e8c40b73c89d6a81190560d99c06b2daa | 582 | py | Python | plot.py | nkuxx161/baseline-SR | c4caf06c5a5a88d7f8e27069018316b319f0913b | [
"MIT"
] | null | null | null | plot.py | nkuxx161/baseline-SR | c4caf06c5a5a88d7f8e27069018316b319f0913b | [
"MIT"
] | null | null | null | plot.py | nkuxx161/baseline-SR | c4caf06c5a5a88d7f8e27069018316b319f0913b | [
"MIT"
] | null | null | null | import pandas as pd
import os
curve_name = '5_k7'
data = pd.read_csv(os.path.join('result', curve_name+'.csv'))
timestamp = data['timestamp']
value = data['value']
mag = data['mag']
isAnomaly = data['isAnomaly']
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
plt.subplot(3, 1, 1)
plt.plot(t... | 19.4 | 62 | 0.704467 | import pandas as pd
import os
curve_name = '5_k7'
data = pd.read_csv(os.path.join('result', curve_name+'.csv'))
timestamp = data['timestamp']
value = data['value']
mag = data['mag']
isAnomaly = data['isAnomaly']
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
plt.subplot(3, 1, 1)
plt.plot(t... | true | true |
f734e53915eb41c00db1f0b9283810f28578ae28 | 1,048 | py | Python | troc/apps/record/migrations/0001_initial.py | Windfarer/species2 | 15849c5805621410f3e8c26d27213f9bcf483fd1 | [
"MIT"
] | 1 | 2020-01-02T11:50:50.000Z | 2020-01-02T11:50:50.000Z | troc/apps/record/migrations/0001_initial.py | Windfarer/species2 | 15849c5805621410f3e8c26d27213f9bcf483fd1 | [
"MIT"
] | 5 | 2019-12-15T07:43:46.000Z | 2022-02-26T17:47:26.000Z | troc/apps/record/migrations/0001_initial.py | Windfarer/species2 | 15849c5805621410f3e8c26d27213f9bcf483fd1 | [
"MIT"
] | 1 | 2020-06-13T02:25:42.000Z | 2020-06-13T02:25:42.000Z | # Generated by Django 2.2.5 on 2019-10-07 08:27
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('species', '0002_auto_20190908_0902'),
... | 34.933333 | 118 | 0.655534 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('species', '0002_auto_20190908_0902'),
migrations.swappable_dependency(settings.AUT... | true | true |
f734e66795d03e7b634e13c3a1bbf25ad1e1bcbd | 20,783 | py | Python | models/_sources/model_trainer_c4d127b7cc8008ff2c0c849733ead6e1.py | catniplab/ML-music-analysis | 793d54ed16166fbcd9acf4eec24998892334e064 | [
"MIT"
] | null | null | null | models/_sources/model_trainer_c4d127b7cc8008ff2c0c849733ead6e1.py | catniplab/ML-music-analysis | 793d54ed16166fbcd9acf4eec24998892334e064 | [
"MIT"
] | null | null | null | models/_sources/model_trainer_c4d127b7cc8008ff2c0c849733ead6e1.py | catniplab/ML-music-analysis | 793d54ed16166fbcd9acf4eec24998892334e064 | [
"MIT"
] | 1 | 2021-12-01T22:57:56.000Z | 2021-12-01T22:57:56.000Z | """
This script creates an instance of a sacred experiment and defines default configurations for training a neural network or a regression model.
"""
from src.neural_nets.models import get_model
from src.neural_nets.load_data import get_loader
from src.neural_nets.metrics import MaskedBCE, Accuracy, compute_acc, comp... | 35.405451 | 142 | 0.505172 |
from src.neural_nets.models import get_model
from src.neural_nets.load_data import get_loader
from src.neural_nets.metrics import MaskedBCE, Accuracy, compute_acc, compute_loss
import src.regression.logistic_regression as reg
import os
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim... | true | true |
f734e6fd78fd01730a7c42ee39a5882d91564b45 | 9,026 | py | Python | test/ut/tools/annotation/testcase/usercode/mnist.py | dutxubo/nni | c16f4e1c89b54b8b80661ef0072433d255ad2d24 | [
"MIT"
] | 9,680 | 2019-05-07T01:42:30.000Z | 2022-03-31T16:48:33.000Z | test/ut/tools/annotation/testcase/usercode/mnist.py | dutxubo/nni | c16f4e1c89b54b8b80661ef0072433d255ad2d24 | [
"MIT"
] | 1,957 | 2019-05-06T21:44:21.000Z | 2022-03-31T09:21:53.000Z | test/ut/tools/annotation/testcase/usercode/mnist.py | dutxubo/nni | c16f4e1c89b54b8b80661ef0072433d255ad2d24 | [
"MIT"
] | 1,571 | 2019-05-07T06:42:55.000Z | 2022-03-31T03:19:24.000Z | # -*- encoding:utf8 -*-
"""A deep MNIST classifier using convolutional layers.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import logging
import math
import tempfile
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_dat... | 42.980952 | 260 | 0.634611 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import logging
import math
import tempfile
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
logger = logging.getLogger('mnist')
FLAGS = None
class MnistNetwork(object):
... | true | true |
f734e7ac84c8e5d7674c3e443378662983d9d4e5 | 386 | py | Python | demos/python/python_musl/demo.py | jessehui/occlum | 8a5f3033881c090340d678f2aecdca4ac6355bf4 | [
"BSD-3-Clause-Clear"
] | 928 | 2019-07-04T12:00:04.000Z | 2022-03-30T02:45:06.000Z | demos/python/python_musl/demo.py | jessehui/occlum | 8a5f3033881c090340d678f2aecdca4ac6355bf4 | [
"BSD-3-Clause-Clear"
] | 333 | 2019-07-01T07:42:49.000Z | 2022-03-31T10:53:19.000Z | demos/python/python_musl/demo.py | jessehui/occlum | 8a5f3033881c090340d678f2aecdca4ac6355bf4 | [
"BSD-3-Clause-Clear"
] | 161 | 2019-07-19T03:46:44.000Z | 2022-03-28T02:16:31.000Z | import pandas as pd
import numpy as np
from sklearn.datasets import dump_svmlight_file
df1 = pd.read_csv("./dataset/input_label.csv")
df2 = pd.read_csv("./dataset/input.csv")
res = pd.merge(df1, df2, how='left', left_on='id', right_on='id')
X = res[np.setdiff1d(res.columns,['label','id'])]
y = res.label
dump_svmligh... | 29.692308 | 77 | 0.733161 | import pandas as pd
import numpy as np
from sklearn.datasets import dump_svmlight_file
df1 = pd.read_csv("./dataset/input_label.csv")
df2 = pd.read_csv("./dataset/input.csv")
res = pd.merge(df1, df2, how='left', left_on='id', right_on='id')
X = res[np.setdiff1d(res.columns,['label','id'])]
y = res.label
dump_svmligh... | true | true |
f734ea1c07870fb34749ffbc4233d57c196b4351 | 8,912 | py | Python | pgAdmin/pgadmin4/web/pgadmin/tools/sqleditor/tests/test_encoding_charset.py | WeilerWebServices/PostgreSQL | ae594ed077bebbad1be3c1d95c38b7c2c2683e8c | [
"PostgreSQL"
] | null | null | null | pgAdmin/pgadmin4/web/pgadmin/tools/sqleditor/tests/test_encoding_charset.py | WeilerWebServices/PostgreSQL | ae594ed077bebbad1be3c1d95c38b7c2c2683e8c | [
"PostgreSQL"
] | null | null | null | pgAdmin/pgadmin4/web/pgadmin/tools/sqleditor/tests/test_encoding_charset.py | WeilerWebServices/PostgreSQL | ae594ed077bebbad1be3c1d95c38b7c2c2683e8c | [
"PostgreSQL"
] | null | null | null | # -*- coding: utf-8 -*-
##########################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2020, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#
#####################################################################... | 30.520548 | 76 | 0.439408 |
from pgadmin.utils.route import BaseTestGenerator
from pgadmin.browser.server_groups.servers.databases.tests import utils as \
database_utils
from regression.python_test_utils import test_utils
import json
from pgadmin.utils import server_utils
import random
class TestEncodingCharset(BaseTestGenerator):
skip... | true | true |
f734ea202c7b17c7d2628d4129edacee942ccbf4 | 1,324 | py | Python | oscar/apps/dashboard/ranges/app.py | endgame/django-oscar | e5d78436e20b55902537a6cc82edf4e22568f9d6 | [
"BSD-3-Clause"
] | null | null | null | oscar/apps/dashboard/ranges/app.py | endgame/django-oscar | e5d78436e20b55902537a6cc82edf4e22568f9d6 | [
"BSD-3-Clause"
] | null | null | null | oscar/apps/dashboard/ranges/app.py | endgame/django-oscar | e5d78436e20b55902537a6cc82edf4e22568f9d6 | [
"BSD-3-Clause"
] | 1 | 2019-07-10T06:32:14.000Z | 2019-07-10T06:32:14.000Z | from django.conf.urls import patterns, url
from django.contrib.admin.views.decorators import staff_member_required
from django.utils.translation import ugettext_lazy as _
from oscar.core.application import Application
from oscar.apps.dashboard.ranges import views
from oscar.apps.dashboard.nav import register, Node
no... | 35.783784 | 97 | 0.700906 | from django.conf.urls import patterns, url
from django.contrib.admin.views.decorators import staff_member_required
from django.utils.translation import ugettext_lazy as _
from oscar.core.application import Application
from oscar.apps.dashboard.ranges import views
from oscar.apps.dashboard.nav import register, Node
no... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.