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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f750ec3cce4399c8d854f85d849eaa49bcaf00fd | 25,361 | py | Python | directord/tests/test_mixin.py | peznauts/directord | 881eff5e4aeed40bcc229c58a2c055b193006295 | [
"Apache-2.0"
] | null | null | null | directord/tests/test_mixin.py | peznauts/directord | 881eff5e4aeed40bcc229c58a2c055b193006295 | [
"Apache-2.0"
] | null | null | null | directord/tests/test_mixin.py | peznauts/directord | 881eff5e4aeed40bcc229c58a2c055b193006295 | [
"Apache-2.0"
] | null | null | null | # Copyright Peznauts <kevin@cloudnull.com>. 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 requ... | 37.795827 | 152 | 0.511494 |
import json
import unittest
from unittest.mock import patch
from directord import mixin
from directord import tests
TEST_FINGER_PRINTS = """count parent verb exec job
------- -------------------------------------------------------- ------... | true | true |
f750ecd19116acbbb74427e52ca3e8c7ce40518f | 5,356 | py | Python | autowoe/lib/types_handler/types_handler.py | VitaliyPavlyukov/AutoMLWhitebox | 4acd55624490707a7fbf036631533e29123bb1bd | [
"Apache-2.0"
] | 53 | 2020-12-02T20:19:34.000Z | 2022-03-30T05:11:14.000Z | autowoe/lib/types_handler/types_handler.py | VitaliyPavlyukov/AutoMLWhitebox | 4acd55624490707a7fbf036631533e29123bb1bd | [
"Apache-2.0"
] | 8 | 2021-02-16T09:15:48.000Z | 2022-02-16T14:13:36.000Z | autowoe/lib/types_handler/types_handler.py | VitaliyPavlyukov/AutoMLWhitebox | 4acd55624490707a7fbf036631533e29123bb1bd | [
"Apache-2.0"
] | 8 | 2020-12-08T05:05:25.000Z | 2022-01-10T09:34:52.000Z | import collections
import pandas as pd
from typing import Dict, Hashable, Optional, Any
from copy import deepcopy
from .features_checkers_handlers import dates_handler, dates_checker, cat_checker
class TypesHandler:
"""
Класс для автоматического определения типов признаков.
Базовая имплементация порядк... | 32.658537 | 114 | 0.625093 | import collections
import pandas as pd
from typing import Dict, Hashable, Optional, Any
from copy import deepcopy
from .features_checkers_handlers import dates_handler, dates_checker, cat_checker
class TypesHandler:
def __init__(self,
train: pd.DataFrame,
public_features_type... | true | true |
f750ed170ddb6cdf23a4e5350adf69344918007f | 3,214 | py | Python | lens/sie/random.py | bombrun/GaiaLQSO | b4d787a4d80732cbb5a3762c34298f2430dd0540 | [
"CC-BY-4.0"
] | 1 | 2019-04-11T12:48:32.000Z | 2019-04-11T12:48:32.000Z | lens/sie/random.py | bombrun/GaiaLQSO | b4d787a4d80732cbb5a3762c34298f2430dd0540 | [
"CC-BY-4.0"
] | 2 | 2018-05-08T10:09:26.000Z | 2018-05-25T07:55:51.000Z | lens/sie/random.py | bombrun/GaiaLQSO | b4d787a4d80732cbb5a3762c34298f2430dd0540 | [
"CC-BY-4.0"
] | null | null | null | import numpy as np
import pandas as pd
import astropy.units as u
import healpy as hp
from lens.sie.plot import *
def angle2pixel(ra_deg,dec_deg):
""" return healpix index 12"""
phi = ra_deg * np.pi / 180
theta = np.pi/2 - (dec_deg * np.pi/180)
return hp.ang2pix(4096,theta,phi,nest=True)
def lensedQS... | 30.037383 | 94 | 0.609521 | import numpy as np
import pandas as pd
import astropy.units as u
import healpy as hp
from lens.sie.plot import *
def angle2pixel(ra_deg,dec_deg):
phi = ra_deg * np.pi / 180
theta = np.pi/2 - (dec_deg * np.pi/180)
return hp.ang2pix(4096,theta,phi,nest=True)
def lensedQSO(f,scale,w,y,dy,gy):
xs,p... | true | true |
f750ed848c039b90f20b9719b0d50b0b384f500e | 662 | py | Python | ginger_arxiv/users/tests/test_urls.py | pjhoberman/ginger-arxiv | 5fcfd6c12bfb9342df48f7f609ad073a0fbea1bc | [
"MIT"
] | null | null | null | ginger_arxiv/users/tests/test_urls.py | pjhoberman/ginger-arxiv | 5fcfd6c12bfb9342df48f7f609ad073a0fbea1bc | [
"MIT"
] | null | null | null | ginger_arxiv/users/tests/test_urls.py | pjhoberman/ginger-arxiv | 5fcfd6c12bfb9342df48f7f609ad073a0fbea1bc | [
"MIT"
] | null | null | null | import pytest
from django.urls import resolve, reverse
from ginger_arxiv.users.models import User
pytestmark = pytest.mark.django_db
def test_detail(user: User):
assert (
reverse("users:detail", kwargs={"username": user.username})
== f"/users/{user.username}/"
)
assert resolve(f"/users/{... | 26.48 | 74 | 0.678248 | import pytest
from django.urls import resolve, reverse
from ginger_arxiv.users.models import User
pytestmark = pytest.mark.django_db
def test_detail(user: User):
assert (
reverse("users:detail", kwargs={"username": user.username})
== f"/users/{user.username}/"
)
assert resolve(f"/users/{... | true | true |
f750edb788d8a72d879cbafe57dc9e164c4dd545 | 1,654 | py | Python | cloudroast/compute/burn_in/test_rescue_server_burn_in.py | lmaycotte/cloudroast | c1835aa45e0e86c755d4b24b33e12ba30eee1995 | [
"Apache-2.0"
] | null | null | null | cloudroast/compute/burn_in/test_rescue_server_burn_in.py | lmaycotte/cloudroast | c1835aa45e0e86c755d4b24b33e12ba30eee1995 | [
"Apache-2.0"
] | null | null | null | cloudroast/compute/burn_in/test_rescue_server_burn_in.py | lmaycotte/cloudroast | c1835aa45e0e86c755d4b24b33e12ba30eee1995 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2013 Rackspace
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dist... | 32.431373 | 74 | 0.741233 |
from unittest2.suite import TestSuite
from cafe.drivers.unittest.decorators import tags
from cloudroast.compute.fixtures import ComputeFixture
def load_tests(loader, standard_tests, pattern):
suite = TestSuite()
suite.addTest(RescueServerBurnIn("test_rescue_server"))
suite.addTest(RescueServerBurnIn("t... | true | true |
f750edc75880d8e47601b1c4066b15cf1314e05c | 11,495 | py | Python | util/visualizer.py | DongChengdongHangZhou/CycleGAN-tiff | e13a4d702ac6ce3e13af4946a1bc6657c1a2089e | [
"BSD-3-Clause"
] | null | null | null | util/visualizer.py | DongChengdongHangZhou/CycleGAN-tiff | e13a4d702ac6ce3e13af4946a1bc6657c1a2089e | [
"BSD-3-Clause"
] | null | null | null | util/visualizer.py | DongChengdongHangZhou/CycleGAN-tiff | e13a4d702ac6ce3e13af4946a1bc6657c1a2089e | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import os
import sys
import ntpath
import time
from . import util, html
from subprocess import Popen, PIPE
import tifffile as tiff
if sys.version_info[0] == 2:
VisdomExceptionBase = Exception
else:
VisdomExceptionBase = ConnectionError
def save_images(webpage, visuals, image_path, aspect_... | 46.538462 | 139 | 0.576338 | import numpy as np
import os
import sys
import ntpath
import time
from . import util, html
from subprocess import Popen, PIPE
import tifffile as tiff
if sys.version_info[0] == 2:
VisdomExceptionBase = Exception
else:
VisdomExceptionBase = ConnectionError
def save_images(webpage, visuals, image_path, aspect_... | true | true |
f750eec073aeb3a8bf3bda375aa71e8e64761367 | 476 | py | Python | pset_pandas_ext/101problems/solutions/p7.py | mottaquikarim/pydev-psets | 9749e0d216ee0a5c586d0d3013ef481cc21dee27 | [
"MIT"
] | 5 | 2019-04-08T20:05:37.000Z | 2019-12-04T20:48:45.000Z | pset_pandas_ext/101problems/solutions/p7.py | mottaquikarim/pydev-psets | 9749e0d216ee0a5c586d0d3013ef481cc21dee27 | [
"MIT"
] | 8 | 2019-04-15T15:16:05.000Z | 2022-02-12T10:33:32.000Z | pset_pandas_ext/101problems/solutions/p7.py | mottaquikarim/pydev-psets | 9749e0d216ee0a5c586d0d3013ef481cc21dee27 | [
"MIT"
] | 2 | 2019-04-10T00:14:42.000Z | 2020-02-26T20:35:21.000Z | """
7. How to get the items not common to both series A and series B?
"""
"""
Difficulty Level: L2
"""
"""
Get all items of ser1 and ser2 not common to both.
"""
"""
Input
"""
"""
ser1 = pd.Series([1, 2, 3, 4, 5])
ser2 = pd.Series([4, 5, 6, 7, 8])
"""
# Input
ser1 = pd.Series([1, 2, 3, 4, 5])
ser2 = pd.Series([4, 5, 6... | 19.04 | 65 | 0.605042 |
ser1 = pd.Series([1, 2, 3, 4, 5])
ser2 = pd.Series([4, 5, 6, 7, 8])
ser_u = pd.Series(np.union1d(ser1, ser2))
ser_i = pd.Series(np.intersect1d(ser1, ser2))
ser_u[~ser_u.isin(ser_i)] | true | true |
f750efbbb5b0cf1eb1a685ac9c66da42caaf56ff | 4,211 | py | Python | python_modules/dagster-airflow/dagster_airflow_tests/conftest.py | xhochy/dagster | 120269fb3b29b8c5e8943624df4b971e04f59b92 | [
"Apache-2.0"
] | 1 | 2019-11-25T19:03:32.000Z | 2019-11-25T19:03:32.000Z | python_modules/dagster-airflow/dagster_airflow_tests/conftest.py | xhochy/dagster | 120269fb3b29b8c5e8943624df4b971e04f59b92 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster-airflow/dagster_airflow_tests/conftest.py | xhochy/dagster | 120269fb3b29b8c5e8943624df4b971e04f59b92 | [
"Apache-2.0"
] | null | null | null | '''Test fixtures for dagster-airflow.
These make very heavy use of fixture dependency and scope. If you're unfamiliar with pytest
fixtures, read: https://docs.pytest.org/en/latest/fixture.html.
'''
# pylint doesn't understand the way that pytest constructs fixture dependnecies
# pylint: disable=redefined-outer-name, u... | 29.65493 | 100 | 0.713607 |
# pylint: disable=redefined-outer-name, unused-argument
import os
import shutil
import subprocess
import tempfile
import uuid
import docker
import pytest
from dagster import check
from dagster.utils import load_yaml_from_path, mkdir_p, pushd, script_relative_path
# Will be set in environment by pipeline.py -> tox.i... | true | true |
f750f166d60fca9fb1e088fb51078cab27812cc5 | 453 | py | Python | Practice/Python/Strings/merge_the_tools.py | nifannn/HackerRank | b05318251226704b1fb949c29aa49493d6ced44b | [
"MIT"
] | 7 | 2019-02-22T10:34:26.000Z | 2021-07-13T01:51:48.000Z | Practice/Python/Strings/merge_the_tools.py | nifannn/HackerRank | b05318251226704b1fb949c29aa49493d6ced44b | [
"MIT"
] | null | null | null | Practice/Python/Strings/merge_the_tools.py | nifannn/HackerRank | b05318251226704b1fb949c29aa49493d6ced44b | [
"MIT"
] | 7 | 2018-11-09T13:52:34.000Z | 2021-03-18T20:36:22.000Z | def merge_the_tools(string, k):
while string:
if len(string) > k:
sub_string = string[:k]
string = string[k:]
else:
sub_string = string[:]
string = ''
s = []
for c in sub_string:
if c not in s:
s.append(c)
... | 26.647059 | 80 | 0.485651 | def merge_the_tools(string, k):
while string:
if len(string) > k:
sub_string = string[:k]
string = string[k:]
else:
sub_string = string[:]
string = ''
s = []
for c in sub_string:
if c not in s:
s.append(c)
... | true | true |
f750f2567e43c503b250e6027380974692328f34 | 1,722 | py | Python | tests/test_buffer.py | pjgao/Deep-Forest | 0fdec38b671ababfcc3476807fe512aa993d4fd4 | [
"BSD-3-Clause"
] | 1 | 2022-03-18T11:56:19.000Z | 2022-03-18T11:56:19.000Z | tests/test_buffer.py | pjgao/Deep-Forest | 0fdec38b671ababfcc3476807fe512aa993d4fd4 | [
"BSD-3-Clause"
] | null | null | null | tests/test_buffer.py | pjgao/Deep-Forest | 0fdec38b671ababfcc3476807fe512aa993d4fd4 | [
"BSD-3-Clause"
] | 1 | 2022-03-19T04:14:20.000Z | 2022-03-19T04:14:20.000Z | import os
import pytest
import numpy as np
from deepforest import _io as io
open_buffer = io.Buffer(use_buffer=True,
buffer_dir="./",
store_est=True,
store_pred=True,
store_data=True)
close_buffer = io.Buffer(use_buffer... | 28.229508 | 76 | 0.681765 | import os
import pytest
import numpy as np
from deepforest import _io as io
open_buffer = io.Buffer(use_buffer=True,
buffer_dir="./",
store_est=True,
store_pred=True,
store_data=True)
close_buffer = io.Buffer(use_buffer... | true | true |
f750f2768a2ff46a5ad67de30bfe28538e3c84ee | 110 | py | Python | neo/SmartContract/StackItemType.py | conscott/neo-python | ea794abbf941638fbe957d511614f3d66a7c2ef1 | [
"MIT"
] | 387 | 2017-07-17T18:25:54.000Z | 2021-11-18T06:19:47.000Z | neo/SmartContract/StackItemType.py | conscott/neo-python | ea794abbf941638fbe957d511614f3d66a7c2ef1 | [
"MIT"
] | 967 | 2017-08-19T15:48:03.000Z | 2021-06-01T21:42:39.000Z | neo/SmartContract/StackItemType.py | conscott/neo-python | ea794abbf941638fbe957d511614f3d66a7c2ef1 | [
"MIT"
] | 286 | 2017-07-17T03:44:36.000Z | 2021-11-18T06:19:32.000Z |
ByteArray = 0x00
Boolean = 0x01
Integer = 0x02
InteropInterface = 0x40
Array = 0x80
Struct = 0x81
Map = 0x82
| 12.222222 | 23 | 0.736364 |
ByteArray = 0x00
Boolean = 0x01
Integer = 0x02
InteropInterface = 0x40
Array = 0x80
Struct = 0x81
Map = 0x82
| true | true |
f750f346a7a1febe8a5cb41c5e2294ccd1d4c54a | 1,076 | py | Python | Leetcode/16.3sum-closest.py | EdwaRen/Competitve-Programming | e8bffeb457936d28c75ecfefb5a1f316c15a9b6c | [
"MIT"
] | 1 | 2021-05-03T21:48:25.000Z | 2021-05-03T21:48:25.000Z | Leetcode/16.3sum-closest.py | EdwaRen/Competitve_Programming | e8bffeb457936d28c75ecfefb5a1f316c15a9b6c | [
"MIT"
] | null | null | null | Leetcode/16.3sum-closest.py | EdwaRen/Competitve_Programming | e8bffeb457936d28c75ecfefb5a1f316c15a9b6c | [
"MIT"
] | null | null | null | class Solution(object):
def threeSumClosest(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: int
"""
nums = sorted(nums)
closest = abs((nums[0] + nums[1] + nums[2]) - target)
res = res = [nums[0], nums[1], nums[2]]
for i... | 28.315789 | 61 | 0.417286 | class Solution(object):
def threeSumClosest(self, nums, target):
nums = sorted(nums)
closest = abs((nums[0] + nums[1] + nums[2]) - target)
res = res = [nums[0], nums[1], nums[2]]
for i in range(len(nums)-2):
lo = i+1
hi = len(nums) - 1
while lo < h... | true | true |
f750f368d9b07934c0e0f2b399a5fb1cd4015646 | 6,121 | py | Python | w2v_server.py | jt120/w2v_server_googlenews_py3 | e3f2ac92b82928a8590b8b009e8c1e4029b3a6ab | [
"Apache-2.0"
] | null | null | null | w2v_server.py | jt120/w2v_server_googlenews_py3 | e3f2ac92b82928a8590b8b009e8c1e4029b3a6ab | [
"Apache-2.0"
] | null | null | null | w2v_server.py | jt120/w2v_server_googlenews_py3 | e3f2ac92b82928a8590b8b009e8c1e4029b3a6ab | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014 Radim Rehurek <me@radimrehurek.com>
"""
USAGE: %(program)s CONFIG
Example:
./w2v_server.py w2v_hetzner.conf
"""
from __future__ import with_statement
import os
import sys
from functools import wraps
import time
import logging
import bisect
i... | 32.73262 | 118 | 0.61771 |
from __future__ import with_statement
import os
import sys
from functools import wraps
import time
import logging
import bisect
import cherrypy
from cherrypy.process.plugins import DropPrivileges, PIDFile
import gensim
logger = logging.getLogger(__name__)
def server_exception_wrap(func):
@wraps(func)
... | true | true |
f750f381d90fa8fda8381d592ef4cca0946d7d6c | 1,595 | py | Python | src/jupyter_contrib_nbextensions/nbconvert_support/exporter_inliner.py | WTRipper/jupyter_contrib_nbextensions | 513309a6f4b72836485bc48a47c12b8ec91e2f90 | [
"BSD-3-Clause-Clear"
] | 4,439 | 2016-07-29T15:16:57.000Z | 2022-03-31T07:29:05.000Z | src/jupyter_contrib_nbextensions/nbconvert_support/exporter_inliner.py | WTRipper/jupyter_contrib_nbextensions | 513309a6f4b72836485bc48a47c12b8ec91e2f90 | [
"BSD-3-Clause-Clear"
] | 813 | 2016-07-27T23:15:35.000Z | 2022-03-26T10:22:45.000Z | src/jupyter_contrib_nbextensions/nbconvert_support/exporter_inliner.py | WTRipper/jupyter_contrib_nbextensions | 513309a6f4b72836485bc48a47c12b8ec91e2f90 | [
"BSD-3-Clause-Clear"
] | 741 | 2016-07-28T12:18:05.000Z | 2022-03-14T00:40:46.000Z | """Nbconvert exporter to inline css & js for collapsible_headings."""
from __future__ import print_function
from nbconvert.exporters.html import HTMLExporter
from traitlets import Dict
class ExporterInliner(HTMLExporter):
inliner_resources = Dict(
{'css': [], 'js': []}, config=True,
help='css a... | 33.93617 | 88 | 0.66395 |
from __future__ import print_function
from nbconvert.exporters.html import HTMLExporter
from traitlets import Dict
class ExporterInliner(HTMLExporter):
inliner_resources = Dict(
{'css': [], 'js': []}, config=True,
help='css and js scripts to wrap in html <style> or <script> tags')
def _tem... | true | true |
f750f38fe5953a5b2dd9b4ea4768b822805df42c | 451 | py | Python | src/chessnet/elo.py | nahuelalmeira/chess | 4bde6490483cfa04dfbdc43d5df3075c59c3e568 | [
"MIT"
] | null | null | null | src/chessnet/elo.py | nahuelalmeira/chess | 4bde6490483cfa04dfbdc43d5df3075c59c3e568 | [
"MIT"
] | null | null | null | src/chessnet/elo.py | nahuelalmeira/chess | 4bde6490483cfa04dfbdc43d5df3075c59c3e568 | [
"MIT"
] | null | null | null | def elo_to_category(elo: float) -> str:
if elo >= 2500:
return "IG"
elif 2400 <= elo < 2500:
return "IM"
elif 2300 <= elo < 2400:
return "FM"
elif 2200 <= elo < 2300:
return "CM"
elif 2000 <= elo < 2200:
return "E"
elif 1800 <= elo < 2200:
return "... | 23.736842 | 39 | 0.48337 | def elo_to_category(elo: float) -> str:
if elo >= 2500:
return "IG"
elif 2400 <= elo < 2500:
return "IM"
elif 2300 <= elo < 2400:
return "FM"
elif 2200 <= elo < 2300:
return "CM"
elif 2000 <= elo < 2200:
return "E"
elif 1800 <= elo < 2200:
return "... | true | true |
f750f4d43ae6cb483de558cb67ba87f25cca8e30 | 6,212 | py | Python | train.py | qwertpi/techdiff-textgen | fd7578a24e11b96d86a92d2935b6153b1bea73f8 | [
"FSFAP"
] | null | null | null | train.py | qwertpi/techdiff-textgen | fd7578a24e11b96d86a92d2935b6153b1bea73f8 | [
"FSFAP"
] | null | null | null | train.py | qwertpi/techdiff-textgen | fd7578a24e11b96d86a92d2935b6153b1bea73f8 | [
"FSFAP"
] | null | null | null | from json import dump
from math import ceil
from random import randint
import string
from keras.layers import Input, Dense, Embedding
#uncoment if using CPU
##from keras.layers import LSTM
#comment out the line bellow if using CPU
from keras.layers import CuDNNLSTM as LSTM
from keras.models import Model, load_model
fr... | 35.295455 | 135 | 0.643754 | from json import dump
from math import ceil
from random import randint
import string
from keras.layers import Input, Dense, Embedding
NNLSTM as LSTM
from keras.models import Model, load_model
from keras.metrics import categorical_accuracy
from keras.utils import to_categorical, plot_model
import numpy as np
def Data... | true | true |
f750f5e3097a73ce4cd78af080821e8ff1a34c55 | 843 | py | Python | run_tests.py | joshuacw/unit_conversions | d5738b23a5711e5b306b253872c5221565fecded | [
"MIT"
] | null | null | null | run_tests.py | joshuacw/unit_conversions | d5738b23a5711e5b306b253872c5221565fecded | [
"MIT"
] | null | null | null | run_tests.py | joshuacw/unit_conversions | d5738b23a5711e5b306b253872c5221565fecded | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import unittest
from src.convert import kilometers_to_miles, miles_to_kilometers,\
years_to_minutes, minutes_to_years
class TestConvert(unittest.TestCase):
def test_km_to_miles(self):
actual = kilometers_to_miles(1)
expected = 0.621 #from google
self.assertA... | 27.193548 | 66 | 0.686833 |
import unittest
from src.convert import kilometers_to_miles, miles_to_kilometers,\
years_to_minutes, minutes_to_years
class TestConvert(unittest.TestCase):
def test_km_to_miles(self):
actual = kilometers_to_miles(1)
expected = 0.621
self.assertAlmostEqual(actual, expected, delt... | true | true |
f750f6f7b42bb028f81a24edb2bb9e30c190578e | 671 | py | Python | contrib/LaneNet/models/__init__.py | LielinJiang/PaddleSeg | 7c4d39da3d0ff635cac066aeb61e23dfada5d0d7 | [
"Apache-2.0"
] | null | null | null | contrib/LaneNet/models/__init__.py | LielinJiang/PaddleSeg | 7c4d39da3d0ff635cac066aeb61e23dfada5d0d7 | [
"Apache-2.0"
] | null | null | null | contrib/LaneNet/models/__init__.py | LielinJiang/PaddleSeg | 7c4d39da3d0ff635cac066aeb61e23dfada5d0d7 | [
"Apache-2.0"
] | null | null | null | # coding: utf8
# copyright (c) 2019 PaddlePaddle Authors. All Rights Reserve.
#
# 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 requ... | 37.277778 | 74 | 0.767511 |
import models.modeling
| true | true |
f750f8645ec7db5888d15dbd3cea4b7667d9e040 | 7,012 | py | Python | scripts/data_utils.py | Mithrillion/BiQA | f61bea95521f5b2ffd838aa60aecaad568de6564 | [
"MIT"
] | null | null | null | scripts/data_utils.py | Mithrillion/BiQA | f61bea95521f5b2ffd838aa60aecaad568de6564 | [
"MIT"
] | null | null | null | scripts/data_utils.py | Mithrillion/BiQA | f61bea95521f5b2ffd838aa60aecaad568de6564 | [
"MIT"
] | null | null | null | import numpy as np
import re
import torch.utils.data as tud
import torch
import shutil
def get_word_ids(doc, rnn_encode=True, max_length=100,
nr_unk=100, nr_var=600, rev_dic=None, relabel=True, ent_dict=None):
queue = list(doc)
X = np.zeros(max_length, dtype='int32')
# M = np.zeros(max_le... | 38.527473 | 116 | 0.554478 | import numpy as np
import re
import torch.utils.data as tud
import torch
import shutil
def get_word_ids(doc, rnn_encode=True, max_length=100,
nr_unk=100, nr_var=600, rev_dic=None, relabel=True, ent_dict=None):
queue = list(doc)
X = np.zeros(max_length, dtype='int32')
V = np.zeros(max... | true | true |
f750f86d11454f20fc17b8943dfd53aec8e560be | 24,618 | py | Python | estimate_gaze_standalone.py | dbseorms16/drnxgaze | c7b84189c263456c648829bc399a5edb2ec17bb8 | [
"MIT"
] | 1 | 2021-07-06T02:01:54.000Z | 2021-07-06T02:01:54.000Z | estimate_gaze_standalone.py | dbseorms16/drnxgaze | c7b84189c263456c648829bc399a5edb2ec17bb8 | [
"MIT"
] | null | null | null | estimate_gaze_standalone.py | dbseorms16/drnxgaze | c7b84189c263456c648829bc399a5edb2ec17bb8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode)
from __future__ import print_function, division, absolute_import
import argparse
import os
import sys
import time
import cv2
import matplotlib.... | 44.11828 | 170 | 0.583232 |
from __future__ import print_function, division, absolute_import
import argparse
import os
import sys
import time
import cv2
import matplotlib.pyplot as plt
import numpy as np
from tqdm import tqdm
from rt_gene.extract_landmarks_method_base import LandmarkMethodBase
from rt_gene.gaze_tools import get_phi_theta_f... | true | true |
f750f88806ff7590c8c1ddd15b3b6459d566774e | 17,898 | py | Python | storage/swift.py | anwarchk/quay | 23c5120790c619174e7d36784ca5aab7f4eece5c | [
"Apache-2.0"
] | 1 | 2021-05-30T01:54:21.000Z | 2021-05-30T01:54:21.000Z | storage/swift.py | anwarchk/quay | 23c5120790c619174e7d36784ca5aab7f4eece5c | [
"Apache-2.0"
] | 20 | 2019-12-26T17:32:34.000Z | 2022-03-21T22:18:06.000Z | storage/swift.py | anwarchk/quay | 23c5120790c619174e7d36784ca5aab7f4eece5c | [
"Apache-2.0"
] | 1 | 2020-05-31T16:28:40.000Z | 2020-05-31T16:28:40.000Z | """ Swift storage driver.
Uses: http://docs.openstack.org/developer/swift/overview_large_objects.html
"""
import os.path
import copy
import hmac
import string
import logging
import json
from _pyio import BufferedReader
from collections import namedtuple
from hashlib import sha1
from random import SystemRandom
fr... | 39.685144 | 100 | 0.669796 | import os.path
import copy
import hmac
import string
import logging
import json
from _pyio import BufferedReader
from collections import namedtuple
from hashlib import sha1
from random import SystemRandom
from time import time
from urlparse import urlparse
from uuid import uuid4
from cachetools.func import lru_cache... | true | true |
f750f927632a45d2da2b9f18112507cf846cd84d | 5,128 | py | Python | shynet/analytics/views/ingress.py | MagnumDingusEdu/shynet | 2cbc5ac44170d19db0960090f073b13564840b7b | [
"Apache-2.0"
] | null | null | null | shynet/analytics/views/ingress.py | MagnumDingusEdu/shynet | 2cbc5ac44170d19db0960090f073b13564840b7b | [
"Apache-2.0"
] | 1 | 2020-08-04T04:18:39.000Z | 2020-08-04T04:18:39.000Z | shynet/analytics/views/ingress.py | MagnumDingusEdu/shynet | 2cbc5ac44170d19db0960090f073b13564840b7b | [
"Apache-2.0"
] | null | null | null | import base64
import json
from urllib.parse import urlparse
from django.conf import settings
from django.core.cache import cache
from django.core.exceptions import ValidationError
from django.http import Http404, HttpResponse, HttpResponseBadRequest
from django.shortcuts import render, reverse
from django.utils import... | 34.416107 | 92 | 0.597894 | import base64
import json
from urllib.parse import urlparse
from django.conf import settings
from django.core.cache import cache
from django.core.exceptions import ValidationError
from django.http import Http404, HttpResponse, HttpResponseBadRequest
from django.shortcuts import render, reverse
from django.utils import... | true | true |
f750fa1f1789f347d7f4343ca0f0a4c9ff0685b9 | 3,119 | py | Python | app/services/lib/config.py | tirinox/thorchainmonitorbot | 9f4604ea3c4ce91239e570b51381209096fc769f | [
"MIT"
] | 3 | 2020-10-13T16:48:35.000Z | 2021-06-02T19:11:51.000Z | app/services/lib/config.py | tirinox/thorchainmonitorbot | 9f4604ea3c4ce91239e570b51381209096fc769f | [
"MIT"
] | null | null | null | app/services/lib/config.py | tirinox/thorchainmonitorbot | 9f4604ea3c4ce91239e570b51381209096fc769f | [
"MIT"
] | 1 | 2021-02-28T19:22:18.000Z | 2021-02-28T19:22:18.000Z | import sys
import yaml
from dotenv import load_dotenv
from services.lib.constants import NetworkIdents
from services.lib.date_utils import parse_timespan_to_seconds
class SubConfig:
def __init__(self, config_data):
self._root_config = config_data
def get(self, path: str = None, default=None, pure=F... | 30.578431 | 117 | 0.597627 | import sys
import yaml
from dotenv import load_dotenv
from services.lib.constants import NetworkIdents
from services.lib.date_utils import parse_timespan_to_seconds
class SubConfig:
def __init__(self, config_data):
self._root_config = config_data
def get(self, path: str = None, default=None, pure=F... | true | true |
f750fa4d44896e47cddead0959e513e2533511ca | 737 | py | Python | LeetCode/Session3/SubarrayProdLessThanK.py | shobhitmishra/CodingProblems | 0fc8c5037eef95b3ec9826b3a6e48885fc86659e | [
"MIT"
] | null | null | null | LeetCode/Session3/SubarrayProdLessThanK.py | shobhitmishra/CodingProblems | 0fc8c5037eef95b3ec9826b3a6e48885fc86659e | [
"MIT"
] | null | null | null | LeetCode/Session3/SubarrayProdLessThanK.py | shobhitmishra/CodingProblems | 0fc8c5037eef95b3ec9826b3a6e48885fc86659e | [
"MIT"
] | null | null | null | from typing import List
class Solution:
def numSubarrayProductLessThanK(self, nums: List[int], target: int) -> int:
if not nums:
return 0
start, count, prod = 0, 0, 1
for end, num in enumerate(nums):
if num >= target:
prod = 1
start = e... | 29.48 | 88 | 0.511533 | from typing import List
class Solution:
def numSubarrayProductLessThanK(self, nums: List[int], target: int) -> int:
if not nums:
return 0
start, count, prod = 0, 0, 1
for end, num in enumerate(nums):
if num >= target:
prod = 1
start = e... | true | true |
f750fac6efc404f5984f93c568dde3c3576b06ed | 4,613 | py | Python | Source/devtools/scripts/concatenate_application_code.py | crosswalk-project/blink-crosswalk-efl | cb6e853ed11c2aaffb73ca91c11e70e5bb29a0dd | [
"BSD-3-Clause"
] | 2 | 2016-05-19T10:37:25.000Z | 2019-09-18T04:37:14.000Z | Source/devtools/scripts/concatenate_application_code.py | crosswalk-project/blink-crosswalk-efl | cb6e853ed11c2aaffb73ca91c11e70e5bb29a0dd | [
"BSD-3-Clause"
] | null | null | null | Source/devtools/scripts/concatenate_application_code.py | crosswalk-project/blink-crosswalk-efl | cb6e853ed11c2aaffb73ca91c11e70e5bb29a0dd | [
"BSD-3-Clause"
] | 7 | 2015-09-23T09:56:29.000Z | 2022-01-20T10:36:06.000Z | #!/usr/bin/env python
#
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Concatenates autostart modules, application modules' module.json descriptors,
and the application loader into a single script.
Al... | 40.464912 | 131 | 0.715803 |
from cStringIO import StringIO
from os import path
from modular_build import read_file, write_file, bail_error
import modular_build
import os
import sys
try:
import simplejson as json
except ImportError:
import json
rjsmin_path = os.path.abspath(os.path.join(
os.path.dirname(__file__),
"..",
... | true | true |
f750fb29ea9197bae9fbd8f2c7df180c9445caeb | 6,455 | py | Python | tests/test_run.py | dolfinus/pexpect | 3453ea9b8b326179cf720351001e64c7ea6b07bc | [
"0BSD"
] | 2,132 | 2015-01-02T12:48:45.000Z | 2022-03-28T05:32:54.000Z | tests/test_run.py | dolfinus/pexpect | 3453ea9b8b326179cf720351001e64c7ea6b07bc | [
"0BSD"
] | 536 | 2015-01-02T19:42:34.000Z | 2022-03-10T16:40:35.000Z | tests/test_run.py | dolfinus/pexpect | 3453ea9b8b326179cf720351001e64c7ea6b07bc | [
"0BSD"
] | 517 | 2015-01-07T02:09:44.000Z | 2022-03-26T14:18:23.000Z | #!/usr/bin/env python
# encoding: utf-8
'''
PEXPECT LICENSE
This license is approved by the OSI and FSF as GPL-compatible.
http://opensource.org/licenses/isc-license.txt
Copyright (c) 2012, Noah Spurrier <noah@noah.org>
PERMISSION TO USE, COPY, MODIFY, AND/OR DISTRIBUTE THIS SOFTWARE FOR ANY
P... | 33.619792 | 89 | 0.588691 |
import pexpect
import unittest
import subprocess
import tempfile
import sys
import os
from . import PexpectTestCase
unicode_type = str if pexpect.PY3 else unicode
def timeout_callback(values):
if values["event_count"] > 3:
return 1
return 0
def function_events_callback(values):
try:
p... | true | true |
f750fb306b26fde34c89ec0df67fc14db94a6114 | 686 | py | Python | tests/test_source_modules/wctest/__init__.py | tallpauley/wordsiv | 935e6a08cd39134b7408b67d6ff721830d03a5ec | [
"MIT"
] | 1 | 2022-03-25T19:31:00.000Z | 2022-03-25T19:31:00.000Z | tests/test_source_modules/wctest/__init__.py | tallpauley/wordsiv | 935e6a08cd39134b7408b67d6ff721830d03a5ec | [
"MIT"
] | 19 | 2021-05-09T15:49:35.000Z | 2021-07-01T15:56:44.000Z | tests/test_source_modules/wctest/__init__.py | tallpauley/wordsiv | 935e6a08cd39134b7408b67d6ff721830d03a5ec | [
"MIT"
] | null | null | null | from wordsiv.sentence_models_sources import WordCountSource, RandomModel
from pathlib import Path
import json
# Assuming installed as directory (zip_safe=False)
HERE = Path(__file__).parent.absolute()
with open(HERE / "meta.json", "r") as f:
meta = json.load(f)
# Sources should always be prefixed with the packa... | 28.583333 | 80 | 0.682216 | from wordsiv.sentence_models_sources import WordCountSource, RandomModel
from pathlib import Path
import json
HERE = Path(__file__).parent.absolute()
with open(HERE / "meta.json", "r") as f:
meta = json.load(f)
sources = {
"wctest": {
"source": WordCountSource(HERE / "data" / "count-source.txt", ... | true | true |
f750fb61e25e2082495fcd8627be095640138da3 | 8,823 | py | Python | qa/rpc-tests/import-rescan.py | maxmelorj/axe | 1ddc04568573f37f6658eb5a47fac03d78fe7c52 | [
"MIT"
] | 1 | 2018-11-20T15:53:13.000Z | 2018-11-20T15:53:13.000Z | qa/rpc-tests/import-rescan.py | maxmelorj/axe | 1ddc04568573f37f6658eb5a47fac03d78fe7c52 | [
"MIT"
] | null | null | null | qa/rpc-tests/import-rescan.py | maxmelorj/axe | 1ddc04568573f37f6658eb5a47fac03d78fe7c52 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test rescan behavior of importaddress, importpubkey, importprivkey, and
importmulti RPCs with different... | 47.181818 | 116 | 0.653633 |
from test_framework.authproxy import JSONRPCException
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (start_nodes, connect_nodes, sync_blocks, assert_equal, set_node_times)
from decimal import Decimal
import collections
import enum
import itertools
Call = enum.Enum... | true | true |
f750fd5632825cabea9ab237dd849f550eeab552 | 1,127 | py | Python | google/ads/googleads/v10/services/services/conversion_custom_variable_service/transports/__init__.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v10/services/services/conversion_custom_variable_service/transports/__init__.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v10/services/services/conversion_custom_variable_service/transports/__init__.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 35.21875 | 74 | 0.787045 |
from collections import OrderedDict
from typing import Dict, Type
from .base import ConversionCustomVariableServiceTransport
from .grpc import ConversionCustomVariableServiceGrpcTransport
_transport_registry = (
OrderedDict()
)
_transport_registry["grpc"] = ConversionCustomVariableServiceGrpcTra... | true | true |
f750fda1a6e9c0b46eba13afb00e75619a227305 | 2,142 | py | Python | tests/test_interactor_finder.py | e-bel/drugintfinder | 497a09bc86a12180ccdbb5a8314f03f0a4957cdc | [
"MIT"
] | null | null | null | tests/test_interactor_finder.py | e-bel/drugintfinder | 497a09bc86a12180ccdbb5a8314f03f0a4957cdc | [
"MIT"
] | null | null | null | tests/test_interactor_finder.py | e-bel/drugintfinder | 497a09bc86a12180ccdbb5a8314f03f0a4957cdc | [
"MIT"
] | null | null | null | """Tests for `InteractorFinder` class."""
import pandas as pd
from drugintfinder.finder import InteractorFinder
from .constants import MAPT, PROTEIN, PHOSPHORYLATION, CAUSAL
finder = InteractorFinder(symbol=MAPT, pmods=[PHOSPHORYLATION], edge=CAUSAL)
class TestInteractorFinder:
"""Tests for the InteractorFinde... | 36.305085 | 117 | 0.655929 | import pandas as pd
from drugintfinder.finder import InteractorFinder
from .constants import MAPT, PROTEIN, PHOSPHORYLATION, CAUSAL
finder = InteractorFinder(symbol=MAPT, pmods=[PHOSPHORYLATION], edge=CAUSAL)
class TestInteractorFinder:
def test_find_interactors(self):
finder.find_interactors(target_t... | true | true |
f750fe262b4f79415d003a5b51c34d53766afe98 | 6,949 | py | Python | restui/serializers/ensembl.py | brjones/gifts_rest | 8217e45fd1a692b00c9e9ae9f022ac2d2fab211e | [
"Apache-2.0"
] | null | null | null | restui/serializers/ensembl.py | brjones/gifts_rest | 8217e45fd1a692b00c9e9ae9f022ac2d2fab211e | [
"Apache-2.0"
] | 7 | 2018-09-05T10:53:44.000Z | 2022-03-08T09:36:14.000Z | restui/serializers/ensembl.py | brjones/gifts_rest | 8217e45fd1a692b00c9e9ae9f022ac2d2fab211e | [
"Apache-2.0"
] | 8 | 2018-09-03T14:29:28.000Z | 2020-07-30T12:54:04.000Z | """
.. See the NOTICE file distributed with this work for additional information
regarding copyright ownership.
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.... | 37.972678 | 92 | 0.742409 |
from itertools import chain
from django.utils import timezone
from rest_framework import serializers
from restui.tasks import bulk_upload_task
from restui.models.ensembl import EnsemblTranscript
from restui.models.ensembl import EnsemblSpeciesHistory
from restui.models.ensembl import EnspUCigar
class EnsemblTranscr... | true | true |
f750ff03bbc2a2411b9b09d88958e4ffc6edbed2 | 6,955 | py | Python | jaxlib/pocketfft.py | mbmccoy/jax | 74346f464bc8369d81964305fcf05f95f43fb2d3 | [
"Apache-2.0"
] | null | null | null | jaxlib/pocketfft.py | mbmccoy/jax | 74346f464bc8369d81964305fcf05f95f43fb2d3 | [
"Apache-2.0"
] | null | null | null | jaxlib/pocketfft.py | mbmccoy/jax | 74346f464bc8369d81964305fcf05f95f43fb2d3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 36.413613 | 80 | 0.70913 |
import importlib.util
from typing import List
import jaxlib.mlir.ir as ir
import jaxlib.mlir.dialects.mhlo as mhlo
from . import _pocketfft
from . import pocketfft_flatbuffers_py_generated as pd
import numpy as np
import flatbuffers
from jaxlib import xla_client
for _name, _value in _pocketfft.reg... | true | true |
f750fff1a442d3fd7eff7f0946d5683564bf0109 | 13,035 | py | Python | examples/sensors-python/sensors_streams.py | bsc-wdc/distro-stream-lib | 3e1d6a0d5f0b785043992b25e9b6167cf7d644b1 | [
"Apache-2.0"
] | 1 | 2019-09-17T13:36:05.000Z | 2019-09-17T13:36:05.000Z | examples/sensors-python/sensors_streams.py | cristianrcv/distro-stream-lib | d6c048fa26592fe0504c2cfb95afe5f5eb29d042 | [
"Apache-2.0"
] | 2 | 2021-12-10T01:23:10.000Z | 2021-12-14T21:33:17.000Z | examples/sensors-python/sensors_streams.py | cristianrcv/distro-stream-lib | d6c048fa26592fe0504c2cfb95afe5f5eb29d042 | [
"Apache-2.0"
] | 1 | 2021-12-13T15:41:17.000Z | 2021-12-13T15:41:17.000Z | #!/usr/bin/python
#
# Copyright 2002-2019 Barcelona Supercomputing Center (www.bsc.es)
#
# 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
... | 31.870416 | 118 | 0.670426 |
from __future__ import print_function
from pycompss.api.task import task
from pycompss.api.constraint import constraint
from pycompss.api.parameter import STREAM_IN
from pycompss.api.parameter import STREAM_OUT
from pycompss.api.parameter import INOUT
from pycompss.api.api import compss_wait_on
f... | true | true |
f751009df47057bacc6d0fbf6d1ab04c87998a96 | 3,617 | py | Python | sc2/paths.py | Matuiss2/python-sc2 | dd93215d8b09b7ddacfd5c3cc4e9f43641d3f953 | [
"MIT"
] | 3 | 2019-01-20T19:37:25.000Z | 2019-01-29T10:21:48.000Z | sc2/paths.py | Matuiss2/python-sc2 | dd93215d8b09b7ddacfd5c3cc4e9f43641d3f953 | [
"MIT"
] | 1 | 2019-02-13T06:42:26.000Z | 2019-03-11T14:04:43.000Z | sc2/paths.py | Matuiss2/python-sc2 | dd93215d8b09b7ddacfd5c3cc4e9f43641d3f953 | [
"MIT"
] | 1 | 2019-02-13T05:44:16.000Z | 2019-02-13T05:44:16.000Z | import logging
import os
import platform
import re
import subprocess
from pathlib import Path
logger = logging.getLogger(__name__)
BASEDIR = {
"Windows": "C:/Program Files (x86)/StarCraft II",
"Darwin": "/Applications/StarCraft II",
"Linux": "~/StarCraftII",
"WineLinux": "~/.wine/drive_c/Program Files... | 31.72807 | 118 | 0.570086 | import logging
import os
import platform
import re
import subprocess
from pathlib import Path
logger = logging.getLogger(__name__)
BASEDIR = {
"Windows": "C:/Program Files (x86)/StarCraft II",
"Darwin": "/Applications/StarCraft II",
"Linux": "~/StarCraftII",
"WineLinux": "~/.wine/drive_c/Program Files... | true | true |
f75100ccf8b22c124c278c9f27a44949f6cacd11 | 2,635 | py | Python | tests/test_ops/test_bbox.py | Qiza-lyhm/mmcv-1 | 362a90f8bfffe62d5802925944f540ed16b2731e | [
"Apache-2.0"
] | null | null | null | tests/test_ops/test_bbox.py | Qiza-lyhm/mmcv-1 | 362a90f8bfffe62d5802925944f540ed16b2731e | [
"Apache-2.0"
] | null | null | null | tests/test_ops/test_bbox.py | Qiza-lyhm/mmcv-1 | 362a90f8bfffe62d5802925944f540ed16b2731e | [
"Apache-2.0"
] | null | null | null | # Copyright (c) OpenMMLab. All rights reserved.
import numpy as np
import pytest
import torch
from mmcv.device.mlu import IS_MLU_AVAILABLE
from mmcv.utils import IS_CUDA_AVAILABLE
class TestBBox(object):
def _test_bbox_overlaps(self, device, dtype=torch.float):
from mmcv.ops import bbox_overlaps
... | 41.825397 | 79 | 0.526376 |
import numpy as np
import pytest
import torch
from mmcv.device.mlu import IS_MLU_AVAILABLE
from mmcv.utils import IS_CUDA_AVAILABLE
class TestBBox(object):
def _test_bbox_overlaps(self, device, dtype=torch.float):
from mmcv.ops import bbox_overlaps
b1 = torch.tensor([[1.0, 1.0, 3.0, 4.0], [2.0,... | true | true |
f75103588a88b79b20164f71f687534755b24d95 | 3,131 | py | Python | int16_version/tensorflow_mnist/mnist_int16.py | ZenanLin1999/FPGA_accerator_with_mnist_dataset | 1db3d698ebe3cf57050af9465e0b83ffef717d25 | [
"MIT"
] | null | null | null | int16_version/tensorflow_mnist/mnist_int16.py | ZenanLin1999/FPGA_accerator_with_mnist_dataset | 1db3d698ebe3cf57050af9465e0b83ffef717d25 | [
"MIT"
] | null | null | null | int16_version/tensorflow_mnist/mnist_int16.py | ZenanLin1999/FPGA_accerator_with_mnist_dataset | 1db3d698ebe3cf57050af9465e0b83ffef717d25 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import input_data
import tensorflow as tf
import numpy as np
from tf_fix import *
mnist = input_data.read_data_sets('MNIST_data', one_hot=True)
sess = tf.InteractiveSession()
with tf.name_scope('input'):
x = tf.placeholder("float", shape=[None, 784])
y_ = tf.placeholder("float", shape=[None... | 35.179775 | 112 | 0.696583 |
import input_data
import tensorflow as tf
import numpy as np
from tf_fix import *
mnist = input_data.read_data_sets('MNIST_data', one_hot=True)
sess = tf.InteractiveSession()
with tf.name_scope('input'):
x = tf.placeholder("float", shape=[None, 784])
y_ = tf.placeholder("float", shape=[None, 10])
def weight_vari... | true | true |
f7510368905d52d274bdf6ce3ff670c4c227f313 | 448 | py | Python | voice_based_email/mysite/homepage/urls.py | Ryuk07/JARVIS_Voice-Based-Email-System | 0cb64a684f59f229b93a32e3a3cd2969520395b3 | [
"Apache-2.0"
] | 5 | 2021-05-12T13:23:27.000Z | 2022-01-29T03:48:08.000Z | voice_based_email/mysite/homepage/urls.py | Ryuk07/JARVIS_Voice-Based-Email-System | 0cb64a684f59f229b93a32e3a3cd2969520395b3 | [
"Apache-2.0"
] | null | null | null | voice_based_email/mysite/homepage/urls.py | Ryuk07/JARVIS_Voice-Based-Email-System | 0cb64a684f59f229b93a32e3a3cd2969520395b3 | [
"Apache-2.0"
] | 1 | 2021-12-26T16:07:09.000Z | 2021-12-26T16:07:09.000Z | from django.conf.urls import url, include
from . import views
app_name = 'homepage'
urlpatterns = [
url(r'^$', views.login_view, name="login"),
url(r'^compose/$', views.compose_view, name="compose"),
url(r'^inbox/$', views.inbox_view, name="inbox"),
url(r'^sent/$', views.sent_view, name="sent... | 29.866667 | 60 | 0.620536 | from django.conf.urls import url, include
from . import views
app_name = 'homepage'
urlpatterns = [
url(r'^$', views.login_view, name="login"),
url(r'^compose/$', views.compose_view, name="compose"),
url(r'^inbox/$', views.inbox_view, name="inbox"),
url(r'^sent/$', views.sent_view, name="sent... | true | true |
f751044e28cb4bad581409c61f6d9e220bf09d27 | 3,184 | py | Python | setup.py | unicef/etools-permissions | 7a6da87c9829290af3cea458314e60dd6d1239fd | [
"Apache-2.0"
] | null | null | null | setup.py | unicef/etools-permissions | 7a6da87c9829290af3cea458314e60dd6d1239fd | [
"Apache-2.0"
] | null | null | null | setup.py | unicef/etools-permissions | 7a6da87c9829290af3cea458314e60dd6d1239fd | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import ast
import codecs
import os.path
import re
import subprocess
import sys
from codecs import open
from distutils import log
from distutils.errors import DistutilsError
from setuptools import find_packages, setup
from setuptools.command.install import install
from setu... | 31.524752 | 139 | 0.617148 |
import ast
import codecs
import os.path
import re
import subprocess
import sys
from codecs import open
from distutils import log
from distutils.errors import DistutilsError
from setuptools import find_packages, setup
from setuptools.command.install import install
from setuptools.command.sdist import sdist as BaseSDi... | true | true |
f75104c00eb0bf43776a1fee81f24e4e7df595d6 | 80,035 | py | Python | neutron/db/db_base_plugin_v2.py | downcome13/neutron | ac1691d157509959b85359f8dd1d7e436e6e23ec | [
"Apache-2.0"
] | null | null | null | neutron/db/db_base_plugin_v2.py | downcome13/neutron | ac1691d157509959b85359f8dd1d7e436e6e23ec | [
"Apache-2.0"
] | null | null | null | neutron/db/db_base_plugin_v2.py | downcome13/neutron | ac1691d157509959b85359f8dd1d7e436e6e23ec | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2012 OpenStack Foundation.
# 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... | 47.78209 | 79 | 0.604186 |
import functools
import netaddr
from neutron_lib.api.definitions import ip_allocation as ipalloc_apidef
from neutron_lib.api.definitions import port as port_def
from neutron_lib.api.definitions import portbindings as portbindings_def
from neutron_lib.api.definitions import subnetpool as subnetpool_def
f... | true | true |
f7510691027ef90063d8d3a7ac3e1f9b2b46764a | 1,770 | py | Python | storage/storage.py | np-overflow/bytehackz-discord-bot | 1fb304826a474c5268c0adc684953603b6a2ab64 | [
"MIT"
] | null | null | null | storage/storage.py | np-overflow/bytehackz-discord-bot | 1fb304826a474c5268c0adc684953603b6a2ab64 | [
"MIT"
] | null | null | null | storage/storage.py | np-overflow/bytehackz-discord-bot | 1fb304826a474c5268c0adc684953603b6a2ab64 | [
"MIT"
] | null | null | null | import datetime
import os
from pathlib import Path
import attr
import orjson
from dis_snek.mixins.serialization import DictSerializationMixin
from storage.genius import Genius
from storage.nerf import Nerf
@attr.s(slots=True)
class Container(DictSerializationMixin):
nerf: Nerf = attr.ib(factory=dict, converter=... | 32.181818 | 142 | 0.679096 | import datetime
import os
from pathlib import Path
import attr
import orjson
from dis_snek.mixins.serialization import DictSerializationMixin
from storage.genius import Genius
from storage.nerf import Nerf
@attr.s(slots=True)
class Container(DictSerializationMixin):
nerf: Nerf = attr.ib(factory=dict, converter=... | true | true |
f75106cd522e2e18570249d9ce40db656357a4ba | 3,072 | py | Python | src/doddle/graph.py | CatchemAL/Doddle | 0c2ed8b91f998da645d97160d46178c2dab15c9e | [
"MIT"
] | 3 | 2022-02-03T11:50:41.000Z | 2022-02-14T09:25:35.000Z | src/doddle/graph.py | CatchemAl/Doddle | 0c2ed8b91f998da645d97160d46178c2dab15c9e | [
"MIT"
] | 5 | 2022-03-17T07:38:36.000Z | 2022-03-30T02:33:33.000Z | src/doddle/graph.py | CatchemAL/Doddle | 0c2ed8b91f998da645d97160d46178c2dab15c9e | [
"MIT"
] | 2 | 2022-02-06T15:36:29.000Z | 2022-02-06T23:48:57.000Z | from typing import TYPE_CHECKING, Iterable
from .boards import Scoreboard
if TYPE_CHECKING:
from graphviz import Digraph # type: ignore # pragma: no cover
GREY = "#787c7e"
YELLOW = "#c9b458"
GREEN = "#6aaa64"
class GraphBuilder:
def __init__(self, scoreboards: Iterable[Scoreboard]) -> None:
self.... | 29.825243 | 101 | 0.542969 | from typing import TYPE_CHECKING, Iterable
from .boards import Scoreboard
if TYPE_CHECKING:
from graphviz import Digraph "
YELLOW = "#c9b458"
GREEN = "#6aaa64"
class GraphBuilder:
def __init__(self, scoreboards: Iterable[Scoreboard]) -> None:
self.color_by_score = [GREY, YELLOW, GREEN]
self... | true | true |
f7510702bc88391a6948b01811b2f447037f90f5 | 4,529 | py | Python | sample_coloring.py | granatumx/gbox-py | b3e264a22bc6a041f2dd631d952eae29c0ecae21 | [
"MIT"
] | null | null | null | sample_coloring.py | granatumx/gbox-py | b3e264a22bc6a041f2dd631d952eae29c0ecae21 | [
"MIT"
] | 1 | 2020-06-16T17:14:45.000Z | 2020-06-16T17:14:45.000Z | sample_coloring.py | granatumx/gbox-py | b3e264a22bc6a041f2dd631d952eae29c0ecae21 | [
"MIT"
] | 2 | 2020-06-16T16:42:40.000Z | 2020-08-28T16:59:42.000Z | #!/usr/bin/env python
import math
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy.spatial import ConvexHull
from colour import Color
from matplotlib.patches import Polygon
import statistics as st
from granatum_sdk import Granatum
COLORS = ["#3891ea", "#29ad19", "#ac2d58", "#db7580",... | 38.709402 | 182 | 0.52219 |
import math
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy.spatial import ConvexHull
from colour import Color
from matplotlib.patches import Polygon
import statistics as st
from granatum_sdk import Granatum
COLORS = ["#3891ea", "#29ad19", "#ac2d58", "#db7580", "#ed2310", "#ca2dc2"... | true | true |
f7510794a3ccdbc4aa28e4673c3350220451b458 | 14,217 | py | Python | model/new_models.py | Bheshaj-Kumar/Transformer-Grapheme-to-Phoneme-Conversion | cc1ff53498cf9d178e1880b5d074ec91559ac95a | [
"MIT"
] | null | null | null | model/new_models.py | Bheshaj-Kumar/Transformer-Grapheme-to-Phoneme-Conversion | cc1ff53498cf9d178e1880b5d074ec91559ac95a | [
"MIT"
] | null | null | null | model/new_models.py | Bheshaj-Kumar/Transformer-Grapheme-to-Phoneme-Conversion | cc1ff53498cf9d178e1880b5d074ec91559ac95a | [
"MIT"
] | null | null | null | import sys
import numpy as np
import tensorflow as tf
from model.transformer_utils import create_encoder_padding_mask, create_mel_padding_mask, create_look_ahead_mask
#from preprocessing.text import Pipeline
from model.layers import PreBottleNeckDecoder, Encoder, Decoder, SpeakerModule
from utils.losses import model_lo... | 45.421725 | 224 | 0.610115 | import sys
import numpy as np
import tensorflow as tf
from model.transformer_utils import create_encoder_padding_mask, create_mel_padding_mask, create_look_ahead_mask
from model.layers import PreBottleNeckDecoder, Encoder, Decoder, SpeakerModule
from utils.losses import model_loss, crossentropy_loss
import data_utils ... | true | true |
f751086f09d3d1f438e80cde14c102827997caf9 | 1,694 | py | Python | lcmtype/lilylcm/L05Ebola.py | WeirdCoder/LilyPadOS | 8007257746939de3221ebbeb6b03bfd4352a7ff2 | [
"MIT"
] | null | null | null | lcmtype/lilylcm/L05Ebola.py | WeirdCoder/LilyPadOS | 8007257746939de3221ebbeb6b03bfd4352a7ff2 | [
"MIT"
] | null | null | null | lcmtype/lilylcm/L05Ebola.py | WeirdCoder/LilyPadOS | 8007257746939de3221ebbeb6b03bfd4352a7ff2 | [
"MIT"
] | null | null | null | """LCM type definitions
This file automatically generated by lcm.
DO NOT MODIFY BY HAND!!!!
"""
try:
import cStringIO.StringIO as BytesIO
except ImportError:
from io import BytesIO
import struct
class L05Ebola(object):
__slots__ = ["cured"]
def __init__(self):
self.cured = False
def enco... | 29.206897 | 94 | 0.657025 |
try:
import cStringIO.StringIO as BytesIO
except ImportError:
from io import BytesIO
import struct
class L05Ebola(object):
__slots__ = ["cured"]
def __init__(self):
self.cured = False
def encode(self):
buf = BytesIO()
buf.write(L05Ebola._get_packed_fingerprint())
... | true | true |
f751087e29eb0ddfc92f6a4a86ac083fa168b7ae | 4,692 | py | Python | python/paddle/distributed/auto_parallel/process_mesh.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | 11 | 2016-08-29T07:43:26.000Z | 2016-08-29T07:51:24.000Z | python/paddle/distributed/auto_parallel/process_mesh.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | null | null | null | python/paddle/distributed/auto_parallel/process_mesh.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | 1 | 2021-12-09T08:59:17.000Z | 2021-12-09T08:59:17.000Z | # Copyright (c) 2021 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... | 33.276596 | 98 | 0.645141 |
import numpy
import copy
def _get_nested_list_shape(nested_list):
result = []
while isinstance(nested_list, list):
result.append(len(nested_list))
nested_list = nested_list[0]
return result
def _flatten_nested_list(nested_list):
result = numpy.array(nested_list).flatten... | true | true |
f7510917c531028cdc2a3b2f96098d6833ccdc4d | 2,269 | py | Python | tests/apis/__init__.py | a-wakeel/Device-Registration-Subsystem | dd9fa387e2087a6ccea9676303debe640bd99422 | [
"Unlicense"
] | 6 | 2018-11-07T12:41:30.000Z | 2020-04-12T18:07:03.000Z | tests/apis/__init__.py | a-wakeel/Device-Registration-Subsystem | dd9fa387e2087a6ccea9676303debe640bd99422 | [
"Unlicense"
] | 1 | 2020-10-20T12:33:18.000Z | 2020-10-20T12:33:18.000Z | tests/apis/__init__.py | a-wakeel/Device-Registration-Subsystem | dd9fa387e2087a6ccea9676303debe640bd99422 | [
"Unlicense"
] | 10 | 2018-11-12T06:15:19.000Z | 2021-11-18T05:45:12.000Z | """
DRS Package for API unit tests
Copyright (c) 2018-2020 Qualcomm Technologies, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions are met:
Redistribu... | 126.055556 | 844 | 0.806523 | from tests.apis import *
| true | true |
f7510a6a0e9c0507795226c04ea7d84dd8aa3a7e | 3,365 | py | Python | python/cugraph/cugraph/link_analysis/hits.py | bdice/cugraph | b89eb185ead33a8aec111ef0135682d421f7ce85 | [
"Apache-2.0"
] | null | null | null | python/cugraph/cugraph/link_analysis/hits.py | bdice/cugraph | b89eb185ead33a8aec111ef0135682d421f7ce85 | [
"Apache-2.0"
] | null | null | null | python/cugraph/cugraph/link_analysis/hits.py | bdice/cugraph | b89eb185ead33a8aec111ef0135682d421f7ce85 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2019-2021, NVIDIA CORPORATION.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | 36.978022 | 77 | 0.678158 |
from cugraph.link_analysis import hits_wrapper
from cugraph.utilities import check_nx_graph
from cugraph.utilities import df_score_to_dictionary
def hits(G, max_iter=100, tol=1.0e-5, nstart=None, normalized=True):
G, isNx = check_nx_graph(G)
df = hits_wrapper.hits(G, max_iter, tol)
if G.re... | true | true |
f7510b6119efd50b0073993842667f1b9377bd18 | 32,510 | py | Python | recaptcha_manager/services.py | charxhit/recaptcha-manager | 18d49653483c77a510e78acf7ed804899c962915 | [
"MIT"
] | 6 | 2021-12-02T22:47:27.000Z | 2022-01-22T17:06:38.000Z | recaptcha_manager/services.py | charxhit/recaptcha-manager | 18d49653483c77a510e78acf7ed804899c962915 | [
"MIT"
] | null | null | null | recaptcha_manager/services.py | charxhit/recaptcha-manager | 18d49653483c77a510e78acf7ed804899c962915 | [
"MIT"
] | null | null | null | from pickle import PicklingError
from abc import abstractmethod, ABC
from requests_futures.sessions import FuturesSession
from concurrent.futures._base import Future
import multiprocess
import recaptcha_manager
from recaptcha_manager.exceptions import LowBidError, NoBalanceError, BadDomainError, BadAPIKeyError, BadSite... | 47.252907 | 145 | 0.607321 | from pickle import PicklingError
from abc import abstractmethod, ABC
from requests_futures.sessions import FuturesSession
from concurrent.futures._base import Future
import multiprocess
import recaptcha_manager
from recaptcha_manager.exceptions import LowBidError, NoBalanceError, BadDomainError, BadAPIKeyError, BadSite... | true | true |
f7510bb9c52ae6cd7c0c469a54fa68c5b71cc587 | 3,634 | py | Python | ProsperFlask-deb/{{cookiecutter.project_name}}/setup.py | EVEprosper/ProsperCookiecutters | 569ca0c311a5ead2b49f0cdde4cb2ad14dcd3a2c | [
"MIT"
] | null | null | null | ProsperFlask-deb/{{cookiecutter.project_name}}/setup.py | EVEprosper/ProsperCookiecutters | 569ca0c311a5ead2b49f0cdde4cb2ad14dcd3a2c | [
"MIT"
] | null | null | null | ProsperFlask-deb/{{cookiecutter.project_name}}/setup.py | EVEprosper/ProsperCookiecutters | 569ca0c311a5ead2b49f0cdde4cb2ad14dcd3a2c | [
"MIT"
] | null | null | null | """Setup.py for ProsperAPI Flask project"""
from os import path, listdir
import importlib
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
HERE = path.abspath(path.dirname(__file__))
def include_all_subfiles(*args):
"""Slurps up all files in a directory (non rec... | 27.953846 | 125 | 0.5776 |
from os import path, listdir
import importlib
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
HERE = path.abspath(path.dirname(__file__))
def include_all_subfiles(*args):
file_list = []
for path_included in args:
local_path = path.join(HERE, path_in... | true | true |
f7510bfbce700152d02c62253717826539faadd0 | 1,542 | py | Python | scripts/compile_mjml.py | whiteowl3/jfa-go | cebde9d4c05d77bbaaec2ab623f2c95d972ca88b | [
"MIT"
] | 189 | 2020-08-02T19:57:53.000Z | 2022-03-29T10:29:35.000Z | scripts/compile_mjml.py | whiteowl3/jfa-go | cebde9d4c05d77bbaaec2ab623f2c95d972ca88b | [
"MIT"
] | 145 | 2020-09-05T03:59:14.000Z | 2022-03-26T18:21:25.000Z | scripts/compile_mjml.py | whiteowl3/jfa-go | cebde9d4c05d77bbaaec2ab623f2c95d972ca88b | [
"MIT"
] | 22 | 2020-11-11T09:31:03.000Z | 2022-03-24T19:55:15.000Z | import subprocess
import shutil
import os
import argparse
from pathlib import Path
from threading import Thread
parser = argparse.ArgumentParser()
parser.add_argument("-o", "--output", help="output directory for .html and .txt files")
args = parser.parse_args()
def runcmd(cmd):
if os.name == "nt":
return... | 29.09434 | 98 | 0.666667 | import subprocess
import shutil
import os
import argparse
from pathlib import Path
from threading import Thread
parser = argparse.ArgumentParser()
parser.add_argument("-o", "--output", help="output directory for .html and .txt files")
args = parser.parse_args()
def runcmd(cmd):
if os.name == "nt":
return... | true | true |
f7510dd2f5b54428010a2ad39851b58c5537c047 | 4,968 | py | Python | maze/plotfigure.py | cvanoort/differentiable-plasticity | 28c53765ed38f80fd5a5c49e3e62a0e6555eb669 | [
"Apache-2.0"
] | null | null | null | maze/plotfigure.py | cvanoort/differentiable-plasticity | 28c53765ed38f80fd5a5c49e3e62a0e6555eb669 | [
"Apache-2.0"
] | null | null | null | maze/plotfigure.py | cvanoort/differentiable-plasticity | 28c53765ed38f80fd5a5c49e3e62a0e6555eb669 | [
"Apache-2.0"
] | null | null | null | # Code for making a figure
#
# Copyright (c) 2018 Uber Technologies, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 32.470588 | 139 | 0.628623 |
import numpy as np
import glob
import matplotlib.pyplot as plt
import scipy
from scipy import stats
colorz = ['r', 'b', 'g', 'c', 'm', 'y', 'orange', 'k']
groupnames = glob.glob('./loss_*rngseed_0.txt')
plt.rc('font', size=14)
def mavg(x, N):
cumsum = np.cumsum(np.insert(x, 0, 0))
return (... | true | true |
f7510e2e57e70b9bdc54e35893fb2f16f92ff9d7 | 1,917 | py | Python | tests/integration/import.py | doraskayo/buildstream | 1c72d4342ae7df360808de22c5e49f55dbb6bec6 | [
"Apache-2.0"
] | null | null | null | tests/integration/import.py | doraskayo/buildstream | 1c72d4342ae7df360808de22c5e49f55dbb6bec6 | [
"Apache-2.0"
] | null | null | null | tests/integration/import.py | doraskayo/buildstream | 1c72d4342ae7df360808de22c5e49f55dbb6bec6 | [
"Apache-2.0"
] | null | null | null | # Pylint doesn't play well with fixtures and dependency injection from pytest
# pylint: disable=redefined-outer-name
import os
import pytest
from buildstream import _yaml
from buildstream.testing import cli_integration as cli # pylint: disable=unused-import
from buildstream.testing.integration import walk_dir
pyt... | 32.491525 | 98 | 0.651539 |
# pylint: disable=redefined-outer-name
import os
import pytest
from buildstream import _yaml
from buildstream.testing import cli_integration as cli # pylint: disable=unused-import
from buildstream.testing.integration import walk_dir
pytestmark = pytest.mark.integration
DATA_DIR = os.path.join(os.path.dirname(o... | true | true |
f7510e6623e98b51d35b4913771fb7b9ec054c3d | 11,997 | py | Python | lib/pyexcel/pyexcel/filters.py | tinygg/QQ-Groups-Spider | a161282c6832ed40183905e96205edb5a57e8a05 | [
"MIT"
] | null | null | null | lib/pyexcel/pyexcel/filters.py | tinygg/QQ-Groups-Spider | a161282c6832ed40183905e96205edb5a57e8a05 | [
"MIT"
] | null | null | null | lib/pyexcel/pyexcel/filters.py | tinygg/QQ-Groups-Spider | a161282c6832ed40183905e96205edb5a57e8a05 | [
"MIT"
] | 1 | 2017-03-25T05:08:25.000Z | 2017-03-25T05:08:25.000Z | """
pyexcel.filters
~~~~~~~~~~~~~~~
Filtering functions for pyexcel readers
:copyright: (c) 2014-2015 by Onni Software Ltd.
:license: New BSD License, see LICENSE for more details
Design note for filter algorithm::
#1 2 3 4 5 6 7 <- original index
# x x
... | 29.695545 | 79 | 0.548637 | from ._compact import PY2
class IndexFilter(object):
def __init__(self, func):
self.eval_func = func
self.shallow_eval_func = None
self.indices = None
def invert(self):
if self.eval_func:
if self.shallow_eval_func is None:
self.... | true | true |
f7510e7e4972c1139465d15d85e5c9fde99a2491 | 1,650 | py | Python | ooer/blueprints/best_of_modmail/__init__.py | williammck/ooer | d6dc07627acfa41de824b86addf4eb70ecc8fc76 | [
"MIT"
] | null | null | null | ooer/blueprints/best_of_modmail/__init__.py | williammck/ooer | d6dc07627acfa41de824b86addf4eb70ecc8fc76 | [
"MIT"
] | null | null | null | ooer/blueprints/best_of_modmail/__init__.py | williammck/ooer | d6dc07627acfa41de824b86addf4eb70ecc8fc76 | [
"MIT"
] | null | null | null | import itertools
import praw
from flask import Blueprint, current_app, render_template
blueprint = Blueprint('best_of_modmail', __name__, url_prefix='/modmail')
reddit = praw.Reddit(client_id=current_app.config.get('REDDIT_BOT_CLIENT_ID'),
client_secret=current_app.config.get('REDDIT_BOT_CLIENT_... | 35.106383 | 119 | 0.728485 | import itertools
import praw
from flask import Blueprint, current_app, render_template
blueprint = Blueprint('best_of_modmail', __name__, url_prefix='/modmail')
reddit = praw.Reddit(client_id=current_app.config.get('REDDIT_BOT_CLIENT_ID'),
client_secret=current_app.config.get('REDDIT_BOT_CLIENT_... | true | true |
f75110a24a40e75b5471d78bb64ace0f6b3e1fd8 | 4,643 | py | Python | uranium/tests/test_packages_full.py | toumorokoshi/uranium | 2d99deb7762c7a788966637157afcee171fcf6a8 | [
"MIT"
] | 21 | 2016-01-14T04:06:08.000Z | 2021-03-23T01:43:48.000Z | uranium/tests/test_packages_full.py | toumorokoshi/uranium | 2d99deb7762c7a788966637157afcee171fcf6a8 | [
"MIT"
] | 45 | 2015-02-09T06:02:01.000Z | 2018-07-22T19:16:01.000Z | uranium/tests/test_packages_full.py | toumorokoshi/uranium | 2d99deb7762c7a788966637157afcee171fcf6a8 | [
"MIT"
] | 10 | 2015-02-07T20:56:22.000Z | 2018-07-20T03:18:07.000Z | URANIUM_PY = """
def main(build):
build.packages.install("nose")
import nose
assert nose is not None
""".strip()
URANIUM_PY_UPDATE = """
def main(build):
build.packages.install("nose" {0})
import nose
print(nose.__version__)
print("test")
""".strip()
URANIUM_PY_UNINSTALL = """
def main(b... | 27.152047 | 86 | 0.661641 | URANIUM_PY = """
def main(build):
build.packages.install("nose")
import nose
assert nose is not None
""".strip()
URANIUM_PY_UPDATE = """
def main(build):
build.packages.install("nose" {0})
import nose
print(nose.__version__)
print("test")
""".strip()
URANIUM_PY_UNINSTALL = """
def main(b... | true | true |
f75110f9f4870fe4fbe1dec5897bec437c1868e5 | 1,259 | py | Python | keystone-moon/keystone/contrib/endpoint_filter/routers.py | hashnfv/hashnfv-moon | daaba34fa2ed4426bc0fde359e54a5e1b872208c | [
"Apache-2.0"
] | null | null | null | keystone-moon/keystone/contrib/endpoint_filter/routers.py | hashnfv/hashnfv-moon | daaba34fa2ed4426bc0fde359e54a5e1b872208c | [
"Apache-2.0"
] | null | null | null | keystone-moon/keystone/contrib/endpoint_filter/routers.py | hashnfv/hashnfv-moon | daaba34fa2ed4426bc0fde359e54a5e1b872208c | [
"Apache-2.0"
] | 1 | 2021-03-21T11:38:30.000Z | 2021-03-21T11:38:30.000Z | # Copyright 2013 OpenStack Foundation
#
# 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... | 37.029412 | 77 | 0.733122 |
from oslo_log import log
from oslo_log import versionutils
from keystone.common import wsgi
from keystone.i18n import _
LOG = log.getLogger(__name__)
class EndpointFilterExtension(wsgi.Middleware):
def __init__(self, *args, **kwargs):
super(EndpointFilterExtension, self).__init__(*args, ... | true | true |
f75112e8b0608af016ffbc2b6023f4cbb1696bf8 | 3,339 | py | Python | singa_auto/container/container_manager.py | pinpom/singa-auto | e5b80c4728ee65fd0bd7ab15d59ab5621ccc50b1 | [
"Apache-2.0"
] | 1 | 2020-10-26T11:37:26.000Z | 2020-10-26T11:37:26.000Z | singa_auto/container/container_manager.py | pinpom/singa-auto | e5b80c4728ee65fd0bd7ab15d59ab5621ccc50b1 | [
"Apache-2.0"
] | null | null | null | singa_auto/container/container_manager.py | pinpom/singa-auto | e5b80c4728ee65fd0bd7ab15d59ab5621ccc50b1 | [
"Apache-2.0"
] | null | null | null | #
# 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... | 41.7375 | 127 | 0.640611 |
import abc
from typing import List, Dict, Tuple, Any
class InvalidServiceRequestError(Exception):
pass
class ContainerService():
def __init__(self,
id: str,
hostname: str,
port: int,
info: Dict[str, Any] = {}):
s... | true | true |
f7511465eb1d4391679ceb73c8eecf7dc6643a74 | 1,526 | py | Python | dataset_tools/merge_data.py | nyacat/rune_detection | 2da385b3f9f48fd79e41a0f5a5ffc9608c12990b | [
"Unlicense"
] | 2 | 2021-01-14T01:41:18.000Z | 2021-01-14T04:02:38.000Z | dataset_tools/merge_data.py | nyacat/rune_detection | 2da385b3f9f48fd79e41a0f5a5ffc9608c12990b | [
"Unlicense"
] | null | null | null | dataset_tools/merge_data.py | nyacat/rune_detection | 2da385b3f9f48fd79e41a0f5a5ffc9608c12990b | [
"Unlicense"
] | 1 | 2021-03-23T12:51:07.000Z | 2021-03-23T12:51:07.000Z | import os
import shutil
import zipfile
if __name__ == "__main__":
chunk_size = 300
pwd = os.path.dirname(os.path.realpath(__file__))
package_dir = os.path.join(pwd, "package")
tmp_dir = os.path.join(pwd, "tmp")
final_dir = os.path.join(pwd, "final")
for zip_file in os.listdir(package_dir):
... | 33.173913 | 83 | 0.585845 | import os
import shutil
import zipfile
if __name__ == "__main__":
chunk_size = 300
pwd = os.path.dirname(os.path.realpath(__file__))
package_dir = os.path.join(pwd, "package")
tmp_dir = os.path.join(pwd, "tmp")
final_dir = os.path.join(pwd, "final")
for zip_file in os.listdir(package_dir):
... | true | true |
f7511558da2aea246168490825858286e9c013ed | 2,013 | py | Python | 2021/src/day5.py | pantaryl/adventofcode | d53255c55be0447f3cef7bd93818c41b0eeae997 | [
"MIT"
] | 2 | 2021-12-01T05:23:25.000Z | 2021-12-11T05:58:00.000Z | 2021/src/day5.py | pantaryl/adventofcode | d53255c55be0447f3cef7bd93818c41b0eeae997 | [
"MIT"
] | null | null | null | 2021/src/day5.py | pantaryl/adventofcode | d53255c55be0447f3cef7bd93818c41b0eeae997 | [
"MIT"
] | null | null | null | from shared import *
# Input data is in INPUT_DATA.
# INPUT_DATA = [int(x) for x in INPUT_DATA]
class Line:
def __init__(self, start: complex, end: complex):
self.start: complex
self.start = start
self.end: complex
self.end = end
@property
def vertical(self) -> bool:
... | 27.958333 | 89 | 0.571783 | from shared import *
class Line:
def __init__(self, start: complex, end: complex):
self.start: complex
self.start = start
self.end: complex
self.end = end
@property
def vertical(self) -> bool:
return self.start.real == self.end.real
@property
def horiz... | true | true |
f75115804fbc3023980fa0ca1865a0fcbe5bb784 | 393 | py | Python | diarypro/diarypro/asgi.py | abhim4536/remote_repository | abbe3eb4fef1eb2b7ca08b98261354c913a1a171 | [
"MIT"
] | null | null | null | diarypro/diarypro/asgi.py | abhim4536/remote_repository | abbe3eb4fef1eb2b7ca08b98261354c913a1a171 | [
"MIT"
] | null | null | null | diarypro/diarypro/asgi.py | abhim4536/remote_repository | abbe3eb4fef1eb2b7ca08b98261354c913a1a171 | [
"MIT"
] | null | null | null | """
ASGI config for diarypro project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETT... | 23.117647 | 78 | 0.78626 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'diarypro.settings')
application = get_asgi_application()
| true | true |
f75116124756a1ebfed290378c23ce44b329ccab | 803 | py | Python | phc/easy/ocr/config.py | lifeomic/phc-sdk-py | 51709c1c2f129a3fbe336a44e4d501ae0249859e | [
"MIT"
] | 1 | 2020-07-22T12:46:58.000Z | 2020-07-22T12:46:58.000Z | phc/easy/ocr/config.py | lifeomic/phc-sdk-py | 51709c1c2f129a3fbe336a44e4d501ae0249859e | [
"MIT"
] | 54 | 2019-10-09T16:19:04.000Z | 2022-01-19T20:28:59.000Z | phc/easy/ocr/config.py | lifeomic/phc-sdk-py | 51709c1c2f129a3fbe336a44e4d501ae0249859e | [
"MIT"
] | 2 | 2019-10-30T19:54:43.000Z | 2020-12-03T18:57:15.000Z | import json
from phc.base_client import BaseClient
from phc.easy.auth import Auth
from phc.easy.ocr.options.ocr_config_types import Config as OcrConfig
class Config:
@staticmethod
def create(config: OcrConfig, auth_args: Auth = Auth.shared()):
auth = Auth(auth_args)
client = BaseClient(auth.s... | 26.766667 | 69 | 0.608966 | import json
from phc.base_client import BaseClient
from phc.easy.auth import Auth
from phc.easy.ocr.options.ocr_config_types import Config as OcrConfig
class Config:
@staticmethod
def create(config: OcrConfig, auth_args: Auth = Auth.shared()):
auth = Auth(auth_args)
client = BaseClient(auth.s... | true | true |
f7511683bcb6f6fa4dbed8eb8a2b3606cd21d6fb | 1,463 | py | Python | snakeplayer.py | colejagdtiger/RL-snake | 09787e5335de3f80204a26c5207e4ffde910077c | [
"MIT"
] | null | null | null | snakeplayer.py | colejagdtiger/RL-snake | 09787e5335de3f80204a26c5207e4ffde910077c | [
"MIT"
] | null | null | null | snakeplayer.py | colejagdtiger/RL-snake | 09787e5335de3f80204a26c5207e4ffde910077c | [
"MIT"
] | null | null | null | import segment as seg
import snakeconfig as config
class Player(object):
def __init__(self):
self.dir_x = 1
self.dir_y = 0
self.length = 4
self.segments = list()
def initializePlayer(self, start_x, start_y):
self.length = 4
self.segments.clear()
... | 25.666667 | 86 | 0.539303 | import segment as seg
import snakeconfig as config
class Player(object):
def __init__(self):
self.dir_x = 1
self.dir_y = 0
self.length = 4
self.segments = list()
def initializePlayer(self, start_x, start_y):
self.length = 4
self.segments.clear()
... | true | true |
f75117246dd7b2da0e686472471b060351ce34f1 | 161 | py | Python | tests/model_control/detailed/transf_Anscombe/model_control_one_enabled_Anscombe_Lag1Trend_Seasonal_Hour_NoAR.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | tests/model_control/detailed/transf_Anscombe/model_control_one_enabled_Anscombe_Lag1Trend_Seasonal_Hour_NoAR.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | 1 | 2019-11-30T23:39:38.000Z | 2019-12-01T04:34:35.000Z | tests/model_control/detailed/transf_Anscombe/model_control_one_enabled_Anscombe_Lag1Trend_Seasonal_Hour_NoAR.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | import pyaf.tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Anscombe'] , ['Lag1Trend'] , ['Seasonal_Hour'] , ['NoAR'] ); | 40.25 | 83 | 0.751553 | import pyaf.tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Anscombe'] , ['Lag1Trend'] , ['Seasonal_Hour'] , ['NoAR'] ); | true | true |
f7511a92c221d501ccec112a0c2a812e2125407c | 1,259 | py | Python | azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_managed_disk_parameters.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/v2017_12_01/models/virtual_machine_scale_set_managed_disk_parameters.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/v2017_12_01/models/virtual_machine_scale_set_managed_disk_parameters.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 ... | 39.34375 | 93 | 0.664813 |
from msrest.serialization import Model
class VirtualMachineScaleSetManagedDiskParameters(Model):
_attribute_map = {
'storage_account_type': {'key': 'storageAccountType', 'type': 'StorageAccountTypes'},
}
def __init__(self, storage_account_type=None):
super(VirtualMachineScaleS... | true | true |
f7511ad6381414f04ad8a86f6b3ad04eae926cd6 | 81 | py | Python | factory/factory.py | Soulzerz/discord-memefy | fa45905ca278f77fabc7a607ca250af8342ab3d4 | [
"MIT"
] | null | null | null | factory/factory.py | Soulzerz/discord-memefy | fa45905ca278f77fabc7a607ca250af8342ab3d4 | [
"MIT"
] | 3 | 2018-08-29T01:15:46.000Z | 2018-08-29T15:12:38.000Z | factory/factory.py | Soulzerz/discord-memefy | fa45905ca278f77fabc7a607ca250af8342ab3d4 | [
"MIT"
] | 2 | 2018-08-29T00:46:04.000Z | 2018-08-29T01:13:53.000Z | class Discord(object):
def __init__(self, client):
self.client = client | 27 | 31 | 0.679012 | class Discord(object):
def __init__(self, client):
self.client = client | true | true |
f7511b6c19d2d18648a0a4e100914dde3a3e7420 | 16,553 | py | Python | mariner/tests/test_server.py | smithula/mariner | 1435eba81caa873b42c176304549f00d9bb02df2 | [
"MIT"
] | 167 | 2020-10-13T03:27:45.000Z | 2022-03-20T17:46:11.000Z | mariner/tests/test_server.py | smithula/mariner | 1435eba81caa873b42c176304549f00d9bb02df2 | [
"MIT"
] | 457 | 2020-09-16T14:06:20.000Z | 2022-03-21T10:55:56.000Z | mariner/tests/test_server.py | smithula/mariner | 1435eba81caa873b42c176304549f00d9bb02df2 | [
"MIT"
] | 56 | 2020-10-24T07:37:45.000Z | 2022-03-28T11:13:43.000Z | import hashlib
import io
import os
import pathlib
from unittest.mock import patch, ANY, Mock
from freezegun import freeze_time
from pyexpect import expect
from pyfakefs.fake_filesystem_unittest import TestCase
from werkzeug.datastructures import FileStorage
from mariner import config
from mariner.exceptions import Un... | 38.948235 | 88 | 0.566665 | import hashlib
import io
import os
import pathlib
from unittest.mock import patch, ANY, Mock
from freezegun import freeze_time
from pyexpect import expect
from pyfakefs.fake_filesystem_unittest import TestCase
from werkzeug.datastructures import FileStorage
from mariner import config
from mariner.exceptions import Un... | true | true |
f7511cbeed1b338b992008afc2fe2294b863b06b | 5,405 | py | Python | nbs/13_consensus_clustering/py/030_03-analysis-coassociation.py | greenelab/phenoplier | 95f04b17f0b5227560fcf32ac0a85b2c5aa9001f | [
"BSD-2-Clause-Patent"
] | 3 | 2021-08-17T21:59:19.000Z | 2022-03-08T15:46:24.000Z | nbs/13_consensus_clustering/py/030_03-analysis-coassociation.py | greenelab/phenoplier | 95f04b17f0b5227560fcf32ac0a85b2c5aa9001f | [
"BSD-2-Clause-Patent"
] | 4 | 2021-08-04T13:57:24.000Z | 2021-10-11T14:57:15.000Z | nbs/13_consensus_clustering/py/030_03-analysis-coassociation.py | greenelab/phenoplier | 95f04b17f0b5227560fcf32ac0a85b2c5aa9001f | [
"BSD-2-Clause-Patent"
] | null | null | null | # ---
# jupyter:
# jupytext:
# cell_metadata_filter: all,-execution,-papermill,-trusted
# formats: ipynb,py//py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.7.1
# kernelspec:
# display_name: Python 3
# ... | 25.738095 | 395 | 0.682701 |
lay import display
from pathlib import Path
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from utils import generate_result_set_name
import conf
US_CLUSTERING_DIR = Path(
conf.RESULTS["CLUSTERING_DIR"], "consensus_clustering"
).resolve()
display(C... | true | true |
f7511cc64c7ed5568a36dc0efffafbdd85e2aa95 | 476 | py | Python | packages/python/plotly/plotly/validators/funnel/marker/colorbar/_y.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/funnel/marker/colorbar/_y.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/funnel/marker/colorbar/_y.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | import _plotly_utils.basevalidators
class YValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="y", parent_name="funnel.marker.colorbar", **kwargs):
super(YValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
e... | 34 | 88 | 0.628151 | import _plotly_utils.basevalidators
class YValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="y", parent_name="funnel.marker.colorbar", **kwargs):
super(YValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
e... | true | true |
f7511d0359747f89c4c7d44197e8d4b0e21306dd | 1,158 | py | Python | tower/traces.py | alisonbnt/watchtower | 77cdb4731f6903f9c032f11e5ec1889335b814b9 | [
"MIT"
] | 1 | 2016-05-31T19:20:37.000Z | 2016-05-31T19:20:37.000Z | tower/traces.py | alisonbnt/watchtower | 77cdb4731f6903f9c032f11e5ec1889335b814b9 | [
"MIT"
] | null | null | null | tower/traces.py | alisonbnt/watchtower | 77cdb4731f6903f9c032f11e5ec1889335b814b9 | [
"MIT"
] | null | null | null | TRACES = {
'smell': 'A strange smell',
'rotten_flesh': 'Rotten flesh',
'scratches': "Scratch marks",
'groaning': "Groaning sounds",
'creature_dead': "Entity recognized as deceased",
'creature_wounds': "Some wounds in the body of the entity",
'creature_dirty': "Great amount of dirty covers th... | 37.354839 | 64 | 0.675302 | TRACES = {
'smell': 'A strange smell',
'rotten_flesh': 'Rotten flesh',
'scratches': "Scratch marks",
'groaning': "Groaning sounds",
'creature_dead': "Entity recognized as deceased",
'creature_wounds': "Some wounds in the body of the entity",
'creature_dirty': "Great amount of dirty covers th... | true | true |
f7511d39667a9a4ec5c17be0c560ed30921dafb6 | 15,198 | py | Python | tests/test_tf_shape_inference.py | tensorleap/tensorflow-onnx | 56f6070828928bbb0f30890b2229eec8b663213d | [
"Apache-2.0"
] | null | null | null | tests/test_tf_shape_inference.py | tensorleap/tensorflow-onnx | 56f6070828928bbb0f30890b2229eec8b663213d | [
"Apache-2.0"
] | null | null | null | tests/test_tf_shape_inference.py | tensorleap/tensorflow-onnx | 56f6070828928bbb0f30890b2229eec8b663213d | [
"Apache-2.0"
] | null | null | null | # SPDX-License-Identifier: Apache-2.0
"""Unit Tests for Tensorflow shape inference."""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import numpy as np
import tensorflow as tf
from tensorflow.python.ops import variables as variables_lib
from... | 46.054545 | 115 | 0.594684 |
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import numpy as np
import tensorflow as tf
from tensorflow.python.ops import variables as variables_lib
from tensorflow.python.ops import init_ops
from backend_test_base import Tf2OnnxBackendTe... | true | true |
f7511d4ef1fcb813aa66c443a4938594c9a3f263 | 3,680 | py | Python | lstm_seq2seq/src/utils/logger.py | arkilpatel/Primitive-Generalization | 81e568ca3f1b1f4026758db24c05acd4ce2eeb9c | [
"MIT"
] | 1 | 2022-03-20T08:40:20.000Z | 2022-03-20T08:40:20.000Z | lstm_seq2seq/src/utils/logger.py | arkilpatel/Primitive-Generalization | 81e568ca3f1b1f4026758db24c05acd4ce2eeb9c | [
"MIT"
] | null | null | null | lstm_seq2seq/src/utils/logger.py | arkilpatel/Primitive-Generalization | 81e568ca3f1b1f4026758db24c05acd4ce2eeb9c | [
"MIT"
] | null | null | null | import logging
from filelock import FileLock
import pdb
import pandas as pd
# Ignore warnings
import warnings
warnings.filterwarnings("ignore")
import json
'''Logging Modules'''
def get_logger(name, log_file_path='./logs/temp.log', logging_level=logging.INFO, log_format='%(asctime)s | %(levelname)s | %(fil... | 30.92437 | 186 | 0.674185 | import logging
from filelock import FileLock
import pdb
import pandas as pd
import warnings
warnings.filterwarnings("ignore")
import json
def get_logger(name, log_file_path='./logs/temp.log', logging_level=logging.INFO, log_format='%(asctime)s | %(levelname)s | %(filename)s: %(lineno)s : %(funcName)s() ::\t... | true | true |
f7511d9a8a76f99585b833dd52090e148a209a62 | 3,540 | py | Python | tickit/devices/femto/femto.py | dls-controls/tickit | 00bb013e69674bcfe4926f365ecb3c65c080abe8 | [
"Apache-2.0"
] | 4 | 2021-09-16T13:35:33.000Z | 2022-02-01T23:35:53.000Z | tickit/devices/femto/femto.py | dls-controls/tickit | 00bb013e69674bcfe4926f365ecb3c65c080abe8 | [
"Apache-2.0"
] | 46 | 2021-09-16T13:44:58.000Z | 2022-02-02T13:42:56.000Z | tickit/devices/femto/femto.py | dls-controls/tickit | 00bb013e69674bcfe4926f365ecb3c65c080abe8 | [
"Apache-2.0"
] | null | null | null | from softioc import builder
from tickit.adapters.epicsadapter import EpicsAdapter
from tickit.core.device import Device, DeviceUpdate
from tickit.core.typedefs import SimTime
from tickit.utils.compat.typing_compat import TypedDict
class FemtoDevice(Device):
"""Electronic signal amplifier."""
#: An empty typ... | 33.396226 | 89 | 0.641525 | from softioc import builder
from tickit.adapters.epicsadapter import EpicsAdapter
from tickit.core.device import Device, DeviceUpdate
from tickit.core.typedefs import SimTime
from tickit.utils.compat.typing_compat import TypedDict
class FemtoDevice(Device):
Inputs: TypedDict = TypedDict("Inputs", {"input":... | true | true |
f7511f68524d17306278ebd53d92567effd7ca7c | 4,153 | py | Python | tests/python/test_training_continuation.py | cnheider/xgboost | e7fbc8591fa7277ee4c474b7371c48c11b34cbde | [
"Apache-2.0"
] | 769 | 2015-01-02T03:15:00.000Z | 2022-03-30T11:22:52.000Z | tests/python/test_training_continuation.py | cnheider/xgboost | e7fbc8591fa7277ee4c474b7371c48c11b34cbde | [
"Apache-2.0"
] | 54 | 2015-01-01T01:12:39.000Z | 2017-05-21T02:56:14.000Z | tests/python/test_training_continuation.py | cnheider/xgboost | e7fbc8591fa7277ee4c474b7371c48c11b34cbde | [
"Apache-2.0"
] | 372 | 2015-01-03T21:10:27.000Z | 2022-03-03T03:46:36.000Z | import xgboost as xgb
import testing as tm
import numpy as np
import unittest
rng = np.random.RandomState(1337)
class TestTrainingContinuation(unittest.TestCase):
num_parallel_tree = 3
xgb_params_01 = {
'silent': 1,
'nthread': 1,
}
xgb_params_02 = {
'silent': 1,
'nth... | 39.552381 | 113 | 0.696123 | import xgboost as xgb
import testing as tm
import numpy as np
import unittest
rng = np.random.RandomState(1337)
class TestTrainingContinuation(unittest.TestCase):
num_parallel_tree = 3
xgb_params_01 = {
'silent': 1,
'nthread': 1,
}
xgb_params_02 = {
'silent': 1,
'nth... | true | true |
f7512127ab64dbce8276dcc2b2dab1fb7e2e7e00 | 29,037 | py | Python | runtest.py | ravenAtSafe/scons | ebe6e9b1b2fedbe3dd44c07aa2b6739d4079879e | [
"MIT"
] | null | null | null | runtest.py | ravenAtSafe/scons | ebe6e9b1b2fedbe3dd44c07aa2b6739d4079879e | [
"MIT"
] | null | null | null | runtest.py | ravenAtSafe/scons | ebe6e9b1b2fedbe3dd44c07aa2b6739d4079879e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Copyright The SCons Foundation
#
# runtest.py - wrapper script for running SCons tests
#
# The SCons test suite consists of:
#
# - unit tests - included in *Tests.py files from SCons/ dir
# - end-to-end tests - these are *.py files in test/ directory that
# req... | 33.14726 | 152 | 0.589868 |
import getopt
import glob
import os
import re
import stat
import subprocess
import sys
import tempfile
import threading
import time
from abc import ABC, abstractmethod
from optparse import OptionParser, BadOptionError
from queue import Queue
cwd = os.getcwd()
baseline = None
external = 0
devmode = Fal... | true | true |
f751216398cfa36014558e25485b351239c660c9 | 3,911 | py | Python | witio/splitwise.py | dizzy54/munimji | 2d6616b4924e12d465ec352119a1621c925adc81 | [
"MIT"
] | null | null | null | witio/splitwise.py | dizzy54/munimji | 2d6616b4924e12d465ec352119a1621c925adc81 | [
"MIT"
] | null | null | null | witio/splitwise.py | dizzy54/munimji | 2d6616b4924e12d465ec352119a1621c925adc81 | [
"MIT"
] | null | null | null | from requests_oauthlib import OAuth1Session
from django.conf import settings
client_key = settings.SPLITWISE_CLIENT_KEY
client_secret = settings.SPLITWISE_CLIENT_SECRET
def get_request_token():
""" obtain generic resource owner key and secret from splitwise
"""
request_token_url = 'https://secure.splitw... | 35.554545 | 107 | 0.695474 | from requests_oauthlib import OAuth1Session
from django.conf import settings
client_key = settings.SPLITWISE_CLIENT_KEY
client_secret = settings.SPLITWISE_CLIENT_SECRET
def get_request_token():
request_token_url = 'https://secure.splitwise.com/api/v3.0/get_request_token'
oauth = OAuth1Session(client_key, cl... | true | true |
f751233cccdf9939537a4739717ad55b16a70944 | 1,016 | py | Python | py-junos-eznc/tests/unit/factory/test_factory_cls.py | fostasha/pynet_test | 99a23f64976dc4b9bae17f6f9330b1867a1e74a8 | [
"Apache-2.0"
] | 1 | 2021-01-18T09:00:36.000Z | 2021-01-18T09:00:36.000Z | py-junos-eznc/tests/unit/factory/test_factory_cls.py | fostasha/pynet_test | 99a23f64976dc4b9bae17f6f9330b1867a1e74a8 | [
"Apache-2.0"
] | null | null | null | py-junos-eznc/tests/unit/factory/test_factory_cls.py | fostasha/pynet_test | 99a23f64976dc4b9bae17f6f9330b1867a1e74a8 | [
"Apache-2.0"
] | null | null | null | __author__ = "Rick Sherman"
__credits__ = "Jeremy Schulman"
import unittest
from nose.plugins.attrib import attr
from jnpr.junos.factory.factory_cls import FactoryCfgTable, FactoryOpTable
from jnpr.junos.factory.factory_cls import FactoryTable, FactoryView
@attr('unit')
class TestFactoryCls(unittest.TestCase):
... | 31.75 | 74 | 0.711614 | __author__ = "Rick Sherman"
__credits__ = "Jeremy Schulman"
import unittest
from nose.plugins.attrib import attr
from jnpr.junos.factory.factory_cls import FactoryCfgTable, FactoryOpTable
from jnpr.junos.factory.factory_cls import FactoryTable, FactoryView
@attr('unit')
class TestFactoryCls(unittest.TestCase):
... | true | true |
f751246f2079539cc141ab9fdd4e240c1b12b703 | 890 | py | Python | tutorial/tutorial/urls.py | zengjiapei3000/django_rest_tutorial | 307723f68ff5e1f5ad75bfbeeb67e713f27bd846 | [
"BSD-3-Clause"
] | null | null | null | tutorial/tutorial/urls.py | zengjiapei3000/django_rest_tutorial | 307723f68ff5e1f5ad75bfbeeb67e713f27bd846 | [
"BSD-3-Clause"
] | null | null | null | tutorial/tutorial/urls.py | zengjiapei3000/django_rest_tutorial | 307723f68ff5e1f5ad75bfbeeb67e713f27bd846 | [
"BSD-3-Clause"
] | 1 | 2020-12-05T02:53:11.000Z | 2020-12-05T02:53:11.000Z | """tutorial URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-base... | 35.6 | 77 | 0.706742 | from django.contrib import admin
from django.urls import path, include
from django.conf.urls import include
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('snippets.urls')),
path('api-auth/', include('rest_framework.urls'))
]
| true | true |
f75124aac7250c49aa1ddaacc5669b0e85545f50 | 1,468 | py | Python | salt/transport/__init__.py | MeAndTheFirefly/salt | 77fc3ec3ee25c1b769cc66ddee09067d18080844 | [
"Apache-2.0"
] | 2 | 2016-11-14T15:08:53.000Z | 2016-11-20T09:25:30.000Z | salt/transport/__init__.py | snetsystems/salt | 6f8bedfc2453624e00037f80b8099ed010fad506 | [
"Apache-2.0"
] | 3 | 2021-03-31T19:53:24.000Z | 2021-12-13T20:46:19.000Z | salt/transport/__init__.py | snetsystems/salt | 6f8bedfc2453624e00037f80b8099ed010fad506 | [
"Apache-2.0"
] | 2 | 2020-11-04T06:32:02.000Z | 2020-11-06T11:01:18.000Z | # -*- coding: utf-8 -*-
"""
Encapsulate the different transports available to Salt.
"""
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import logging
# Import Salt libs
import salt.utils.versions
# Import third party libs
from salt.ext import six
from salt.ext.six.moves... | 27.185185 | 84 | 0.642371 |
from __future__ import absolute_import, print_function, unicode_literals
import logging
import salt.utils.versions
from salt.ext import six
from salt.ext.six.moves import range
log = logging.getLogger(__name__)
def iter_transport_opts(opts):
transports = set()
for transport, opts_overrides in six.ite... | true | true |
f7512507ce68cbc943dd62b8260b359461bd408c | 425 | py | Python | force_displaying_website/force_displaying_website/wsgi.py | LeeviHok/force-displaying-website | 792dd5dd1febe3cebade73e407a6145a7aeeef2f | [
"MIT"
] | null | null | null | force_displaying_website/force_displaying_website/wsgi.py | LeeviHok/force-displaying-website | 792dd5dd1febe3cebade73e407a6145a7aeeef2f | [
"MIT"
] | 3 | 2021-04-08T21:24:14.000Z | 2021-06-10T19:49:18.000Z | force_displaying_website/force_displaying_website/wsgi.py | LeeviHok/force-displaying-website | 792dd5dd1febe3cebade73e407a6145a7aeeef2f | [
"MIT"
] | null | null | null | """
WSGI config for force_displaying_website project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefa... | 25 | 84 | 0.802353 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'force_displaying_website.settings')
application = get_wsgi_application()
| true | true |
f75126124ddd0d761688abf0be3fd1efe56fa7b7 | 510 | py | Python | meiduo_mall/meiduo_mall/apps/oauth/models.py | shenhaiyu0923/meiduo_project | 0ba91533294c5bb6f8ca54f93eabdff007a3560f | [
"MIT"
] | 4 | 2021-04-30T05:45:32.000Z | 2021-04-30T05:56:03.000Z | meiduo_mall/meiduo_mall/apps/oauth/models.py | shenhaiyu0923/meiduo_project | 0ba91533294c5bb6f8ca54f93eabdff007a3560f | [
"MIT"
] | null | null | null | meiduo_mall/meiduo_mall/apps/oauth/models.py | shenhaiyu0923/meiduo_project | 0ba91533294c5bb6f8ca54f93eabdff007a3560f | [
"MIT"
] | null | null | null | from django.db import models
# Create your models here.
from django.db import models
from meiduo_mall.utils.models import BaseModel
# Create your models here.s
class OAuthQQUser(BaseModel):
"""QQ登录用户数据"""
user = models.ForeignKey('users.User', on_delete=models.CASCADE, verbose_name='用户')
openid = models... | 28.333333 | 87 | 0.72549 | from django.db import models
from django.db import models
from meiduo_mall.utils.models import BaseModel
class OAuthQQUser(BaseModel):
user = models.ForeignKey('users.User', on_delete=models.CASCADE, verbose_name='用户')
openid = models.CharField(max_length=64, verbose_name='openid', db_index=True)
cla... | true | true |
f7512708c965e76060df90fcb1a090beca8092e1 | 1,223 | py | Python | webapp/main/models.py | mign0n/super_budget | 601f40da353d077496eea7806bb25ddb46ec9a36 | [
"MIT"
] | null | null | null | webapp/main/models.py | mign0n/super_budget | 601f40da353d077496eea7806bb25ddb46ec9a36 | [
"MIT"
] | null | null | null | webapp/main/models.py | mign0n/super_budget | 601f40da353d077496eea7806bb25ddb46ec9a36 | [
"MIT"
] | null | null | null | from webapp.user.models import User
from webapp.db import db
class Category(db.Model):
__tablename__ = 'categories'
id = db.Column(db.Integer, primary_key=True)
user_id = db.Column(db.Integer, db.ForeignKey(User.id))
name = db.Column(db.String(50), nullable=False)
is_income = db.Column(db.Boolean,... | 33.972222 | 86 | 0.644317 | from webapp.user.models import User
from webapp.db import db
class Category(db.Model):
__tablename__ = 'categories'
id = db.Column(db.Integer, primary_key=True)
user_id = db.Column(db.Integer, db.ForeignKey(User.id))
name = db.Column(db.String(50), nullable=False)
is_income = db.Column(db.Boolean,... | true | true |
f751277abcf46652bbbabd7f031535da80b64e40 | 3,737 | py | Python | ops/ngs.py | feldman4/NatureProtocols | a0a6775b8edfc493ac6265b1844040c1ae29c33b | [
"MIT"
] | 10 | 2019-03-21T20:23:38.000Z | 2022-02-07T16:34:37.000Z | ops/ngs.py | feldman4/NatureProtocols | a0a6775b8edfc493ac6265b1844040c1ae29c33b | [
"MIT"
] | 12 | 2019-08-03T01:35:18.000Z | 2022-03-12T00:58:27.000Z | ops/ngs.py | feldman4/NatureProtocols | a0a6775b8edfc493ac6265b1844040c1ae29c33b | [
"MIT"
] | 8 | 2019-02-18T14:00:25.000Z | 2021-09-20T18:45:48.000Z | import pandas as pd
import numpy as np
from glob import glob
from natsort import natsorted
# TODO: from ops.constants import *
from . import utils
def load_hist(filename, threshold):
try:
return (pd.read_csv(filename, sep='\s+', header=None)
.rename(columns={0: 'count', 1: 'seq'})
... | 36.637255 | 80 | 0.568906 | import pandas as pd
import numpy as np
from glob import glob
from natsort import natsorted
from . import utils
def load_hist(filename, threshold):
try:
return (pd.read_csv(filename, sep='\s+', header=None)
.rename(columns={0: 'count', 1: 'seq'})
.query('count > @threshold')
... | true | true |
f75127c9574731eb316b697deb0c4352e85c2885 | 806 | py | Python | examples/converting_units.py | Rory-Sullivan/yrlocationforecast | 26b66834cac4569704daf0009a9d2bba39dbfb75 | [
"MIT"
] | 13 | 2020-07-28T17:47:42.000Z | 2022-03-30T13:35:12.000Z | examples/converting_units.py | Rory-Sullivan/yrlocationforecast | 26b66834cac4569704daf0009a9d2bba39dbfb75 | [
"MIT"
] | 5 | 2020-10-14T11:10:13.000Z | 2022-01-01T17:35:19.000Z | examples/converting_units.py | Rory-Sullivan/yrlocationforecast | 26b66834cac4569704daf0009a9d2bba39dbfb75 | [
"MIT"
] | 6 | 2020-10-16T12:30:07.000Z | 2022-02-18T07:13:21.000Z | """How to change the units of certain variables."""
from metno_locationforecast import Place, Forecast
USER_AGENT = "metno_locationforecast/1.0 https://github.com/Rory-Sullivan/yrlocationforecast"
london = Place("London", 51.5, -0.1, 25)
london_forecast = Forecast(london, USER_AGENT)
london_forecast.update()
# Itera... | 33.583333 | 93 | 0.725806 |
from metno_locationforecast import Place, Forecast
USER_AGENT = "metno_locationforecast/1.0 https://github.com/Rory-Sullivan/yrlocationforecast"
london = Place("London", 51.5, -0.1, 25)
london_forecast = Forecast(london, USER_AGENT)
london_forecast.update()
for interval in london_forecast.data.intervals:
for va... | true | true |
f75128c7207f99dac300ef6a42b9727400d18fc4 | 2,211 | py | Python | gmprocess/metrics/reduction/arias.py | norfordb/groundmotion | 3f714894a34d9d37e1ac236f26b4366e25a05056 | [
"CC0-1.0"
] | null | null | null | gmprocess/metrics/reduction/arias.py | norfordb/groundmotion | 3f714894a34d9d37e1ac236f26b4366e25a05056 | [
"CC0-1.0"
] | null | null | null | gmprocess/metrics/reduction/arias.py | norfordb/groundmotion | 3f714894a34d9d37e1ac236f26b4366e25a05056 | [
"CC0-1.0"
] | null | null | null | # Third party imports
import numpy as np
from scipy import integrate
# Local imports
from gmprocess.constants import GAL_TO_PCTG
from gmprocess.metrics.reduction.reduction import Reduction
from gmprocess.stationstream import StationStream
from gmprocess.stationtrace import StationTrace
class Arias(Reduction):
""... | 38.12069 | 81 | 0.637268 |
import numpy as np
from scipy import integrate
from gmprocess.constants import GAL_TO_PCTG
from gmprocess.metrics.reduction.reduction import Reduction
from gmprocess.stationstream import StationStream
from gmprocess.stationtrace import StationTrace
class Arias(Reduction):
def __init__(self, reduction_data, ban... | true | true |
f75128ed515675fc763f11f0b69acdec3a32cda1 | 9,570 | py | Python | app/util/stack.py | bahtiyarkaba/flamescope | 64eb9ca37f9680f280e94c0953a3ed2da0576199 | [
"Apache-2.0"
] | null | null | null | app/util/stack.py | bahtiyarkaba/flamescope | 64eb9ca37f9680f280e94c0953a3ed2da0576199 | [
"Apache-2.0"
] | null | null | null | app/util/stack.py | bahtiyarkaba/flamescope | 64eb9ca37f9680f280e94c0953a3ed2da0576199 | [
"Apache-2.0"
] | null | null | null | # This file is part of FlameScope, a performance analysis tool created by the
# Netflix cloud performance team. See:
#
# https://github.com/Netflix/flamescope
#
# Copyright 2018 Netflix, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance wi... | 32.886598 | 86 | 0.555172 |
from ..common import fileutil
import os
import gzip
import collections
from flask import abort
from os import walk
from os.path import abspath, join
from app import config
from math import ceil, floor
from .regexp import event_regexp, idle_regexp, comm_regexp, frame_regexp
stack_times = {}
s... | true | true |
f751290d5762858bd9016ddd6f26077a58a002ea | 527 | py | Python | ofagent/indigo/submodules/loxigen-artifacts/pyloxi/loxi/of13/__init__.py | lanpinguo/apple-sauce | b16e7b78e58d0d17ad7f05476f38704a6b519ece | [
"Apache-2.0"
] | 1 | 2021-05-14T15:33:21.000Z | 2021-05-14T15:33:21.000Z | ofagent/indigo/submodules/loxigen-artifacts/pyloxi/loxi/of13/__init__.py | lanpinguo/apple-sauce | b16e7b78e58d0d17ad7f05476f38704a6b519ece | [
"Apache-2.0"
] | null | null | null | ofagent/indigo/submodules/loxigen-artifacts/pyloxi/loxi/of13/__init__.py | lanpinguo/apple-sauce | b16e7b78e58d0d17ad7f05476f38704a6b519ece | [
"Apache-2.0"
] | 2 | 2019-07-13T06:58:33.000Z | 2022-03-23T03:02:57.000Z | # Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
# See the file LICENSE.pyloxi which should have been included in the source distribution
# Automatically generated by LOXI from ... | 31 | 88 | 0.796964 |
import action, common, const, message
import instruction
import oxm
import meter_band
import bsn_tlv
from const import *
from common import *
from loxi import ProtocolError
| true | true |
f75129205c26329f2fe548db2d4a04d0d5769e48 | 6,202 | py | Python | src/information_value.py | icyyy/information_value | 8d71ab742e285f452e1dc0dc7952a924a27167ec | [
"MIT"
] | 115 | 2016-04-08T07:15:14.000Z | 2020-12-30T14:10:45.000Z | src/information_value.py | dljnh66/information_value | 8d71ab742e285f452e1dc0dc7952a924a27167ec | [
"MIT"
] | 1 | 2018-12-17T12:33:25.000Z | 2018-12-17T12:33:25.000Z | src/information_value.py | dljnh66/information_value | 8d71ab742e285f452e1dc0dc7952a924a27167ec | [
"MIT"
] | 87 | 2016-04-17T07:47:53.000Z | 2021-12-27T13:47:18.000Z | import numpy as np
import math
from scipy import stats
from sklearn.utils.multiclass import type_of_target
class WOE:
def __init__(self):
self._WOE_MIN = -20
self._WOE_MAX = 20
def woe(self, X, y, event=1):
'''
Calculate woe of each feature category and information value
... | 36.482353 | 123 | 0.579652 | import numpy as np
import math
from scipy import stats
from sklearn.utils.multiclass import type_of_target
class WOE:
def __init__(self):
self._WOE_MIN = -20
self._WOE_MAX = 20
def woe(self, X, y, event=1):
self.check_target_binary(y)
X1 = self.feature_discretion(X)
re... | true | true |
f7512a4bf11e41ab51e13899a31c284b98f867c2 | 4,804 | py | Python | asposewordscloud/models/requests/get_runs_request.py | rizwanniazigroupdocs/aspose-words-cloud-python | b943384a1e3c0710cc84df74119e6edf7356037e | [
"MIT"
] | null | null | null | asposewordscloud/models/requests/get_runs_request.py | rizwanniazigroupdocs/aspose-words-cloud-python | b943384a1e3c0710cc84df74119e6edf7356037e | [
"MIT"
] | null | null | null | asposewordscloud/models/requests/get_runs_request.py | rizwanniazigroupdocs/aspose-words-cloud-python | b943384a1e3c0710cc84df74119e6edf7356037e | [
"MIT"
] | null | null | null | # coding: utf-8
# -----------------------------------------------------------------------------------
# <copyright company="Aspose" file="get_runs_request.py">
# Copyright (c) 2020 Aspose.Words for Cloud
# </copyright>
# <summary>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of ... | 43.672727 | 127 | 0.630516 |
from six.moves.urllib.parse import quote
class GetRunsRequest(object):
def __init__(self, name, paragraph_path, folder=None, storage=None, load_encoding=None, password=None):
self.name = name
self.paragraph_path = paragraph_path
self.folder = folder
self.s... | true | true |
f7512a6d34da77db83dacda0bd4b23759e5ce626 | 493 | py | Python | apps/users/migrations/0002_user_is_mp_user.py | chenyifaerfans/fafaer-apis | 896db11116fc78c597ebc1a90f547dc15004438d | [
"MIT"
] | null | null | null | apps/users/migrations/0002_user_is_mp_user.py | chenyifaerfans/fafaer-apis | 896db11116fc78c597ebc1a90f547dc15004438d | [
"MIT"
] | null | null | null | apps/users/migrations/0002_user_is_mp_user.py | chenyifaerfans/fafaer-apis | 896db11116fc78c597ebc1a90f547dc15004438d | [
"MIT"
] | 1 | 2019-03-17T12:46:20.000Z | 2019-03-17T12:46:20.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-08-08 22:12
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.AddField(
... | 23.47619 | 104 | 0.600406 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='user',
name='is_mp_user',
field=mod... | true | true |
f7512b20d86ed15549783d605d6173d2a83d6a58 | 5,028 | py | Python | keras_frcnn/vgg.py | Wall-ee/keras-fastcrnn-BCCD | b1e974bafc70d3324ca2efb613debeaa127779be | [
"Apache-2.0"
] | null | null | null | keras_frcnn/vgg.py | Wall-ee/keras-fastcrnn-BCCD | b1e974bafc70d3324ca2efb613debeaa127779be | [
"Apache-2.0"
] | 1 | 2020-08-09T12:26:12.000Z | 2020-08-09T12:26:12.000Z | keras_frcnn/vgg.py | Wall-ee/keras-fastcrnn-BCCD | b1e974bafc70d3324ca2efb613debeaa127779be | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""VGG16 model for Keras.
# Reference
- [Very Deep Convolutional Networks for Large-Scale Image Recognition](https://arxiv.org/abs/1409.1556)
"""
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import warnings
from keras.models impor... | 39.590551 | 154 | 0.676213 |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import warnings
from keras.models import Model
from keras.layers import Flatten, Dense, Input, Conv2D, MaxPooling2D, Dropout
from keras.layers import GlobalAveragePooling2D, GlobalMaxPooling2D, TimeDistribute... | true | true |
f7512bfaab7c55b6fd4ab8e830a0a594d5361c60 | 4,406 | py | Python | src/testproject/sdk/internal/helpers/redact_helper.py | Fnckerpoi/python-opensdk | 37e528ea613686975d58b230c16647324271a0bd | [
"Apache-2.0"
] | 38 | 2021-02-04T06:38:13.000Z | 2022-03-25T05:41:28.000Z | src/testproject/sdk/internal/helpers/redact_helper.py | A-b-i-lash/python-opensdk | 1f950e1ae6f9977e5732f2b880e8bffd924b36e6 | [
"Apache-2.0"
] | 47 | 2020-07-08T05:13:03.000Z | 2021-02-01T10:17:58.000Z | src/testproject/sdk/internal/helpers/redact_helper.py | A-b-i-lash/python-opensdk | 1f950e1ae6f9977e5732f2b880e8bffd924b36e6 | [
"Apache-2.0"
] | 17 | 2021-02-28T23:46:17.000Z | 2022-01-26T05:02:59.000Z | # Copyright 2020 TestProject (https://testproject.io)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 37.982759 | 104 | 0.660917 |
from selenium.webdriver.remote.command import Command
class RedactHelper:
def __init__(self, command_executor):
self._command_executor = command_executor
def redact_command(self, command: str, params: dict):
if command == Command.SEND_KEYS_TO_ELEMENT or command == Command.SEND_... | true | true |
f7512c2208d2b87decfc0fad4d1de187a3b5101c | 155,786 | py | Python | dask/array/core.py | kylejn27/dask | 4ab0b179cbd19645749a7dd294df9c2c362c256a | [
"BSD-3-Clause"
] | 1 | 2020-09-10T15:23:57.000Z | 2020-09-10T15:23:57.000Z | dask/array/core.py | adbmd/dask | 3327b2e158dbadf2057685fdb51b74ce3129416e | [
"BSD-3-Clause"
] | null | null | null | dask/array/core.py | adbmd/dask | 3327b2e158dbadf2057685fdb51b74ce3129416e | [
"BSD-3-Clause"
] | null | null | null | import math
import operator
import os
import pickle
import re
import sys
import traceback
import uuid
import warnings
from bisect import bisect
from collections.abc import Iterable, Iterator, Mapping
from functools import partial, wraps, reduce
from itertools import product, zip_longest
from numbers import Number, Inte... | 31.806043 | 95 | 0.58391 | import math
import operator
import os
import pickle
import re
import sys
import traceback
import uuid
import warnings
from bisect import bisect
from collections.abc import Iterable, Iterator, Mapping
from functools import partial, wraps, reduce
from itertools import product, zip_longest
from numbers import Number, Inte... | true | true |
f7512c23e6063882a4dd6f080698e741e9815af8 | 13,986 | py | Python | AI_Flappy.py | ShamimSuf/AI_FlappyBird_GeneticAlgo | 438da76b1327ef3167dea42706dce4aaeccc8136 | [
"MIT"
] | null | null | null | AI_Flappy.py | ShamimSuf/AI_FlappyBird_GeneticAlgo | 438da76b1327ef3167dea42706dce4aaeccc8136 | [
"MIT"
] | null | null | null | AI_Flappy.py | ShamimSuf/AI_FlappyBird_GeneticAlgo | 438da76b1327ef3167dea42706dce4aaeccc8136 | [
"MIT"
] | null | null | null | #This flappy will have 6 inputs (i1 to i6) : up, down, bird top-right to up-block-low-right, bird top-left to up-block-low-left, so on.
import numpy as np
import pygame
import time
import random
from random import randint
pygame.init()
#6 input nodes
i_ROW = 1
i_COL = 6
#3 hidden layer nodes
#input to hidden laye... | 31.358744 | 175 | 0.688832 |
import numpy as np
import pygame
import time
import random
from random import randint
pygame.init()
i_ROW = 1
i_COL = 6
w1_ROW = 6
w1_COL = 3
w2_ROW = 3
w2_COL = 1
class Colors:
def __init__(self):
self.black = (0,0,0)
self.white = (255,255,255)
self.cornflowerblue = (100,149,237)
self.azure4 = ... | true | true |
f7512d38c0667331fffccd5a4e7a6dc2a1dc89d2 | 1,286 | py | Python | fin_apis/alphavantage/ts.py | humdings/fin_apis | daffc9db782844b5895e013b4b41782a1b0cb24d | [
"MIT"
] | null | null | null | fin_apis/alphavantage/ts.py | humdings/fin_apis | daffc9db782844b5895e013b4b41782a1b0cb24d | [
"MIT"
] | null | null | null | fin_apis/alphavantage/ts.py | humdings/fin_apis | daffc9db782844b5895e013b4b41782a1b0cb24d | [
"MIT"
] | null | null | null | from alpha_vantage.timeseries import TimeSeries
from fin_apis.utils import multicall
from fin_apis.auth import AuthKeys
class AVTimeSeries(TimeSeries):
def __init__(self, key=None, output_format='pandas', treat_info_as_error=True, indexing_type='date', proxy=None,
rapidapi=False):
if ke... | 38.969697 | 116 | 0.699067 | from alpha_vantage.timeseries import TimeSeries
from fin_apis.utils import multicall
from fin_apis.auth import AuthKeys
class AVTimeSeries(TimeSeries):
def __init__(self, key=None, output_format='pandas', treat_info_as_error=True, indexing_type='date', proxy=None,
rapidapi=False):
if ke... | true | true |
f7512eac7e1d635849c4db8670bde28b537e3f4f | 563 | py | Python | sstkdj/soundscapes/migrations/0006_auto_20191105_0128.py | kitefishlabs/sstkdj | dc51a644dd6d41ea212dedd53e277e526581c7a7 | [
"BSD-3-Clause"
] | null | null | null | sstkdj/soundscapes/migrations/0006_auto_20191105_0128.py | kitefishlabs/sstkdj | dc51a644dd6d41ea212dedd53e277e526581c7a7 | [
"BSD-3-Clause"
] | 5 | 2020-06-06T00:36:25.000Z | 2021-06-10T19:22:01.000Z | sstkdj/soundscapes/migrations/0006_auto_20191105_0128.py | kitefishlabs/sstkdj | dc51a644dd6d41ea212dedd53e277e526581c7a7 | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 2.2.6 on 2019-11-05 01:28
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('soundscapes', '0005_regioncircle_owner'),
]
operations = [
migrations.Alte... | 26.809524 | 152 | 0.678508 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('soundscapes', '0005_regioncircle_owner'),
]
operations = [
migrations.AlterField(
model_name='regioncircle',
... | true | true |
f7512f61b438ac0268041aef7a0a827a085a0e7b | 7,933 | py | Python | urilib/compose.py | masayuko/urilib | 03de444f92fe9c3e03e71dde29c29c333e032e6c | [
"MIT"
] | null | null | null | urilib/compose.py | masayuko/urilib | 03de444f92fe9c3e03e71dde29c29c333e032e6c | [
"MIT"
] | null | null | null | urilib/compose.py | masayuko/urilib | 03de444f92fe9c3e03e71dde29c29c333e032e6c | [
"MIT"
] | null | null | null | import ipaddress
import numbers
import re
from collections import Iterable, Mapping
from .chars import SUB_DELIMS
from .encoding import uriencode, uriencode_plus, idnencode
from .split import uriunsplit
# RFC 3986 3.1: scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
_SCHEME_RE = re.compile(r"\A[A-Za-z][A-Za-z0-9... | 38.509709 | 78 | 0.643136 | import ipaddress
import numbers
import re
from collections import Iterable, Mapping
from .chars import SUB_DELIMS
from .encoding import uriencode, uriencode_plus, idnencode
from .split import uriunsplit
_SCHEME_RE = re.compile(r"\A[A-Za-z][A-Za-z0-9+.-]*\Z")
_AUTHORITY_RE_STRING = re.compile(r"\A(?:(.*)@)?(.*?)(?... | true | true |
f7513008f912c6c94c90305579b72f5615da9120 | 3,533 | py | Python | MPDA_decode/instance.py | Tesla2fox/MPDA-DE | 0a27d59ceba16d292fade01d95b1c1f336e5f604 | [
"MIT"
] | 1 | 2019-06-21T02:54:18.000Z | 2019-06-21T02:54:18.000Z | MPDA_decode/instance.py | Tesla2fox/MPDA-DE | 0a27d59ceba16d292fade01d95b1c1f336e5f604 | [
"MIT"
] | null | null | null | MPDA_decode/instance.py | Tesla2fox/MPDA-DE | 0a27d59ceba16d292fade01d95b1c1f336e5f604 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Sep 21 15:49:17 2018
@author: robot
"""
from readCfg import *
import numpy as np
from enum import Enum
class TaskModelType(Enum):
ExpModel = 1
LineModel = 2
class Instance(object):
def __init__(self, insFileName = 'wtf'):
self.insFileName = insFile... | 32.412844 | 96 | 0.585338 |
from readCfg import *
import numpy as np
from enum import Enum
class TaskModelType(Enum):
ExpModel = 1
LineModel = 2
class Instance(object):
def __init__(self, insFileName = 'wtf'):
self.insFileName = insFileName
readCfg = Read_Cfg(insFileName)
self.robNum = int(readCfg.getS... | true | true |
f7513105e011dd0116f07ba32cf579d74fad046f | 212 | py | Python | Python/Tests/TestData/TestExplorerPytest/test_ut.py | techkey/PTVS | 8355e67eedd8e915ca49bd38a2f36172696fd903 | [
"Apache-2.0"
] | 404 | 2019-05-07T02:21:57.000Z | 2022-03-31T17:03:04.000Z | Python/Tests/TestData/TestExplorerPytest/test_ut.py | techkey/PTVS | 8355e67eedd8e915ca49bd38a2f36172696fd903 | [
"Apache-2.0"
] | 1,672 | 2019-05-06T21:09:38.000Z | 2022-03-31T23:16:04.000Z | Python/Tests/TestData/TestExplorerPytest/test_ut.py | techkey/PTVS | 8355e67eedd8e915ca49bd38a2f36172696fd903 | [
"Apache-2.0"
] | 186 | 2019-05-13T03:17:37.000Z | 2022-03-31T16:24:05.000Z | import unittest
class TestClassUT(unittest.TestCase):
def test__ut_fail(self):
self.fail("Not implemented")
def test__ut_pass(self):
pass
if __name__ == '__main__':
unittest.main()
| 17.666667 | 37 | 0.669811 | import unittest
class TestClassUT(unittest.TestCase):
def test__ut_fail(self):
self.fail("Not implemented")
def test__ut_pass(self):
pass
if __name__ == '__main__':
unittest.main()
| true | true |
f75132750a663aa840d5e6ec2e0857d1c3b905c0 | 2,640 | py | Python | habanero/crossref/workscontainer.py | sckott/pydoi | 6052faaa7eba9e4447bc792b913ab434f15354a1 | [
"MIT"
] | null | null | null | habanero/crossref/workscontainer.py | sckott/pydoi | 6052faaa7eba9e4447bc792b913ab434f15354a1 | [
"MIT"
] | 1 | 2015-10-07T02:20:24.000Z | 2015-10-07T02:20:24.000Z | habanero/crossref/workscontainer.py | sckott/pydoi | 6052faaa7eba9e4447bc792b913ab434f15354a1 | [
"MIT"
] | null | null | null | class WorksContainer(object):
"""
WorksContainer: Class for working with works results
Usage::
from habanero import Crossref, WorksContainer
cr = Crossref()
res = cr.works(ids=['10.1136/jclinpath-2020-206745', '10.1136/esmoopen-2020-000776'])
x = WorksConta... | 32.195122 | 104 | 0.484091 | class WorksContainer(object):
def __init__(self, input):
super(WorksContainer, self).__init__()
if not input:
raise ValueError("input len must be > zero")
self.__input = input
self.works = self.works_handler(self.__input)
keys = list(self.works[0].keys())
... | true | true |
f751328765607ead45c009168e4edd7c11867731 | 1,197 | py | Python | topic_tutorial_py/setup.py | JaehyunShim/ros2_tutorial_py | ed94477341ae6053dbd126fe5092b5cbf44ffa89 | [
"Apache-2.0"
] | null | null | null | topic_tutorial_py/setup.py | JaehyunShim/ros2_tutorial_py | ed94477341ae6053dbd126fe5092b5cbf44ffa89 | [
"Apache-2.0"
] | null | null | null | topic_tutorial_py/setup.py | JaehyunShim/ros2_tutorial_py | ed94477341ae6053dbd126fe5092b5cbf44ffa89 | [
"Apache-2.0"
] | null | null | null | from setuptools import setup
package_name = 'topic_tutorial_py'
setup(
name=package_name,
version='0.0.0',
packages=[package_name],
data_files=[
('share/ament_index/resource_index/packages',
['resource/' + package_name]),
('share/' + package_name, ['package.xml']),
],
... | 35.205882 | 93 | 0.681704 | from setuptools import setup
package_name = 'topic_tutorial_py'
setup(
name=package_name,
version='0.0.0',
packages=[package_name],
data_files=[
('share/ament_index/resource_index/packages',
['resource/' + package_name]),
('share/' + package_name, ['package.xml']),
],
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.