hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f734952d147b46ad927cefd4be1d128cdb2b51af | 2,737 | py | Python | addons/website_event_track_quiz/controllers/event_track_quiz.py | SHIVJITH/Odoo_Machine_Test | 310497a9872db7844b521e6dab5f7a9f61d365a4 | [
"Apache-2.0"
] | null | null | null | addons/website_event_track_quiz/controllers/event_track_quiz.py | SHIVJITH/Odoo_Machine_Test | 310497a9872db7844b521e6dab5f7a9f61d365a4 | [
"Apache-2.0"
] | null | null | null | addons/website_event_track_quiz/controllers/event_track_quiz.py | SHIVJITH/Odoo_Machine_Test | 310497a9872db7844b521e6dab5f7a9f61d365a4 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import http
from odoo.addons.website_event_track.controllers.event_track import EventTrackController
from odoo.http import request
class WebsiteEventTrackQuiz(EventTrackController):
# QUIZZES IN PAGE
... | 38.549296 | 125 | 0.624772 |
from odoo import http
from odoo.addons.website_event_track.controllers.event_track import EventTrackController
from odoo.http import request
class WebsiteEventTrackQuiz(EventTrackController):
@http.route('/event_track/quiz/submit', type="json", auth="public", website=True)
def event_track_quiz_... | true | true |
f73495a0d58ed7ae3f20fa400fb3455f80fb91c1 | 1,985 | py | Python | WebSequenceDiagrams.py | ffesseler/sublimetext-websequencediagrams | 9c74fd0df40c70c8992da3a76c40e16b1640d5b4 | [
"Unlicense"
] | 2 | 2015-06-29T10:17:51.000Z | 2016-03-20T03:45:04.000Z | WebSequenceDiagrams.py | ffesseler/sublimetext-websequencediagrams | 9c74fd0df40c70c8992da3a76c40e16b1640d5b4 | [
"Unlicense"
] | null | null | null | WebSequenceDiagrams.py | ffesseler/sublimetext-websequencediagrams | 9c74fd0df40c70c8992da3a76c40e16b1640d5b4 | [
"Unlicense"
] | null | null | null | import sublime, sublime_plugin, urllib, re, tempfile, os, desktop
def getTempPreviewPath(view):
tmp_filename = '%s.png' % view.file_name()
tmp_fullpath = os.path.join(tempfile.gettempdir(), tmp_filename)
return tmp_fullpath
def getSequenceDiagram(text, outputFile, style = 'default'):
request = {}
req... | 30.075758 | 96 | 0.683627 | import sublime, sublime_plugin, urllib, re, tempfile, os, desktop
def getTempPreviewPath(view):
tmp_filename = '%s.png' % view.file_name()
tmp_fullpath = os.path.join(tempfile.gettempdir(), tmp_filename)
return tmp_fullpath
def getSequenceDiagram(text, outputFile, style = 'default'):
request = {}
req... | false | true |
f73495a37d6406b3857940888f4e06efccc9a7ee | 1,576 | py | Python | pykbart/writer.py | pybrarian/pykbart | f63318d21171bd116bd2b65dd8b792721fca237f | [
"MIT"
] | 4 | 2018-03-01T16:04:11.000Z | 2020-12-18T15:02:27.000Z | pykbart/writer.py | pybrarian/pykbart | f63318d21171bd116bd2b65dd8b792721fca237f | [
"MIT"
] | null | null | null | pykbart/writer.py | pybrarian/pykbart | f63318d21171bd116bd2b65dd8b792721fca237f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Class and context manager for writing KbartRecord class to csv file."""
# coding: utf-8
from __future__ import (absolute_import, division,
print_function, unicode_literals)
import contextlib
import six
import unicodecsv as csv
# TODO: make a better way to write the ... | 29.735849 | 80 | 0.641497 |
from __future__ import (absolute_import, division,
print_function, unicode_literals)
import contextlib
import six
import unicodecsv as csv
class Writer(object):
def __init__(self, file_handle, delimiter='\t'):
self.file_handle = file_handle
self.delimiter = delimiter... | true | true |
f73495b9d6fabeed2313bbb04c6dae3670bd398d | 2,169 | py | Python | fft_prototype.py | kobeeraveendran/hackfsu5 | 5614d832423f56913bd35d96e2472068a106b376 | [
"MIT"
] | null | null | null | fft_prototype.py | kobeeraveendran/hackfsu5 | 5614d832423f56913bd35d96e2472068a106b376 | [
"MIT"
] | null | null | null | fft_prototype.py | kobeeraveendran/hackfsu5 | 5614d832423f56913bd35d96e2472068a106b376 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
from scipy.io import wavfile # get the api
from scipy.fftpack import fft
from pylab import *
def f(filename):
# song files are in ogg... we need it to be in wav.
fs, data = wavfile.read(filename)
# songs have multiple channels, but we only need one channel
... | 28.92 | 96 | 0.656985 | import matplotlib.pyplot as plt
from scipy.io import wavfile
from scipy.fftpack import fft
from pylab import *
def f(filename):
fs, data = wavfile.read(filename)
a = data.T[0]
c = fft(a)
d = len(c)//2
return c
guitar =... | true | true |
f734970f81bbc8b2ca03df98f26a41b1af58a139 | 1,311 | py | Python | prompty.py | tnhung2011/WinPrompty | 8894588a15c5381f18e35420d6030ea6758b2a83 | [
"MIT"
] | null | null | null | prompty.py | tnhung2011/WinPrompty | 8894588a15c5381f18e35420d6030ea6758b2a83 | [
"MIT"
] | null | null | null | prompty.py | tnhung2011/WinPrompty | 8894588a15c5381f18e35420d6030ea6758b2a83 | [
"MIT"
] | null | null | null | import platform
from sys import exit
from os import system
from sys.stdin import isatty
from os.path import dirname, realpath
from colorama import init, Fore, Back
from tkinter.messagebox import showerror
if platform.system() is 'Windows':
__vista = platform.release == 'Vista'
__supported = platform.release >... | 57 | 695 | 0.704805 | import platform
from sys import exit
from os import system
from sys.stdin import isatty
from os.path import dirname, realpath
from colorama import init, Fore, Back
from tkinter.messagebox import showerror
if platform.system() is 'Windows':
__vista = platform.release == 'Vista'
__supported = platform.release >... | true | true |
f7349761ddcb587b48c0fa07f54c76785bb8990c | 10,737 | py | Python | yq/__init__.py | CoryG89/yq | b71f7fce761f60c07348dace218f59be9cc8942d | [
"Apache-2.0"
] | null | null | null | yq/__init__.py | CoryG89/yq | b71f7fce761f60c07348dace218f59be9cc8942d | [
"Apache-2.0"
] | null | null | null | yq/__init__.py | CoryG89/yq | b71f7fce761f60c07348dace218f59be9cc8942d | [
"Apache-2.0"
] | null | null | null | """
yq: Command-line YAML processor - jq wrapper for YAML documents
yq transcodes YAML documents to JSON and passes them to jq.
See https://github.com/kislyuk/yq for more information.
"""
# PYTHON_ARGCOMPLETE_OK
from __future__ import absolute_import, division, print_function, unicode_literals
import sys, argparse,... | 44.367769 | 146 | 0.582379 | """
yq: Command-line YAML processor - jq wrapper for YAML documents
yq transcodes YAML documents to JSON and passes them to jq.
See https://github.com/kislyuk/yq for more information.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import sys, argparse, subprocess, json
from ... | false | true |
f734988757cfc1649b03e5c17fecc7fc4eb23ada | 1,631 | py | Python | setup.py | team-mayes/common-python | e9173514bc19d1759ea3d85c632e0b07c8b1fff4 | [
"MIT"
] | null | null | null | setup.py | team-mayes/common-python | e9173514bc19d1759ea3d85c632e0b07c8b1fff4 | [
"MIT"
] | null | null | null | setup.py | team-mayes/common-python | e9173514bc19d1759ea3d85c632e0b07c8b1fff4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
'scipy', 'matplotlib', 'numpy', ... | 28.614035 | 76 | 0.646842 |
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
'scipy', 'matplotlib', 'numpy', 'six',
]
setup_requirements = [
]
test_requirements = [
... | true | true |
f73498f87da532f12917e9b45a0ec0d62a7c9eb8 | 2,822 | py | Python | src/googlexfr.py | rathbird/Birds_of_Prey_CNN_Classifier | 13ceb78db2408709804263395175482cff6c6973 | [
"MIT"
] | null | null | null | src/googlexfr.py | rathbird/Birds_of_Prey_CNN_Classifier | 13ceb78db2408709804263395175482cff6c6973 | [
"MIT"
] | null | null | null | src/googlexfr.py | rathbird/Birds_of_Prey_CNN_Classifier | 13ceb78db2408709804263395175482cff6c6973 | [
"MIT"
] | null | null | null | # import the necessary packages
import numpy as np
import tensorflow as tf
from tensorflow.keras.models import Model
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import BatchNormalization
from tensorflow.keras.layers import AveragePooling2D
from tensorflow.keras.layers import MaxPooling2D... | 32.068182 | 161 | 0.791637 |
import numpy as np
import tensorflow as tf
from tensorflow.keras.models import Model
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import BatchNormalization
from tensorflow.keras.layers import AveragePooling2D
from tensorflow.keras.layers import MaxPooling2D
from tensorflow.keras.layers i... | true | true |
f734999283b7c5d515772f9dd319e7240cd387ae | 22,417 | py | Python | noisemaker/cli.py | BumpierZulu9930/py-noisemaker | d67f03c9f42642dd7eb5b9fc0f79572dc0d3b1a9 | [
"Apache-2.0"
] | null | null | null | noisemaker/cli.py | BumpierZulu9930/py-noisemaker | d67f03c9f42642dd7eb5b9fc0f79572dc0d3b1a9 | [
"Apache-2.0"
] | null | null | null | noisemaker/cli.py | BumpierZulu9930/py-noisemaker | d67f03c9f42642dd7eb5b9fc0f79572dc0d3b1a9 | [
"Apache-2.0"
] | null | null | null | """Common CLI boilerplate for Noisemaker"""
import click
from noisemaker.constants import DistanceFunction, InterpolationType, PointDistribution, ValueDistribution, ValueMask, VoronoiDiagramType, WormBehavior
import noisemaker.masks as masks
# os.environ["TF_CPP_MIN_LOG_LEVEL"] = "1"
# os.environ["CUDA_VISIBLE_DEVI... | 30.170929 | 155 | 0.698354 |
import click
from noisemaker.constants import DistanceFunction, InterpolationType, PointDistribution, ValueDistribution, ValueMask, VoronoiDiagramType, WormBehavior
import noisemaker.masks as masks
CLICK_CONTEXT_SETTINGS = {"help_option_names": ["-h", "--help"], "max_content_width": 160}
ALPHA_BLENDING_HINT ... | true | true |
f73499beff1247bfebd0abc2a4dc89bbe5f9fdb4 | 26,521 | py | Python | chia/farmer/farmer_api.py | grayfallstown/chia-rosechain | fa09caba364aa1639b2a65020b4c312ff2d5b058 | [
"Apache-2.0"
] | null | null | null | chia/farmer/farmer_api.py | grayfallstown/chia-rosechain | fa09caba364aa1639b2a65020b4c312ff2d5b058 | [
"Apache-2.0"
] | null | null | null | chia/farmer/farmer_api.py | grayfallstown/chia-rosechain | fa09caba364aa1639b2a65020b4c312ff2d5b058 | [
"Apache-2.0"
] | null | null | null | import json
import time
from typing import Callable, Optional, List, Any, Dict
import aiohttp
from blspy import AugSchemeMPL, G2Element, PrivateKey
import chia.server.ws_connection as ws
from chia.consensus.pot_iterations import calculate_iterations_quality, calculate_sp_interval_iters
from chia.farmer.farmer import ... | 47.785586 | 118 | 0.558199 | import json
import time
from typing import Callable, Optional, List, Any, Dict
import aiohttp
from blspy import AugSchemeMPL, G2Element, PrivateKey
import chia.server.ws_connection as ws
from chia.consensus.pot_iterations import calculate_iterations_quality, calculate_sp_interval_iters
from chia.farmer.farmer import ... | true | true |
f73499e3d2fd9b89f3e965e012e39e09413e4f22 | 10,268 | py | Python | objectModel/Python/tests/utilities/projection_test_utils.py | QPC-database/CDM | ef9ffb5fe4b692c76eb03f57b222bf21ee976692 | [
"CC-BY-4.0",
"MIT"
] | 1 | 2021-07-06T17:08:15.000Z | 2021-07-06T17:08:15.000Z | objectModel/Python/tests/utilities/projection_test_utils.py | QPC-database/CDM | ef9ffb5fe4b692c76eb03f57b222bf21ee976692 | [
"CC-BY-4.0",
"MIT"
] | null | null | null | objectModel/Python/tests/utilities/projection_test_utils.py | QPC-database/CDM | ef9ffb5fe4b692c76eb03f57b222bf21ee976692 | [
"CC-BY-4.0",
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
import os
from typing import List, Optional
from cdm.enums import CdmLogCode, CdmObjectType, CdmStatusLevel
from cdm.utilities import AttributeResolutionDirectiveS... | 48.895238 | 215 | 0.708609 |
import os
from typing import List, Optional
from cdm.enums import CdmLogCode, CdmObjectType, CdmStatusLevel
from cdm.utilities import AttributeResolutionDirectiveSet, ResolveOptions
from tests.cdm.projection.attribute_context_util import AttributeContextUtil
from tests.common import TestHelper
shortened_directive... | true | true |
f7349ac7860f0c32e54eef76280f6a9d94e1c7a2 | 181 | py | Python | amocrm_api_client/token_provider/core/TokensBundle.py | iqtek/amocrm_api_client | 910ea42482698f5eb47d6b6e12d52ec09af77a3e | [
"MIT"
] | null | null | null | amocrm_api_client/token_provider/core/TokensBundle.py | iqtek/amocrm_api_client | 910ea42482698f5eb47d6b6e12d52ec09af77a3e | [
"MIT"
] | null | null | null | amocrm_api_client/token_provider/core/TokensBundle.py | iqtek/amocrm_api_client | 910ea42482698f5eb47d6b6e12d52ec09af77a3e | [
"MIT"
] | null | null | null | from dataclasses import dataclass
__all__ = [
"TokensBundle",
]
@dataclass(frozen=True)
class TokensBundle:
access_token: str
refresh_token: str
expires_in: int
| 12.928571 | 33 | 0.712707 | from dataclasses import dataclass
__all__ = [
"TokensBundle",
]
@dataclass(frozen=True)
class TokensBundle:
access_token: str
refresh_token: str
expires_in: int
| true | true |
f7349ad914f148f9269b50116b5c06d1ad5f3178 | 24,819 | py | Python | src/specCal.py | dp7-PU/QCLAS_public | 2b50d10bf7799df6cb4043db39a02014dc2de585 | [
"MIT"
] | 1 | 2019-08-29T23:48:06.000Z | 2019-08-29T23:48:06.000Z | src/specCal.py | dp7-PU/QCLAS_public | 2b50d10bf7799df6cb4043db39a02014dc2de585 | [
"MIT"
] | null | null | null | src/specCal.py | dp7-PU/QCLAS_public | 2b50d10bf7799df6cb4043db39a02014dc2de585 | [
"MIT"
] | null | null | null | """
Notes
-----
Calculate & Plot DAS using HAPI. This package can be used independently with
python script. An UI is also provided called qclasUI.py.
Author
------
Da Pan,
Department of Civil and Environmental Engineering,
Princeton University
Email: dp7@princeton.edu
Created Date
------------
02/10/2016
Edited Dat... | 31.983247 | 113 | 0.559652 | """
Notes
-----
Calculate & Plot DAS using HAPI. This package can be used independently with
python script. An UI is also provided called qclasUI.py.
Author
------
Da Pan,
Department of Civil and Environmental Engineering,
Princeton University
Email: dp7@princeton.edu
Created Date
------------
02/10/2016
Edited Dat... | false | true |
f7349cbb230ae123ae90e4772c877e8f5dc3d700 | 6,878 | py | Python | pytition/petition/helpers.py | bbmt-bbmt/Pytition | ccfa68d517a8a8b8adb9971e1948f2ab6ece2641 | [
"BSD-3-Clause"
] | 64 | 2019-03-07T15:32:37.000Z | 2022-03-13T19:05:44.000Z | pytition/petition/helpers.py | bbmt-bbmt/Pytition | ccfa68d517a8a8b8adb9971e1948f2ab6ece2641 | [
"BSD-3-Clause"
] | 157 | 2019-02-28T07:32:03.000Z | 2021-09-24T07:07:09.000Z | pytition/petition/helpers.py | bbmt-bbmt/Pytition | ccfa68d517a8a8b8adb9971e1948f2ab6ece2641 | [
"BSD-3-Clause"
] | 33 | 2019-04-14T23:40:33.000Z | 2022-03-25T11:11:05.000Z | import requests
import lxml
from lxml.html.clean import Cleaner
from django.http import Http404, HttpResponseForbidden
from django.conf import settings
from django.urls import reverse
from django.template.loader import render_to_string
from django.utils.html import strip_tags
from django.core.mail import get_connection... | 41.185629 | 128 | 0.692207 | import requests
import lxml
from lxml.html.clean import Cleaner
from django.http import Http404, HttpResponseForbidden
from django.conf import settings
from django.urls import reverse
from django.template.loader import render_to_string
from django.utils.html import strip_tags
from django.core.mail import get_connection... | true | true |
f7349dc08557faf1ca4d990092a7aaa988dd1752 | 3,342 | py | Python | naslib/search_spaces/nasbench1shot1/search_spaces/search_space_1.py | az2104nas/sztnb302alsr2bs21on | 6084c82c59a4a89498a191d96c231f47df10317d | [
"Apache-2.0"
] | null | null | null | naslib/search_spaces/nasbench1shot1/search_spaces/search_space_1.py | az2104nas/sztnb302alsr2bs21on | 6084c82c59a4a89498a191d96c231f47df10317d | [
"Apache-2.0"
] | 4 | 2021-06-08T21:32:32.000Z | 2022-03-12T00:29:33.000Z | naslib/search_spaces/nasbench1shot1/search_spaces/search_space_1.py | az2104nas/sztnb302alsr2bs21on | 6084c82c59a4a89498a191d96c231f47df10317d | [
"Apache-2.0"
] | null | null | null | import itertools
import matplotlib.pyplot as plt
import numpy as np
from nasbench import api
from naslib.search_spaces.nasbench1shot1.search_space import SearchSpace
from naslib.search_spaces.nasbench1shot1.utils import upscale_to_nasbench_format, OUTPUT_NODE, INPUT, CONV1X1, OUTPUT
from naslib.search_spaces.nasbench... | 42.846154 | 117 | 0.652902 | import itertools
import matplotlib.pyplot as plt
import numpy as np
from nasbench import api
from naslib.search_spaces.nasbench1shot1.search_space import SearchSpace
from naslib.search_spaces.nasbench1shot1.utils import upscale_to_nasbench_format, OUTPUT_NODE, INPUT, CONV1X1, OUTPUT
from naslib.search_spaces.nasbench... | true | true |
f7349e0eff85b16a75f6ae2e63116d3777b41f8f | 40,035 | py | Python | intersight/api/ntp_api.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 5 | 2021-12-16T15:13:32.000Z | 2022-03-29T16:09:54.000Z | intersight/api/ntp_api.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 4 | 2022-01-25T19:05:51.000Z | 2022-03-29T20:18:37.000Z | intersight/api/ntp_api.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 2 | 2020-07-07T15:01:08.000Z | 2022-01-31T04:27:35.000Z | """
Cisco Intersight
Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environments in more advan... | 45.494318 | 1,678 | 0.515524 |
import re
import sys
from intersight.api_client import ApiClient, Endpoint as _Endpoint
from intersight.model_utils import (
check_allowed_values,
check_validations,
date,
datetime,
file_type,
none_type,
validate_and_convert_types
)
from intersight.model.error import Error
from inte... | true | true |
f7349e1f31924a93f2969323365e9e84bd75b01f | 215 | py | Python | serverquest/__main__.py | paulomaateus/quest-backend | 96c5cdfd1e967e0c1702dcd0ec97a1dfbe8d7ba9 | [
"MIT"
] | null | null | null | serverquest/__main__.py | paulomaateus/quest-backend | 96c5cdfd1e967e0c1702dcd0ec97a1dfbe8d7ba9 | [
"MIT"
] | null | null | null | serverquest/__main__.py | paulomaateus/quest-backend | 96c5cdfd1e967e0c1702dcd0ec97a1dfbe8d7ba9 | [
"MIT"
] | null | null | null | from urllib.parse import urlparse
from . app import app
from . sqlite import setup_bd
url = urlparse('http://0.0.0.0:8000')
host, port = url.hostname, url.port
setup_bd()
app.run(host=host, port=port, debug=True)
| 21.5 | 41 | 0.730233 | from urllib.parse import urlparse
from . app import app
from . sqlite import setup_bd
url = urlparse('http://0.0.0.0:8000')
host, port = url.hostname, url.port
setup_bd()
app.run(host=host, port=port, debug=True)
| true | true |
f7349ece7e2828de32c74fa1e7bd0cd3f51274ad | 2,227 | py | Python | apispec/compat.py | theirix/apispec-py35-compat | 5aead501eb19997f8483192b0e4e4ac0f6ad9398 | [
"MIT"
] | null | null | null | apispec/compat.py | theirix/apispec-py35-compat | 5aead501eb19997f8483192b0e4e4ac0f6ad9398 | [
"MIT"
] | null | null | null | apispec/compat.py | theirix/apispec-py35-compat | 5aead501eb19997f8483192b0e4e4ac0f6ad9398 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import sys
import itertools
import functools
import inspect
PY2 = int(sys.version_info[0]) == 2
PY26 = PY2 and int(sys.version_info[1]) < 7
if PY2:
import urlparse
urlparse = urlparse
text_type = unicode
binary_type = str
string_types = (str, unicode)
unicode = unicode
... | 32.275362 | 79 | 0.667265 |
import sys
import itertools
import functools
import inspect
PY2 = int(sys.version_info[0]) == 2
PY26 = PY2 and int(sys.version_info[1]) < 7
if PY2:
import urlparse
urlparse = urlparse
text_type = unicode
binary_type = str
string_types = (str, unicode)
unicode = unicode
basestring = basest... | true | true |
f734a025203a7f4ca05ab44024b66da56788db5b | 1,357 | py | Python | algorithms/leetcode/contest/83/829.py | bigfoolliu/liu_aistuff | aa661d37c05c257ee293285dd0868fb7e8227628 | [
"MIT"
] | 1 | 2019-11-25T07:23:42.000Z | 2019-11-25T07:23:42.000Z | algorithms/leetcode/contest/83/829.py | bigfoolliu/liu_aistuff | aa661d37c05c257ee293285dd0868fb7e8227628 | [
"MIT"
] | 13 | 2020-01-07T16:09:47.000Z | 2022-03-02T12:51:44.000Z | algorithms/leetcode/contest/83/829.py | bigfoolliu/liu_aistuff | aa661d37c05c257ee293285dd0868fb7e8227628 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
# author: bigfoolliu
"""
829. 连续整数求和
给定一个正整数 N,试求有多少组连续正整数满足所有数字之和为 N?
示例 1:
输入: 5
输出: 2
解释: 5 = 5 = 2 + 3,共有两组连续整数([5],[2,3])求和后为 5。
示例 2:
输入: 9
输出: 3
解释: 9 = 9 = 4 + 5 = 2 + 3 + 4
示例 3:
输入: 15
输出: 4
解释: 15 = 15 = 8 + 7 = 4 + 5 + 6 = 1 + 2 + 3 + 4 + 5
middle_ret肯定为有... | 17.177215 | 76 | 0.553427 |
import unittest
class Solution:
def consecutiveNumbersSum(self, N):
ret = 1
for i in range(0, ):
pass
return ret
class TestDemo(unittest.TestCase):
def setUp(self):
self.solution = Solution().consecutiveNumbersSum
def test1... | true | true |
f734a0f335eab1452a47e6cc480befd545d92da6 | 1,921 | py | Python | doc/source/conf.py | Sushil-Thapa/rectif.ai | b308f613402097dca9734806a8c27ba3eef6a358 | [
"Apache-2.0"
] | null | null | null | doc/source/conf.py | Sushil-Thapa/rectif.ai | b308f613402097dca9734806a8c27ba3eef6a358 | [
"Apache-2.0"
] | null | null | null | doc/source/conf.py | Sushil-Thapa/rectif.ai | b308f613402097dca9734806a8c27ba3eef6a358 | [
"Apache-2.0"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 33.701754 | 79 | 0.664758 |
import os
import sys
sys.path.insert(0, os.path.abspath('../..'))
sys.setrecursionlimit(1500)
project = 'Rectif.ai'
copyright = '2019, Sushil Thapa'
author = 'Sushil Thapa'
release = '0.1'
extensions = [
]
templates_path = ['_templates']
exclude_patterns = []
html_theme = 'ala... | true | true |
f734a1ebae840c7bfd5231e3e270bc9608b6839a | 3,454 | py | Python | mvdcim/mvdcim.py | rstms/mvdcim | 52b5a6849e393eeb749e82af2f7d42a08e8607f1 | [
"MIT"
] | null | null | null | mvdcim/mvdcim.py | rstms/mvdcim | 52b5a6849e393eeb749e82af2f7d42a08e8607f1 | [
"MIT"
] | null | null | null | mvdcim/mvdcim.py | rstms/mvdcim | 52b5a6849e393eeb749e82af2f7d42a08e8607f1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from arrow import Arrow
from pathlib import Path
from os import environ
from subprocess import run
from tempfile import mkdtemp
from shutil import rmtree
from pprint import pprint
class DCIM():
def __init__(self, device=None, source=None, target=None, confirm=False, date_path=True):
... | 31.981481 | 116 | 0.601332 |
from arrow import Arrow
from pathlib import Path
from os import environ
from subprocess import run
from tempfile import mkdtemp
from shutil import rmtree
from pprint import pprint
class DCIM():
def __init__(self, device=None, source=None, target=None, confirm=False, date_path=True):
self.device=device o... | true | true |
f734a2b46083402b4cce7977cf19d6a06b6757d4 | 431 | py | Python | src/helpers/diagnostic_helpers.py | Freudenberger/NeuralNetworks | 5390cdb7b0fe99487b12a95e32f0aa5954239b99 | [
"MIT"
] | null | null | null | src/helpers/diagnostic_helpers.py | Freudenberger/NeuralNetworks | 5390cdb7b0fe99487b12a95e32f0aa5954239b99 | [
"MIT"
] | null | null | null | src/helpers/diagnostic_helpers.py | Freudenberger/NeuralNetworks | 5390cdb7b0fe99487b12a95e32f0aa5954239b99 | [
"MIT"
] | null | null | null | import time
import helper
def time_measure(func):
"""
Decorator function to measure time
"""
def inner(*args_, **kwargs_):
"""
args_ contains: [team_id, ...]
"""
t0_ = time.time()
output = func(*args_, **kwargs_)
print("[{0}] Execution time of '{1}': {2}... | 23.944444 | 120 | 0.554524 | import time
import helper
def time_measure(func):
def inner(*args_, **kwargs_):
t0_ = time.time()
output = func(*args_, **kwargs_)
print("[{0}] Execution time of '{1}': {2} [s]".format(helper.get_date_time(), func.__name__, time.time() - t0_))
return output
return inner
| true | true |
f734a3c3651d6e1ef3e606899db9702c59c70e07 | 13,974 | py | Python | google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc.py | danielcressman/python-vision | ca56a71bda813ae6cfa386322e80a3e36852c3ef | [
"Apache-2.0"
] | null | null | null | google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc.py | danielcressman/python-vision | ca56a71bda813ae6cfa386322e80a3e36852c3ef | [
"Apache-2.0"
] | null | null | null | google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc.py | danielcressman/python-vision | ca56a71bda813ae6cfa386322e80a3e36852c3ef | [
"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... | 44.503185 | 94 | 0.64527 |
import warnings
from typing import Callable, Dict, Optional, Sequence, Tuple, Union
from google.api_core import grpc_helpers
from google.api_core import operations_v1
from google.api_core import gapic_v1
import google.auth
from google.auth import credentials as ga_credentials
from google.auth.... | true | true |
f734a3c8c618e126ea427c6d178a8945d777e923 | 2,707 | py | Python | .test-infra/metrics/sync/github/queries.py | charithe/beam | f085cb500730cf0c67c467ac55f92b3c59f52b39 | [
"Apache-2.0"
] | 5,279 | 2016-12-29T04:00:44.000Z | 2022-03-31T22:56:45.000Z | .test-infra/metrics/sync/github/queries.py | charithe/beam | f085cb500730cf0c67c467ac55f92b3c59f52b39 | [
"Apache-2.0"
] | 14,149 | 2016-12-28T00:43:50.000Z | 2022-03-31T23:50:22.000Z | .test-infra/metrics/sync/github/queries.py | charithe/beam | f085cb500730cf0c67c467ac55f92b3c59f52b39 | [
"Apache-2.0"
] | 3,763 | 2016-12-29T04:06:10.000Z | 2022-03-31T22:25:49.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 23.136752 | 124 | 0.437754 |
MAIN_PR_QUERY = '''
query {
search(query: "type:pr repo:apache/beam updated:><TemstampSubstitueLocation> sort:updated-asc", type: ISSUE, first: 100) {
issueCount
pageInfo {
endCursor
startCursor
hasNextPage
hasPreviousPage
}
edges {
cursor
node {
... | true | true |
f734a533801bb1e548cef8bab38a285b3de00bb5 | 6,591 | py | Python | feature_engineering.py | pintotomas/orgaDatosTP2 | 98f59d364e9e8321cac360206b104ef5730b87ed | [
"MIT"
] | null | null | null | feature_engineering.py | pintotomas/orgaDatosTP2 | 98f59d364e9e8321cac360206b104ef5730b87ed | [
"MIT"
] | null | null | null | feature_engineering.py | pintotomas/orgaDatosTP2 | 98f59d364e9e8321cac360206b104ef5730b87ed | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import pandas as pd
import numpy as np
def propiedad_tiene(cualidades, propiedad):
"""Devuelve un 1 si la propiedad tiene alguna de las cualidades en 'cualidades', 0 si no."""
tiene_cualidad = False
if not(pd.isnull(propiedad["description"])):
descripcion = propiedad["descri... | 44.836735 | 284 | 0.660143 |
import pandas as pd
import numpy as np
def propiedad_tiene(cualidades, propiedad):
"""Devuelve un 1 si la propiedad tiene alguna de las cualidades en 'cualidades', 0 si no."""
tiene_cualidad = False
if not(pd.isnull(propiedad["description"])):
descripcion = propiedad["description"]
descripcion.re... | false | true |
f734a66e2c9c3a9152513b54ee2173267e0546dc | 222 | py | Python | wall_properties.py | sundeep110/revitforarchitects | 6aebdf6ca3c381688659dd32462b494c36c24b37 | [
"Apache-2.0"
] | 1 | 2018-04-14T13:30:50.000Z | 2018-04-14T13:30:50.000Z | wall_properties.py | sundeep110/revitforarchitects | 6aebdf6ca3c381688659dd32462b494c36c24b37 | [
"Apache-2.0"
] | null | null | null | wall_properties.py | sundeep110/revitforarchitects | 6aebdf6ca3c381688659dd32462b494c36c24b37 | [
"Apache-2.0"
] | null | null | null | filteredElementCollector = FilteredElementCollector(doc)
walls = filteredElementCollector.OfClass(Wall)
for wall in walls:
for parameter in wall.Parameters:
print parameter.Definition.Name, parameter.AsValueString()
| 37 | 62 | 0.824324 | filteredElementCollector = FilteredElementCollector(doc)
walls = filteredElementCollector.OfClass(Wall)
for wall in walls:
for parameter in wall.Parameters:
print parameter.Definition.Name, parameter.AsValueString()
| false | true |
f734a6e1fdf6fe69c8627fb3e248786bf735f7b7 | 4,892 | py | Python | tests/handlers/influxdb_test.py | slaclab/gafaelfawr | 7a64b0f159003d4745531c89d5b0f7d9777f7bce | [
"MIT"
] | null | null | null | tests/handlers/influxdb_test.py | slaclab/gafaelfawr | 7a64b0f159003d4745531c89d5b0f7d9777f7bce | [
"MIT"
] | null | null | null | tests/handlers/influxdb_test.py | slaclab/gafaelfawr | 7a64b0f159003d4745531c89d5b0f7d9777f7bce | [
"MIT"
] | null | null | null | """Tests for the ``/auth/tokens/influxdb`` route."""
from __future__ import annotations
from pathlib import Path
from unittest.mock import ANY
import jwt
import pytest
from _pytest.logging import LogCaptureFixture
from httpx import AsyncClient
from gafaelfawr.config import Config
from gafaelfawr.factory import Comp... | 29.119048 | 78 | 0.600164 |
from __future__ import annotations
from pathlib import Path
from unittest.mock import ANY
import jwt
import pytest
from _pytest.logging import LogCaptureFixture
from httpx import AsyncClient
from gafaelfawr.config import Config
from gafaelfawr.factory import ComponentFactory
from ..support.constants import TEST_HO... | true | true |
f734a7810a7e04bf77d068a86ee4ed61a560a6e3 | 2,872 | py | Python | bench_utils/timeit.py | drkostas/bench-utils | 0ec976238175ee8137a54101e679f0faf58996b9 | [
"Apache-2.0"
] | 3 | 2021-12-22T14:29:17.000Z | 2022-01-26T21:21:36.000Z | bench_utils/timeit.py | drkostas/bench-utils | 0ec976238175ee8137a54101e679f0faf58996b9 | [
"Apache-2.0"
] | null | null | null | bench_utils/timeit.py | drkostas/bench-utils | 0ec976238175ee8137a54101e679f0faf58996b9 | [
"Apache-2.0"
] | null | null | null | from contextlib import ContextDecorator
from typing import Callable, IO, Union
from functools import wraps
from time import time
from termcolor_logger import ColorLogger
time_logger = ColorLogger('Timeit', 'white')
class timeit(ContextDecorator):
custom_print: str
skip: bool
total: Union[float, None]
... | 35.02439 | 101 | 0.55188 | from contextlib import ContextDecorator
from typing import Callable, IO, Union
from functools import wraps
from time import time
from termcolor_logger import ColorLogger
time_logger = ColorLogger('Timeit', 'white')
class timeit(ContextDecorator):
custom_print: str
skip: bool
total: Union[float, None]
... | true | true |
f734a811ed32e5cecdcde508cdef13f526385529 | 120,801 | py | Python | menpowidgets/base.py | apapaion/menpowidgets | 237a39ddf4e65c57e8165f8a87f25a25f34d4698 | [
"BSD-3-Clause"
] | null | null | null | menpowidgets/base.py | apapaion/menpowidgets | 237a39ddf4e65c57e8165f8a87f25a25f34d4698 | [
"BSD-3-Clause"
] | null | null | null | menpowidgets/base.py | apapaion/menpowidgets | 237a39ddf4e65c57e8165f8a87f25a25f34d4698 | [
"BSD-3-Clause"
] | null | null | null | from collections import Sized, OrderedDict
import matplotlib.pyplot as plt
from matplotlib import collections as mc
import numpy as np
import ipywidgets
import IPython.display as ipydisplay
from menpo.base import name_of_callable
from menpo.image import MaskedImage, Image
from menpo.image.base import _convert_patches... | 42.550546 | 88 | 0.631021 | from collections import Sized, OrderedDict
import matplotlib.pyplot as plt
from matplotlib import collections as mc
import numpy as np
import ipywidgets
import IPython.display as ipydisplay
from menpo.base import name_of_callable
from menpo.image import MaskedImage, Image
from menpo.image.base import _convert_patches... | true | true |
f734a86b72c070548e64cd2ada2afc4598dd3bb2 | 758 | py | Python | resources/lib/streamlink/plugins/rtlxl.py | rrosajp/script.module.streamlink-1 | 2ad5076c9c4c38288af94825064cc471da8142d8 | [
"BSD-2-Clause"
] | 1 | 2021-04-25T16:09:09.000Z | 2021-04-25T16:09:09.000Z | resources/lib/streamlink/plugins/rtlxl.py | rrosajp/script.module.streamlink-1 | 2ad5076c9c4c38288af94825064cc471da8142d8 | [
"BSD-2-Clause"
] | null | null | null | resources/lib/streamlink/plugins/rtlxl.py | rrosajp/script.module.streamlink-1 | 2ad5076c9c4c38288af94825064cc471da8142d8 | [
"BSD-2-Clause"
] | null | null | null | import re
import json
from streamlink.plugin import Plugin
from streamlink.stream import HLSStream
_url_re = re.compile(r"http(?:s)?://(?:\w+\.)?rtl.nl/video/(?P<uuid>.*?)\Z", re.IGNORECASE)
class rtlxl(Plugin):
@classmethod
def can_handle_url(cls, url):
return _url_re.match(url)
def _get_strea... | 26.137931 | 93 | 0.666227 | import re
import json
from streamlink.plugin import Plugin
from streamlink.stream import HLSStream
_url_re = re.compile(r"http(?:s)?://(?:\w+\.)?rtl.nl/video/(?P<uuid>.*?)\Z", re.IGNORECASE)
class rtlxl(Plugin):
@classmethod
def can_handle_url(cls, url):
return _url_re.match(url)
def _get_strea... | true | true |
f734aab43acf3765f95a4b2ab60c56fad32168bf | 1,577 | py | Python | CodeSignal/Challenges/MZ/06_Quest_Efficiency_Item.py | Zubieta/CPP | fb4a3cbf2e4edcc590df15663cd28fb9ecab679c | [
"MIT"
] | 8 | 2017-03-02T07:56:45.000Z | 2021-08-07T20:20:19.000Z | CodeSignal/Challenges/MZ/06_Quest_Efficiency_Item.py | zubie7a/Algorithms | fb4a3cbf2e4edcc590df15663cd28fb9ecab679c | [
"MIT"
] | null | null | null | CodeSignal/Challenges/MZ/06_Quest_Efficiency_Item.py | zubie7a/Algorithms | fb4a3cbf2e4edcc590df15663cd28fb9ecab679c | [
"MIT"
] | 1 | 2021-08-07T20:20:20.000Z | 2021-08-07T20:20:20.000Z | # https://app.codesignal.com/company-challenges/mz/zCYv3tuxRE4JajQNY
def questEfficiencyItem(hours, points, time_for_quests):
# Time is short, you want to complete as many quests as possible
# but it's difficult to do so. So we want to maximize the points
# we can obtain with quests in a given limited time.... | 43.805556 | 82 | 0.665821 |
def questEfficiencyItem(hours, points, time_for_quests):
# we can obtain with quests in a given limited time.
# hours: hours it takes to complete a quest
# points: points each quest gives you
# time_for_quests: the limit of time to do stuff.
# Recursively, at each position, decide whethe... | true | true |
f734aabe587346d3ad0a9925c9abf6d5c2409b63 | 19,460 | py | Python | angr-management/angrmanagement/ui/widgets/qdisasm_graph.py | Ruide/angr-dev | 964dc80c758e25c698c2cbcc454ef5954c5fa0a0 | [
"BSD-2-Clause"
] | null | null | null | angr-management/angrmanagement/ui/widgets/qdisasm_graph.py | Ruide/angr-dev | 964dc80c758e25c698c2cbcc454ef5954c5fa0a0 | [
"BSD-2-Clause"
] | null | null | null | angr-management/angrmanagement/ui/widgets/qdisasm_graph.py | Ruide/angr-dev | 964dc80c758e25c698c2cbcc454ef5954c5fa0a0 | [
"BSD-2-Clause"
] | null | null | null |
from functools import wraps
import logging
from PySide.QtCore import QPointF, QRectF, Qt, QPoint
from PySide.QtGui import QPainter, QBrush, QColor, QApplication, QMouseEvent, QResizeEvent, QPen
from ...utils import get_out_branches
from ...utils.graph_layouter import GraphLayouter
from ...utils.cfg import categorize... | 32.651007 | 116 | 0.593885 |
from functools import wraps
import logging
from PySide.QtCore import QPointF, QRectF, Qt, QPoint
from PySide.QtGui import QPainter, QBrush, QColor, QApplication, QMouseEvent, QResizeEvent, QPen
from ...utils import get_out_branches
from ...utils.graph_layouter import GraphLayouter
from ...utils.cfg import categorize... | false | true |
f734ab273b7cc42f0ec809fb4d69086c50c004da | 4,047 | py | Python | tests/_fixers/_stdlib.py | eldorplus/importlib | 48047b7de74c0e75fecbc0b846864e523e57ecc6 | [
"PSF-2.0",
"BSD-2-Clause"
] | null | null | null | tests/_fixers/_stdlib.py | eldorplus/importlib | 48047b7de74c0e75fecbc0b846864e523e57ecc6 | [
"PSF-2.0",
"BSD-2-Clause"
] | null | null | null | tests/_fixers/_stdlib.py | eldorplus/importlib | 48047b7de74c0e75fecbc0b846864e523e57ecc6 | [
"PSF-2.0",
"BSD-2-Clause"
] | null | null | null | import os
import shutil
import sys
import tempfile
import types
from importlib2._fixers import (swap, SimpleNamespace, new_class,
_thread, builtins)
from importlib2._fixers._modules import mod_from_ns
def fix_builtins(builtins=builtins):
sys.modules.setdefault('builtins', builtins... | 28.702128 | 77 | 0.604151 | import os
import shutil
import sys
import tempfile
import types
from importlib2._fixers import (swap, SimpleNamespace, new_class,
_thread, builtins)
from importlib2._fixers._modules import mod_from_ns
def fix_builtins(builtins=builtins):
sys.modules.setdefault('builtins', builtins... | true | true |
f734ac2fb9831a1d3787413031ed1eda99d96841 | 1,869 | py | Python | daemons/build_tf_deploy_config.py | ucsc-cgp/cgp-data-store | 1d583d654a07a14df0c566a66fb6ba574be36cbc | [
"MIT"
] | 46 | 2017-03-24T15:56:09.000Z | 2021-03-15T19:49:07.000Z | daemons/build_tf_deploy_config.py | ucsc-cgp/cgp-data-store | 1d583d654a07a14df0c566a66fb6ba574be36cbc | [
"MIT"
] | 1,799 | 2017-04-04T17:54:28.000Z | 2020-11-19T12:30:13.000Z | daemons/build_tf_deploy_config.py | ucsc-cgp/cgp-data-store | 1d583d654a07a14df0c566a66fb6ba574be36cbc | [
"MIT"
] | 13 | 2017-03-27T23:49:35.000Z | 2021-01-18T07:39:49.000Z | #!/usr/bin/env python
"""
This script generates Terraform scripting needed for daemons that deploy infrastructure.
"""
import os
import glob
import json
import boto3
import argparse
daemons_root = os.path.abspath(os.path.dirname(__file__))
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("... | 26.7 | 98 | 0.702515 |
import os
import glob
import json
import boto3
import argparse
daemons_root = os.path.abspath(os.path.dirname(__file__))
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("daemon")
args = parser.parse_args()
env_vars_to_lambda = os.environ['EXPORT_ENV_VARS_TO_LAMBDA'].split()
terraform... | true | true |
f734ac3225b00088002daa226213683a43e43d53 | 8,450 | py | Python | view/__init__.py | mstrechen/pacman | fc9b609857476588fa269dff4acee744f51d9fbb | [
"MIT"
] | null | null | null | view/__init__.py | mstrechen/pacman | fc9b609857476588fa269dff4acee744f51d9fbb | [
"MIT"
] | null | null | null | view/__init__.py | mstrechen/pacman | fc9b609857476588fa269dff4acee744f51d9fbb | [
"MIT"
] | null | null | null | import typing as t
import pygame
from labyrinth.labyrinth import Labyrinth
from view.banana import Banana
from view.dot import Dot
from view.ghost import Ghost
from view.pacman import Pacman
MAX_DISPLAY_WIDTH = 1000
MAX_DISPLAY_HEIGHT = 500
class View:
cell_size: int
sprites: t.Dict[str, pygame.sprite.Spri... | 38.235294 | 122 | 0.539053 | import typing as t
import pygame
from labyrinth.labyrinth import Labyrinth
from view.banana import Banana
from view.dot import Dot
from view.ghost import Ghost
from view.pacman import Pacman
MAX_DISPLAY_WIDTH = 1000
MAX_DISPLAY_HEIGHT = 500
class View:
cell_size: int
sprites: t.Dict[str, pygame.sprite.Spri... | true | true |
f734ac4222c50c3f665746f358b2578f221a455c | 4,696 | py | Python | tools/utils/crawl_urls.py | p3t3r67x0/purple_jo | a58e89c8597aaa612b3f2784ff3259342b7b9fe6 | [
"MIT"
] | 8 | 2020-03-25T21:06:14.000Z | 2022-02-17T03:22:06.000Z | tools/utils/crawl_urls.py | webtobesocial/purple_jo | a58e89c8597aaa612b3f2784ff3259342b7b9fe6 | [
"MIT"
] | 7 | 2021-03-31T19:31:44.000Z | 2022-03-12T00:08:20.000Z | tools/utils/crawl_urls.py | webtobesocial/purple_jo | a58e89c8597aaa612b3f2784ff3259342b7b9fe6 | [
"MIT"
] | 3 | 2020-11-21T22:07:08.000Z | 2021-11-03T09:10:49.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import re
import time
import requests
import multiprocessing
import argparse
from lxml import html
from urllib.parse import urljoin
from urllib.parse import urlparse
from fake_useragent import UserAgent
from lxml.etree import ParserError
from lxml.etree import XMLSyntaxE... | 28.460606 | 147 | 0.664608 |
import re
import time
import requests
import multiprocessing
import argparse
from lxml import html
from urllib.parse import urljoin
from urllib.parse import urlparse
from fake_useragent import UserAgent
from lxml.etree import ParserError
from lxml.etree import XMLSyntaxError
from requests.exceptions import Timeout... | true | true |
f734ae1b367f0cd2d5054b2947d084a9683c0171 | 2,106 | py | Python | multilingual_t5/baseline_mr/baseline_mr.py | sumanthd17/mt5 | c99b4e3ad1c69908c852c730a1323ccb52d48f58 | [
"Apache-2.0"
] | null | null | null | multilingual_t5/baseline_mr/baseline_mr.py | sumanthd17/mt5 | c99b4e3ad1c69908c852c730a1323ccb52d48f58 | [
"Apache-2.0"
] | null | null | null | multilingual_t5/baseline_mr/baseline_mr.py | sumanthd17/mt5 | c99b4e3ad1c69908c852c730a1323ccb52d48f58 | [
"Apache-2.0"
] | null | null | null | """baseline_mr dataset."""
import tensorflow_datasets as tfds
import tensorflow as tf
# TODO(baseline_mr): Markdown description that will appear on the catalog page.
_DESCRIPTION = """
Description is **formatted** as markdown.
It should also contain any processing which has been applied (if any),
(e.g. corrupted ex... | 33.967742 | 136 | 0.672365 |
import tensorflow_datasets as tfds
import tensorflow as tf
_DESCRIPTION = """
Description is **formatted** as markdown.
It should also contain any processing which has been applied (if any),
(e.g. corrupted example skipped, images cropped,...):
"""
_CITATION = """
"""
class BaselineMr(tfds.core.GeneratorBasedBu... | true | true |
f734ae3edb3e3e64c8d186b6444c1c175228a9b2 | 4,769 | py | Python | lib-dynload/_recordclass/lib/recordclass/test/test_litelist.py | tabulon-ext/dedupsqlfs | 9dfbed17450e7f2a499a7381e0368d08ae3c700d | [
"MIT"
] | 22 | 2015-04-09T09:00:00.000Z | 2022-03-23T00:16:04.000Z | lib-dynload/_recordclass/lib/recordclass/test/test_litelist.py | tabulon-ext/dedupsqlfs | 9dfbed17450e7f2a499a7381e0368d08ae3c700d | [
"MIT"
] | 119 | 2015-02-11T21:39:27.000Z | 2021-07-27T23:04:49.000Z | lib-dynload/_recordclass/lib/recordclass/test/test_litelist.py | tabulon-ext/dedupsqlfs | 9dfbed17450e7f2a499a7381e0368d08ae3c700d | [
"MIT"
] | 7 | 2016-03-16T11:53:45.000Z | 2022-02-24T13:47:31.000Z | import unittest
from recordclass import litelist
import gc
import pickle
import sys
class litelistTest(unittest.TestCase):
def test_len(self):
a = litelist([])
self.assertEqual(len(a), 0)
a = litelist([1])
self.assertEqual(len(a), 1)
def test_items(self):
a = ... | 28.728916 | 66 | 0.528413 | import unittest
from recordclass import litelist
import gc
import pickle
import sys
class litelistTest(unittest.TestCase):
def test_len(self):
a = litelist([])
self.assertEqual(len(a), 0)
a = litelist([1])
self.assertEqual(len(a), 1)
def test_items(self):
a = ... | true | true |
f734afa1170846a895fc159dcf6c25886daf9a07 | 3,509 | py | Python | gnes/preprocessor/video/shotdetect.py | dixiak/gnes | 12513d29157a06bd22923717fd0c19a856f20193 | [
"Apache-2.0"
] | null | null | null | gnes/preprocessor/video/shotdetect.py | dixiak/gnes | 12513d29157a06bd22923717fd0c19a856f20193 | [
"Apache-2.0"
] | null | null | null | gnes/preprocessor/video/shotdetect.py | dixiak/gnes | 12513d29157a06bd22923717fd0c19a856f20193 | [
"Apache-2.0"
] | null | null | null | # Tencent is pleased to support the open source community by making GNES available.
#
# Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a... | 37.329787 | 94 | 0.620405 |
from typing import List
import numpy as np
from ..base import BaseVideoPreprocessor
from ..helper import compute_descriptor, compare_descriptor, detect_peak_boundary, compare_ecr
from ..io_utils import video as video_util
from ...proto import gnes_pb2, array2blob
class ShotDetectPreprocessor(BaseVide... | true | true |
f734afad97f1d8801b5285aa420eeebbfb4adc49 | 6,967 | py | Python | src/flappy_bird_gym/envs/flappy_bird_env_simple.py | chokyzhou/gym-flappy-bird | ffe1089501f3e2e113a8868cd27480653dbe0ef7 | [
"MIT"
] | null | null | null | src/flappy_bird_gym/envs/flappy_bird_env_simple.py | chokyzhou/gym-flappy-bird | ffe1089501f3e2e113a8868cd27480653dbe0ef7 | [
"MIT"
] | null | null | null | src/flappy_bird_gym/envs/flappy_bird_env_simple.py | chokyzhou/gym-flappy-bird | ffe1089501f3e2e113a8868cd27480653dbe0ef7 | [
"MIT"
] | null | null | null | #
# Copyright (c) 2020 Gabriel Nogueira (Talendar)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge... | 39.140449 | 80 | 0.604564 |
from typing import Dict, Tuple, Optional, Union
import gym
import numpy as np
import pygame
from flappy_bird_gym.envs.game_logic import FlappyBirdLogic
from flappy_bird_gym.envs.game_logic import PIPE_WIDTH, PIPE_HEIGHT
from flappy_bird_gym.envs.game_logic import PLAYER_WIDTH, PLAYER_HEIGHT
fro... | true | true |
f734afd4fd2b3089c11565e92f2a38f6324a6e63 | 4,769 | py | Python | pkg/ampcor/products/OffsetMap.py | aivazis/ampcor | a673e6fd12ac29086c88002ce999a8eabdf406cd | [
"BSD-2-Clause"
] | 3 | 2018-12-16T14:16:51.000Z | 2020-11-12T17:33:02.000Z | pkg/ampcor/products/OffsetMap.py | aivazis/ampcor | a673e6fd12ac29086c88002ce999a8eabdf406cd | [
"BSD-2-Clause"
] | null | null | null | pkg/ampcor/products/OffsetMap.py | aivazis/ampcor | a673e6fd12ac29086c88002ce999a8eabdf406cd | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# michael a.g. aïvázis <michael.aivazis@para-sim.com>
# parasim
# (c) 1998-2021 all rights reserved
#
# the framework
import ampcor
# the extension
from ampcor.ext import ampcor as libampcor
# declaration
class OffsetMap(ampcor.flow.product,
family="ampcor.products.offsets.... | 25.639785 | 91 | 0.556511 |
import ampcor
from ampcor.ext import ampcor as libampcor
class OffsetMap(ampcor.flow.product,
family="ampcor.products.offsets.offsets", implements=ampcor.specs.offsets):
shape = ampcor.properties.tuple(schema=ampcor.properties.int())
shape.default = (0,0)
shape.doc = "the... | true | true |
f734b04a077be3478e1741e20f6f998dfde15758 | 2,542 | py | Python | Competitive Programming/Blind 75 Must Do Leetcode/Maximum Subarray.py | shreejitverma/GeeksforGeeks | d7bcb166369fffa9a031a258e925b6aff8d44e6c | [
"MIT"
] | 2 | 2022-02-18T05:14:28.000Z | 2022-03-08T07:00:08.000Z | Competitive Programming/Blind 75 Must Do Leetcode/Maximum Subarray.py | shivaniverma1/Competitive-Programming-1 | d7bcb166369fffa9a031a258e925b6aff8d44e6c | [
"MIT"
] | 6 | 2022-01-13T04:31:04.000Z | 2022-03-12T01:06:16.000Z | Competitive Programming/Blind 75 Must Do Leetcode/Maximum Subarray.py | shivaniverma1/Competitive-Programming-1 | d7bcb166369fffa9a031a258e925b6aff8d44e6c | [
"MIT"
] | 2 | 2022-02-14T19:53:53.000Z | 2022-02-18T05:14:30.000Z | '''https://leetcode.com/problems/maximum-subarray/
53. Maximum Subarray
Easy
15507
728
Add to List
Share
Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum.
A subarray is a contiguous part of an array.
Example 1:
Input: nums ... | 22.900901 | 136 | 0.597168 |
class Solution:
def maxSubArray(self, nums: List[int]) -> int:
ans = nums[0]
cur_sum = 0
for i in range(len(nums)):
if cur_sum > 0:
cur_sum += nums[i]
else:
cur_sum = nums[i]
ans = max(ans, cur_sum)
return ans
d... | true | true |
f734b04aea02cf19e100ce06a3b561cc7a0bf7dc | 7,054 | py | Python | iot_services_sdk/sensor.py | sap-archive/iot-services-sdk | 157e607b0c8b3a7b77836336aa31d89ebd8e9f86 | [
"CNRI-Python"
] | 4 | 2019-05-02T07:51:13.000Z | 2019-09-25T12:14:06.000Z | iot_services_sdk/sensor.py | sap-archive/iot-services-sdk | 157e607b0c8b3a7b77836336aa31d89ebd8e9f86 | [
"CNRI-Python"
] | 2 | 2019-09-13T15:36:32.000Z | 2019-11-15T06:01:09.000Z | iot_services_sdk/sensor.py | sap-archive/iot-services-sdk | 157e607b0c8b3a7b77836336aa31d89ebd8e9f86 | [
"CNRI-Python"
] | 1 | 2020-01-17T15:44:52.000Z | 2020-01-17T15:44:52.000Z | """ Author: Philipp Steinrötter (steinroe) """
from .tenant_iot_service import TenantIoTService
from .utils import build_query
from .response import Response
class SensorService(TenantIoTService):
def __init__(self,
instance,
user,
password,
ten... | 44.36478 | 294 | 0.601503 |
from .tenant_iot_service import TenantIoTService
from .utils import build_query
from .response import Response
class SensorService(TenantIoTService):
def __init__(self,
instance,
user,
password,
tenant_id):
self.service = '/sensors'
... | true | true |
f734b0be4b39646d3f90ce887df36ee68dd8bc06 | 541 | py | Python | users/models.py | DarkoR12/dafi-system | f923ea4273b04f7acc7016b2f7d03e51eb00b85b | [
"MIT"
] | null | null | null | users/models.py | DarkoR12/dafi-system | f923ea4273b04f7acc7016b2f7d03e51eb00b85b | [
"MIT"
] | null | null | null | users/models.py | DarkoR12/dafi-system | f923ea4273b04f7acc7016b2f7d03e51eb00b85b | [
"MIT"
] | null | null | null | from datetime import datetime
from django.contrib.auth.models import AbstractUser
from django.db import models
def current_year():
return datetime.now().year
class User(AbstractUser):
telegram_user = models.CharField('usuario de telegram', max_length=64, blank=True)
telegram_id = models.IntegerField('I... | 28.473684 | 86 | 0.733826 | from datetime import datetime
from django.contrib.auth.models import AbstractUser
from django.db import models
def current_year():
return datetime.now().year
class User(AbstractUser):
telegram_user = models.CharField('usuario de telegram', max_length=64, blank=True)
telegram_id = models.IntegerField('I... | true | true |
f734b13f88fa172c6f4bf050b1997c8b370e45cb | 15,421 | py | Python | mistral/mistral/tests/unit/engine/test_default_engine.py | Toure/openstack_mistral_wip | 1c3d028cb7c918de74a3cb018c84d6c5ee42e3f1 | [
"Apache-2.0"
] | null | null | null | mistral/mistral/tests/unit/engine/test_default_engine.py | Toure/openstack_mistral_wip | 1c3d028cb7c918de74a3cb018c84d6c5ee42e3f1 | [
"Apache-2.0"
] | null | null | null | mistral/mistral/tests/unit/engine/test_default_engine.py | Toure/openstack_mistral_wip | 1c3d028cb7c918de74a3cb018c84d6c5ee42e3f1 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 - Mirantis, Inc.
# Copyright 2015 - StackStorm, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... | 30.237255 | 79 | 0.611828 |
import datetime
import mock
from oslo_config import cfg
from oslo_messaging.rpc import client as rpc_client
from oslo_utils import uuidutils
from mistral.db.v2 import api as db_api
from mistral.db.v2.sqlalchemy import models
from mistral.engine import default_engine as d_eng
from mistral.engine.rpc_bac... | true | true |
f734b394aa62228b86d84da1a5347056479a101d | 1,575 | py | Python | hsse_api/migrations/0032_auto_20181112_2011.py | JEpifanio90/HSSE_APIv2 | 7b8e8fee9cffa932884f979d24658f08726b656d | [
"MIT"
] | null | null | null | hsse_api/migrations/0032_auto_20181112_2011.py | JEpifanio90/HSSE_APIv2 | 7b8e8fee9cffa932884f979d24658f08726b656d | [
"MIT"
] | null | null | null | hsse_api/migrations/0032_auto_20181112_2011.py | JEpifanio90/HSSE_APIv2 | 7b8e8fee9cffa932884f979d24658f08726b656d | [
"MIT"
] | 1 | 2018-12-07T03:43:32.000Z | 2018-12-07T03:43:32.000Z | # Generated by Django 2.1 on 2018-11-13 01:11
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('hsse_api', '0031_auto_20181111_1424'),
]
operations = [
migrations.AlterField(
model_name='auditinspection',
name='cre... | 29.166667 | 54 | 0.568889 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('hsse_api', '0031_auto_20181111_1424'),
]
operations = [
migrations.AlterField(
model_name='auditinspection',
name='created_on',
field=models.DateField(... | true | true |
f734b4ee525907aaa86b2d3ec604fe9872b56b26 | 129 | py | Python | sandbox/partner/partner/apps.py | ApsRajput/oscar-extend | 8828d66b78ae139a73d5ca707c0fe0710eac890a | [
"BSD-3-Clause"
] | null | null | null | sandbox/partner/partner/apps.py | ApsRajput/oscar-extend | 8828d66b78ae139a73d5ca707c0fe0710eac890a | [
"BSD-3-Clause"
] | null | null | null | sandbox/partner/partner/apps.py | ApsRajput/oscar-extend | 8828d66b78ae139a73d5ca707c0fe0710eac890a | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
from django.apps import AppConfig
class AccountConfig(AppConfig):
name = 'account' | 18.428571 | 39 | 0.79845 | from __future__ import unicode_literals
from django.apps import AppConfig
class AccountConfig(AppConfig):
name = 'account' | true | true |
f734b5ebe426a14ff0e314fceef43f9af09ce111 | 680 | py | Python | project/app.py | mapattacker/flask-serverless | 9612b7cbc5157770d88f352e0676911658c4de9a | [
"Apache-2.0"
] | null | null | null | project/app.py | mapattacker/flask-serverless | 9612b7cbc5157770d88f352e0676911658c4de9a | [
"Apache-2.0"
] | null | null | null | project/app.py | mapattacker/flask-serverless | 9612b7cbc5157770d88f352e0676911658c4de9a | [
"Apache-2.0"
] | null | null | null | import pickle
import traceback
import numpy as np
from flask import Flask, request
from config import MODELPATH, DEBUG
app = Flask(__name__)
model = pickle.load(open(MODELPATH, 'rb'))
@app.route("/predict", methods=["POST"])
def predict():
"""{"input": [5.8, 2.8, 5.1, 2.4]}"""
try:
content = reque... | 21.935484 | 54 | 0.623529 | import pickle
import traceback
import numpy as np
from flask import Flask, request
from config import MODELPATH, DEBUG
app = Flask(__name__)
model = pickle.load(open(MODELPATH, 'rb'))
@app.route("/predict", methods=["POST"])
def predict():
try:
content = request.json
sample = content["input"]
... | true | true |
f734b60ccd490cc86dc23fd7c60141903b7a603e | 1,049 | py | Python | generate_refs.py | life4/gweb | 396bcca71dd05e492b28ccbaa9fb3f9ae1c27502 | [
"MIT"
] | 185 | 2020-02-10T17:54:01.000Z | 2022-03-23T06:12:03.000Z | generate_refs.py | life4/gweb | 396bcca71dd05e492b28ccbaa9fb3f9ae1c27502 | [
"MIT"
] | 1 | 2020-10-05T06:56:38.000Z | 2020-10-05T06:56:38.000Z | generate_refs.py | life4/gweb | 396bcca71dd05e492b28ccbaa9fb3f9ae1c27502 | [
"MIT"
] | 15 | 2020-10-02T17:32:50.000Z | 2022-01-24T14:58:31.000Z | import re
from collections import defaultdict
from pathlib import Path
base_url = 'https://developer.mozilla.org/en-US/docs/Web/API/'
doc_base_url = 'https://pkg.go.dev/github.com/life4/gweb/{package}#{obj}'
link = re.escape(f'// {base_url}')
rex = re.compile(rf'(?:{link}([a-zA-Z/-]+))+\nfunc \([a-z]+ \*?([a-zA-Z]+)\)... | 31.787879 | 90 | 0.614871 | import re
from collections import defaultdict
from pathlib import Path
base_url = 'https://developer.mozilla.org/en-US/docs/Web/API/'
doc_base_url = 'https://pkg.go.dev/github.com/life4/gweb/{package}#{obj}'
link = re.escape(f'// {base_url}')
rex = re.compile(rf'(?:{link}([a-zA-Z/-]+))+\nfunc \([a-z]+ \*?([a-zA-Z]+)\)... | true | true |
f734b703f0a22b5a0f6e899df15bfb9827e5dc49 | 1,999 | py | Python | 5_Quadrature Formulas/Algoritmi_Quadratura.py | LeonardoSaccotelli/Numerical-Calculus-Project | becb480a611c9a57416127f6b0289085fe180ee4 | [
"MIT"
] | null | null | null | 5_Quadrature Formulas/Algoritmi_Quadratura.py | LeonardoSaccotelli/Numerical-Calculus-Project | becb480a611c9a57416127f6b0289085fe180ee4 | [
"MIT"
] | null | null | null | 5_Quadrature Formulas/Algoritmi_Quadratura.py | LeonardoSaccotelli/Numerical-Calculus-Project | becb480a611c9a57416127f6b0289085fe180ee4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Apr 7 17:58:09 2020
@author: Leonardo Saccotelli
"""
import numpy as np
"""
FORMULA DEI TRAPEZI
Al metodo vengono passati:
- la funzione integranda
- l'estremo inferiore di integrazione
- l'estremo superiore di integrazione
"""
def Trapezoid(f_x, a, b):
... | 21.042105 | 55 | 0.595798 |
import numpy as np
def Trapezoid(f_x, a, b):
T = (b-a)*(f_x(a)+f_x(b))/2
return T
def CompositeTrapezoid(f_x, a, b, N):
#Estrpolo N+1 intervalli equidistanti da [a,b]
z = np.linspace(a,b,N+1)
#Calcolo f_x() in ogni punto di z
fz = f_x(z)
S = 0
#Calcolo del trapezio com... | true | true |
f734b7c8a2993ef120151e812e8f2a1a91a1d8ae | 6,204 | py | Python | airbyte-integrations/connectors/source-facebook-marketing/unit_tests/test_client.py | aadityasinha-dotcom/airbyte | 7f6dd9b6fc4288260532fe1beaf7901633f13c88 | [
"MIT"
] | 1 | 2021-11-24T17:36:54.000Z | 2021-11-24T17:36:54.000Z | airbyte-integrations/connectors/source-facebook-marketing/unit_tests/test_client.py | aadityasinha-dotcom/airbyte | 7f6dd9b6fc4288260532fe1beaf7901633f13c88 | [
"MIT"
] | 2 | 2022-03-16T16:17:37.000Z | 2022-03-24T19:00:41.000Z | airbyte-integrations/connectors/source-facebook-marketing/unit_tests/test_client.py | aadityasinha-dotcom/airbyte | 7f6dd9b6fc4288260532fe1beaf7901633f13c88 | [
"MIT"
] | null | null | null | #
# Copyright (c) 2021 Airbyte, Inc., all rights reserved.
#
import json
from datetime import datetime
import pendulum
import pytest
from airbyte_cdk.models import SyncMode
from facebook_business import FacebookAdsApi, FacebookSession
from facebook_business.exceptions import FacebookRequestError
from source_facebook_... | 38.296296 | 137 | 0.598001 |
import json
from datetime import datetime
import pendulum
import pytest
from airbyte_cdk.models import SyncMode
from facebook_business import FacebookAdsApi, FacebookSession
from facebook_business.exceptions import FacebookRequestError
from source_facebook_marketing.api import API
from source_facebook_marketing.st... | true | true |
f734b7e22b114bcf1c5f0a73a9a92dfaa783b0aa | 7,751 | py | Python | bertviz/pytorch_pretrained_bert/file_utils.py | whaleloops/bertviz | 3c6323fa3a3e03e7399a0ad6ab8463c320179323 | [
"Apache-2.0"
] | 58 | 2019-09-16T07:24:23.000Z | 2021-12-30T09:04:38.000Z | bertviz/pytorch_pretrained_bert/file_utils.py | whaleloops/bertviz | 3c6323fa3a3e03e7399a0ad6ab8463c320179323 | [
"Apache-2.0"
] | 4 | 2021-09-09T03:02:18.000Z | 2022-03-24T13:55:55.000Z | bertviz/pytorch_pretrained_bert/file_utils.py | whaleloops/bertviz | 3c6323fa3a3e03e7399a0ad6ab8463c320179323 | [
"Apache-2.0"
] | 32 | 2019-07-30T17:47:21.000Z | 2022-03-29T22:33:29.000Z | """
Utilities for working with the local dataset cache.
This file is adapted from the AllenNLP library at https://github.com/allenai/allennlp
Copyright by the AllenNLP authors.
"""
import os
import logging
import shutil
import tempfile
import json
from urllib.parse import urlparse
from pathlib import Path
from typing ... | 33.123932 | 98 | 0.650239 |
import os
import logging
import shutil
import tempfile
import json
from urllib.parse import urlparse
from pathlib import Path
from typing import Optional, Tuple, Union, IO, Callable, Set
from hashlib import sha256
from functools import wraps
from tqdm import tqdm
import boto3
from botocore.exceptions import ClientEr... | true | true |
f734b81b788e1e3bc224c74ce6cddaa03e354b05 | 1,010 | py | Python | bindings/python/tests/test_wrapper.py | kamino/dragonffi | 3c983cc8c091d5472f7cdeab1b06dc3b1902e1be | [
"Apache-2.0"
] | 523 | 2018-02-02T08:07:24.000Z | 2022-03-21T15:44:39.000Z | bindings/python/tests/test_wrapper.py | kamino/dragonffi | 3c983cc8c091d5472f7cdeab1b06dc3b1902e1be | [
"Apache-2.0"
] | 28 | 2018-02-02T20:58:13.000Z | 2022-02-06T15:03:41.000Z | bindings/python/tests/test_wrapper.py | kamino/dragonffi | 3c983cc8c091d5472f7cdeab1b06dc3b1902e1be | [
"Apache-2.0"
] | 28 | 2018-02-02T12:05:55.000Z | 2021-09-16T21:05:05.000Z | # Copyright 2018 Adrien Guinet <adrien@guinet.me>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 27.297297 | 74 | 0.70099 |
import unittest
import pydffi
from common import DFFITest
class WrapperTest(DFFITest):
def test_wrapper(self):
CU = self.FFI.compile('''
struct A {
int a;
int b;
};
struct A init_A(int a, int b) {
struct A ret = {a,b};
return ret;
}
''')
FTy = pydffi.typeof(CU.fun... | true | true |
f734b8650bc5950384be7f02d5e473f74c10c65c | 7,897 | py | Python | third_party/retdec-3.2/scripts/retdec-unpacker.py | Fimbure/icebox-1 | 0b81992a53e1b410955ca89bdb6f8169d6f2da86 | [
"MIT"
] | 521 | 2019-03-29T15:44:08.000Z | 2022-03-22T09:46:19.000Z | third_party/retdec-3.2/scripts/retdec-unpacker.py | Fimbure/icebox-1 | 0b81992a53e1b410955ca89bdb6f8169d6f2da86 | [
"MIT"
] | 30 | 2019-06-04T17:00:49.000Z | 2021-09-08T20:44:19.000Z | third_party/retdec-3.2/scripts/retdec-unpacker.py | Fimbure/icebox-1 | 0b81992a53e1b410955ca89bdb6f8169d6f2da86 | [
"MIT"
] | 99 | 2019-03-29T16:04:13.000Z | 2022-03-28T16:59:34.000Z | #!/usr/bin/env python3
"""
The script tries to unpack the given executable file by using any
of the supported unpackers, which are at present:
* generic unpacker
* upx
Required argument:
* (packed) binary file
Optional arguments:
* desired name of unpacked file
* use extended exit codes
Returns:
*... | 36.391705 | 142 | 0.607193 |
import argparse
import os
import shutil
import sys
import importlib
config = importlib.import_module('retdec-config')
utils = importlib.import_module('retdec-utils')
CmdRunner = utils.CmdRunner
sys.stdout = utils.Unbuffered(sys.stdout)
def parse_args(_args):
parser = argparse.ArgumentParser(description=__doc... | true | true |
f734b8e77edfbc9b357701255382e772aa6650eb | 4,072 | py | Python | data/get_dataset.py | KristinaRay/english-arabic-nmt-bot | 1e0baddc81b829b3ee1abe95143cdef5c1206dd2 | [
"MIT"
] | 1 | 2022-01-31T11:48:01.000Z | 2022-01-31T11:48:01.000Z | data/get_dataset.py | KristinaRay/english-arabic-nmt-bot | 1e0baddc81b829b3ee1abe95143cdef5c1206dd2 | [
"MIT"
] | null | null | null | data/get_dataset.py | KristinaRay/english-arabic-nmt-bot | 1e0baddc81b829b3ee1abe95143cdef5c1206dd2 | [
"MIT"
] | null | null | null | import os
import tqdm
import numpy as np
import requests
import youtokentome as yttm
from argparse import ArgumentParser
from zipfile import ZipFile
from config import *
from data.preprocessing import *
from utils import *
DATA_FILE_PATH = f'{DATA_PATH}/data.zip'
DATA_URL = 'https://opus.nlpl.eu/download.php?f=OpenSu... | 37.357798 | 130 | 0.653242 | import os
import tqdm
import numpy as np
import requests
import youtokentome as yttm
from argparse import ArgumentParser
from zipfile import ZipFile
from config import *
from data.preprocessing import *
from utils import *
DATA_FILE_PATH = f'{DATA_PATH}/data.zip'
DATA_URL = 'https://opus.nlpl.eu/download.php?f=OpenSu... | true | true |
f734b98f59acd1949a167b610f57a6d37d0e9a9e | 584 | py | Python | codes/DBN.py | NoSRPKU/GradD | c74af028d4a93e2f645a61316a5c339ecf690bf1 | [
"MIT"
] | null | null | null | codes/DBN.py | NoSRPKU/GradD | c74af028d4a93e2f645a61316a5c339ecf690bf1 | [
"MIT"
] | null | null | null | codes/DBN.py | NoSRPKU/GradD | c74af028d4a93e2f645a61316a5c339ecf690bf1 | [
"MIT"
] | null | null | null | import numpy
import theano
import theano.tensor as T
from deeplearning import rbm
class DBN():
def __init__(self, vsize=None, hsizes=[], lr=None, bsize=10, seed=123):
assert vsize and hsizes and lr
input = T.dmatrix('global_input')
self.layers = []
for hsize in hsizes:
... | 23.36 | 75 | 0.583904 | import numpy
import theano
import theano.tensor as T
from deeplearning import rbm
class DBN():
def __init__(self, vsize=None, hsizes=[], lr=None, bsize=10, seed=123):
assert vsize and hsizes and lr
input = T.dmatrix('global_input')
self.layers = []
for hsize in hsizes:
... | true | true |
f734ba04f05e5982f9dd7d13edbcd15aff82d124 | 15,332 | py | Python | novadocker/tests/virt/docker/test_driver.py | harnesscloud/nova-docker | ede1002e587402bf6e7920b152a9bd6e6dd56776 | [
"Apache-2.0"
] | null | null | null | novadocker/tests/virt/docker/test_driver.py | harnesscloud/nova-docker | ede1002e587402bf6e7920b152a9bd6e6dd56776 | [
"Apache-2.0"
] | null | null | null | novadocker/tests/virt/docker/test_driver.py | harnesscloud/nova-docker | ede1002e587402bf6e7920b152a9bd6e6dd56776 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2013 dotCloud, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | 43.680912 | 79 | 0.636381 |
import contextlib
import socket
import mock
from oslo.serialization import jsonutils
from oslo.utils import units
from nova.compute import task_states
from nova import context
from nova import exception
from nova import test
import nova.tests.image.fake
from nova.tests import matchers
from nova.tests i... | false | true |
f734ba0eb3f89f91338e1ad089116a87126b41f6 | 1,122 | py | Python | Python Programs/smarty-affix-zeroes.py | muhammad-masood-ur-rehman/Skillrack | 71a25417c89d0efab40ee6229ccd758b26ae4312 | [
"CC0-1.0"
] | 2 | 2021-06-26T21:50:59.000Z | 2021-09-18T04:55:51.000Z | Python Programs/smarty-affix-zeroes.py | muhammad-masood-ur-rehman/Skillrack | 71a25417c89d0efab40ee6229ccd758b26ae4312 | [
"CC0-1.0"
] | null | null | null | Python Programs/smarty-affix-zeroes.py | muhammad-masood-ur-rehman/Skillrack | 71a25417c89d0efab40ee6229ccd758b26ae4312 | [
"CC0-1.0"
] | null | null | null | Smarty Affix Zeroes
Smarty Affix Zeroes: The program must accept two integers M and N as the input. The program must print the integers from M to N with smarty affix zeroes as the output.
Boundary Condition(s):
1 <= M < N <= 10^8
Input Format:
The first line contains M and N separated by a space.
Output Format:
The fi... | 48.782609 | 383 | 0.748663 | Smarty Affix Zeroes
Smarty Affix Zeroes: The program must accept two integers M and N as the input. The program must print the integers from M to N with smarty affix zeroes as the output.
Boundary Condition(s):
1 <= M < N <= 10^8
Input Format:
The first line contains M and N separated by a space.
Output Format:
The fi... | false | true |
f734ba16367e8b66e709a083cd83399a14c6eb48 | 1,169 | py | Python | Model_codebase_2_flask.py | anmolmore/Chatbot-for-COVID-19-FAQ-using-Dialogflow | f80670e9ee67e18c790da85d49e9c9617753c6f8 | [
"MIT"
] | 1 | 2021-01-02T06:37:41.000Z | 2021-01-02T06:37:41.000Z | Model_codebase_2_flask.py | anmolmore/Chatbot-for-COVID-19-FAQ-using-Dialogflow | f80670e9ee67e18c790da85d49e9c9617753c6f8 | [
"MIT"
] | null | null | null | Model_codebase_2_flask.py | anmolmore/Chatbot-for-COVID-19-FAQ-using-Dialogflow | f80670e9ee67e18c790da85d49e9c9617753c6f8 | [
"MIT"
] | null | null | null | #11915010 Raghu Punnamraju
#11915043 Anmol More
#11915001 Sriganesh Balamurugan
#11915052 Kapil Bindal
import pandas as pd
from ast import literal_eval
from cdqa.utils.filters import filter_paragraphs
from cdqa.utils.download import download_model, download_bnpp_data
from cdqa.pipeline.cdqa_sklearn import QAPipeline
... | 32.472222 | 79 | 0.763901 |
import pandas as pd
from ast import literal_eval
from cdqa.utils.filters import filter_paragraphs
from cdqa.utils.download import download_model, download_bnpp_data
from cdqa.pipeline.cdqa_sklearn import QAPipeline
df = pd.read_csv('data/dataset_collected.csv', usecols=['question', 'context'])
df['paragraphs'... | true | true |
f734bb4107b6567f1e96ae7b325230b167696c84 | 1,053 | py | Python | best_single_model/focal_loss.py | hellopikaqiu/AIchallenger_MachineReadingComprehension | 03c8d4ab60f6ac9c7f777fd2c932cc01300b5c42 | [
"MIT"
] | 94 | 2018-12-17T09:12:48.000Z | 2021-03-15T02:56:22.000Z | best_single_model/focal_loss.py | 1120327383/AIchallenger2018_MachineReadingComprehension | 03c8d4ab60f6ac9c7f777fd2c932cc01300b5c42 | [
"MIT"
] | 4 | 2019-03-10T03:20:18.000Z | 2020-06-02T05:10:46.000Z | best_single_model/focal_loss.py | 1120327383/AIchallenger2018_MachineReadingComprehension | 03c8d4ab60f6ac9c7f777fd2c932cc01300b5c42 | [
"MIT"
] | 24 | 2018-12-17T09:13:49.000Z | 2020-01-15T09:14:41.000Z | """
AI Challenger观点型问题阅读理解
focal_loss.py
@author: yuhaitao
"""
# -*- coding:utf-8 -*-
import tensorflow as tf
def sparse_focal_loss(logits, labels, gamma=2):
"""
Computer focal loss for multi classification
Args:
labels: A int32 tensor of shape [batch_size].
logits: A float32 tensor of shape... | 29.25 | 75 | 0.62868 |
import tensorflow as tf
def sparse_focal_loss(logits, labels, gamma=2):
with tf.name_scope("focal_loss"):
y_pred = tf.nn.softmax(logits, dim=-1)
labels = tf.one_hot(labels, depth=y_pred.shape[1])
L = -labels * ((1 - y_pred)**gamma) * tf.log(y_pred)
L = tf.reduce_sum(L, axis=1)
... | true | true |
f734bc2a2a57c1eac2aa84d6d7661a74990feb17 | 72,645 | py | Python | python/ccxt/bitmex.py | Joukahainen/ccxt | 82823a85b96cee336853f0deb353474df2122b88 | [
"MIT"
] | 2 | 2022-03-10T15:21:49.000Z | 2022-03-10T15:22:01.000Z | python/ccxt/bitmex.py | alimogh/ccxt | 518ea1a6d212605aa19deed74991bc525470e5c9 | [
"MIT"
] | 4 | 2021-12-14T06:19:10.000Z | 2022-03-19T02:39:29.000Z | python/ccxt/bitmex.py | alimogh/ccxt | 518ea1a6d212605aa19deed74991bc525470e5c9 | [
"MIT"
] | 2 | 2022-03-08T20:43:26.000Z | 2022-03-14T19:28:27.000Z | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from cc... | 42.284633 | 233 | 0.457664 |
ge import Exchange
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import PermissionDenied
from ccxt.base.errors import ArgumentsRequired
from ccxt.base.errors import BadRequest
from ccxt.base.errors import BadSymbol
from ccxt.base.errors import Insuf... | true | true |
f734bd64143a5c11cb97eb8dad029aafd37b792e | 951 | py | Python | setup.py | DavidNKraemer/WordleBot | 856108445ae881edf71d0e4360ec3219c9ed9fe4 | [
"MIT"
] | 1 | 2022-02-11T00:22:14.000Z | 2022-02-11T00:22:14.000Z | setup.py | DavidNKraemer/WordleBot | 856108445ae881edf71d0e4360ec3219c9ed9fe4 | [
"MIT"
] | 1 | 2022-02-07T02:35:49.000Z | 2022-02-15T14:27:57.000Z | setup.py | DavidNKraemer/Gym-Wordle | 856108445ae881edf71d0e4360ec3219c9ed9fe4 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
with open('README.md', 'r', encoding='utf-8') as fh:
long_description = fh.read()
setup(
name='gym_wordle',
version='0.1.3',
author='David Kraemer',
author_email='david.kraemer@stonybrook.edu',
description='OpenAI gym environment for training agents ... | 26.416667 | 71 | 0.599369 | from setuptools import setup, find_packages
with open('README.md', 'r', encoding='utf-8') as fh:
long_description = fh.read()
setup(
name='gym_wordle',
version='0.1.3',
author='David Kraemer',
author_email='david.kraemer@stonybrook.edu',
description='OpenAI gym environment for training agents ... | true | true |
f734bda982fdfb5c124c2601234d24204182ffb0 | 4,957 | py | Python | pywikibot/editor.py | valhallasw/pywikibot-core | 32a8c3c1298a5cb077381fe202daefde82c1c5d3 | [
"MIT"
] | null | null | null | pywikibot/editor.py | valhallasw/pywikibot-core | 32a8c3c1298a5cb077381fe202daefde82c1c5d3 | [
"MIT"
] | null | null | null | pywikibot/editor.py | valhallasw/pywikibot-core | 32a8c3c1298a5cb077381fe202daefde82c1c5d3 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""Text editor class for your favourite editor."""
from __future__ import unicode_literals
#
# (C) Gerrit Holl, 2004
# (C) Pywikibot team, 2004-2015
#
# Distributed under the terms of the MIT license.
#
__version__ = '$Id: f734bda982fdfb5c124c2601234d24204182ffb0 $'
#
import ... | 39.031496 | 84 | 0.586443 |
from __future__ import unicode_literals
__version__ = '$Id: f734bda982fdfb5c124c2601234d24204182ffb0 $'
import codecs
import os
import subprocess
import tempfile
import pywikibot
from pywikibot import config
from pywikibot.tools import deprecated
try:
from pywikibot.userinterfaces import gui
except ... | true | true |
f734bee389dc8207340f0fc6a99ba2f167fd79e7 | 29,991 | py | Python | flax_models/t5x/train.py | muell-monster/google-research | 04d2024f4723bc4be3d639a668c19fb1f6a31478 | [
"Apache-2.0"
] | 1 | 2020-12-25T01:18:50.000Z | 2020-12-25T01:18:50.000Z | flax_models/t5x/train.py | thomascherickal/google-research | 294a888bbb6678ac255c6422fd703c325cbb0772 | [
"Apache-2.0"
] | null | null | null | flax_models/t5x/train.py | thomascherickal/google-research | 294a888bbb6678ac255c6422fd703c325cbb0772 | [
"Apache-2.0"
] | 1 | 2021-09-27T03:17:14.000Z | 2021-09-27T03:17:14.000Z | # coding=utf-8
# Copyright 2020 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 40.419137 | 100 | 0.681038 |
from concurrent.futures import thread
import functools
import importlib
import os
from typing import Any, Mapping, Sequence, Tuple
from absl import app
from absl import flags
from absl import logging
os.environ['FLAX_PROFILE'] = 'true'
from flax import linen as nn
from flax import optim
from flax.me... | true | true |
f734bfd8dda478c4a821955f2b8d8d088ca859db | 47,394 | py | Python | botcity/core/bot.py | lf2a/botcity-framework-core-python-2 | eaa073a4f0b5099b0684400533f7427e001648e5 | [
"Apache-2.0"
] | null | null | null | botcity/core/bot.py | lf2a/botcity-framework-core-python-2 | eaa073a4f0b5099b0684400533f7427e001648e5 | [
"Apache-2.0"
] | null | null | null | botcity/core/bot.py | lf2a/botcity-framework-core-python-2 | eaa073a4f0b5099b0684400533f7427e001648e5 | [
"Apache-2.0"
] | null | null | null | import os
import functools
import multiprocessing
import platform
import random
import subprocess
import time
import webbrowser
import pyautogui
import pyperclip
from PIL import Image
from botcity.base import BaseBot, State
from botcity.base.utils import is_retina, only_if_element
from . import config, os_compat
try... | 32.044625 | 115 | 0.573617 | import os
import functools
import multiprocessing
import platform
import random
import subprocess
import time
import webbrowser
import pyautogui
import pyperclip
from PIL import Image
from botcity.base import BaseBot, State
from botcity.base.utils import is_retina, only_if_element
from . import config, os_compat
try... | true | true |
f734c01585f2ae4014ad72f125f7748b1f3b18d9 | 4,174 | py | Python | aleph/tests/test_collections_api.py | gavinrozzi/aleph | a8e3d10ec34b0d0a05b4daf3fdd2d09b96928b35 | [
"MIT"
] | null | null | null | aleph/tests/test_collections_api.py | gavinrozzi/aleph | a8e3d10ec34b0d0a05b4daf3fdd2d09b96928b35 | [
"MIT"
] | null | null | null | aleph/tests/test_collections_api.py | gavinrozzi/aleph | a8e3d10ec34b0d0a05b4daf3fdd2d09b96928b35 | [
"MIT"
] | null | null | null | import json
from aleph.core import db
from aleph.model import Entity
from aleph.tests.util import TestCase
class CollectionsApiTestCase(TestCase):
def setUp(self):
super(CollectionsApiTestCase, self).setUp()
self.rolex = self.create_user(foreign_id='user_3')
self.col = self.create_collec... | 36.938053 | 68 | 0.546957 | import json
from aleph.core import db
from aleph.model import Entity
from aleph.tests.util import TestCase
class CollectionsApiTestCase(TestCase):
def setUp(self):
super(CollectionsApiTestCase, self).setUp()
self.rolex = self.create_user(foreign_id='user_3')
self.col = self.create_collec... | true | true |
f734c05d8d611e2e78373da2d10eb3ba7f634a15 | 18,048 | py | Python | scripts/icml_2018_experiment.py | davidinouye/destructive-deep-learning | 632add7a9731347e050d271ceebb24251e1d8e01 | [
"BSD-3-Clause"
] | 21 | 2018-06-19T21:23:32.000Z | 2021-03-03T03:29:00.000Z | scripts/icml_2018_experiment.py | davidinouye/destructive-deep-learning | 632add7a9731347e050d271ceebb24251e1d8e01 | [
"BSD-3-Clause"
] | 39 | 2018-06-19T16:45:51.000Z | 2020-09-15T12:53:20.000Z | scripts/icml_2018_experiment.py | davidinouye/destructive-deep-learning | 632add7a9731347e050d271ceebb24251e1d8e01 | [
"BSD-3-Clause"
] | 5 | 2018-10-01T22:58:32.000Z | 2019-11-12T20:41:16.000Z | """ICML 2018 experiment for MNIST and CIFAR-10."""
import argparse
import logging
import os
import subprocess
import sys
import time
import warnings
import numpy as np
import scipy.stats # Needed for standard error of the mean scipy.stats.sem
from sklearn.base import clone
from sklearn.decomposition import PCA
# Add... | 37.757322 | 99 | 0.624224 | import argparse
import logging
import os
import subprocess
import sys
import time
import warnings
import numpy as np
import scipy.stats
from sklearn.base import clone
from sklearn.decomposition import PCA
sys.path.append(os.path.dirname(os.path.realpath(__file__)))
sys.path.append(os.path.join(os.path.dirname(os... | true | true |
f734c2997557807df9822443ec26bb97e6121bc8 | 8,265 | py | Python | samples/pubsub.py | KernelGamut32/aws-iot-device-sdk-python-v2 | 1eb65095261c431c8fc6f1168ec490a5fc87ed34 | [
"Apache-2.0"
] | null | null | null | samples/pubsub.py | KernelGamut32/aws-iot-device-sdk-python-v2 | 1eb65095261c431c8fc6f1168ec490a5fc87ed34 | [
"Apache-2.0"
] | null | null | null | samples/pubsub.py | KernelGamut32/aws-iot-device-sdk-python-v2 | 1eb65095261c431c8fc6f1168ec490a5fc87ed34 | [
"Apache-2.0"
] | null | null | null | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0.
import argparse
from awscrt import io, mqtt, auth, http
from awsiot import mqtt_connection_builder
import sys
import threading
import time
from uuid import uuid4
import json
# This sample uses the Message Broke... | 45.916667 | 116 | 0.684453 |
import argparse
from awscrt import io, mqtt, auth, http
from awsiot import mqtt_connection_builder
import sys
import threading
import time
from uuid import uuid4
import json
parser = argparse.ArgumentParser(description="Send and receive messages through and MQTT connection.")
parser.add_argument('--endpoint',... | true | true |
f734c331e3defaefc8932cce380c4f0de759d187 | 24,299 | py | Python | pandas/tests/scalar/timestamp/test_timestamp.py | guitargeek/pandas | a6c1f6cccee6bbccfb29488a94664ed07db024d9 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2022-01-07T12:43:15.000Z | 2022-01-07T12:43:15.000Z | pandas/tests/scalar/timestamp/test_timestamp.py | guitargeek/pandas | a6c1f6cccee6bbccfb29488a94664ed07db024d9 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/tests/scalar/timestamp/test_timestamp.py | guitargeek/pandas | a6c1f6cccee6bbccfb29488a94664ed07db024d9 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | """ test the scalar Timestamp """
import calendar
from datetime import (
datetime,
timedelta,
)
import locale
import pickle
import unicodedata
from dateutil.tz import tzutc
import numpy as np
import pytest
import pytz
from pytz import (
timezone,
utc,
)
from pandas._libs.tslibs.timezones import (
... | 35.318314 | 88 | 0.59381 |
import calendar
from datetime import (
datetime,
timedelta,
)
import locale
import pickle
import unicodedata
from dateutil.tz import tzutc
import numpy as np
import pytest
import pytz
from pytz import (
timezone,
utc,
)
from pandas._libs.tslibs.timezones import (
dateutil_gettz as gettz,
get_... | true | true |
f734c4c022c88b66d3fcb77381bcb51601a9d8af | 992 | py | Python | backend/web_item.py | ldrozdz/Webforming | ded27ee72da1753b4f3d83e8a4abda1884528a8b | [
"Apache-2.0"
] | null | null | null | backend/web_item.py | ldrozdz/Webforming | ded27ee72da1753b4f3d83e8a4abda1884528a8b | [
"Apache-2.0"
] | null | null | null | backend/web_item.py | ldrozdz/Webforming | ded27ee72da1753b4f3d83e8a4abda1884528a8b | [
"Apache-2.0"
] | null | null | null | class WebItem(object):
def __init__(self):
self.post_id = None
self.parent_id = None
self.thread_starter_id = None
self.post_url = None
self.site_url = None
self.source_id = None
self.type = None
self.hash = None
self.post_date = None
self.parsed_post_date = None
self.crawl... | 27.555556 | 38 | 0.680444 | class WebItem(object):
def __init__(self):
self.post_id = None
self.parent_id = None
self.thread_starter_id = None
self.post_url = None
self.site_url = None
self.source_id = None
self.type = None
self.hash = None
self.post_date = None
self.parsed_post_date = None
self.crawl... | true | true |
f734c573b22936cb5779000082e01563e81bac7b | 1,939 | py | Python | twitpic.py | eseo-emc/tweetresistance | 4f8acd7d42258b9c988b065f00735a45f952bcc3 | [
"Unlicense"
] | null | null | null | twitpic.py | eseo-emc/tweetresistance | 4f8acd7d42258b9c988b065f00735a45f952bcc3 | [
"Unlicense"
] | null | null | null | twitpic.py | eseo-emc/tweetresistance | 4f8acd7d42258b9c988b065f00735a45f952bcc3 | [
"Unlicense"
] | null | null | null | import twitter # https://github.com/bear/python-twitter
from datetime import datetime
class TwitpicClient(object):
def __init__(self):
self.api = twitter.Api(consumer_key='zejoKxmd6rFVKE3UNyxIUFvJR',
consumer_secret='xCh6Ad08Ni91T4fvjYUj3sj8OW8buWH2kAp4t3sooKRNZcj1cu',
... | 32.864407 | 93 | 0.593605 | import twitter
from datetime import datetime
class TwitpicClient(object):
def __init__(self):
self.api = twitter.Api(consumer_key='zejoKxmd6rFVKE3UNyxIUFvJR',
consumer_secret='xCh6Ad08Ni91T4fvjYUj3sj8OW8buWH2kAp4t3sooKRNZcj1cu',
access_token_key='3223538... | false | true |
f734c5a16a4fb88f97b1cf255529a1b8023df50f | 1,216 | py | Python | _unittests/ut_packaged/test_diff.py | sdpython/pymyinstall | 72b3a56a29def0694e34ccae910bf288a95cf4a5 | [
"MIT"
] | 8 | 2015-08-24T21:01:49.000Z | 2018-01-04T06:34:51.000Z | _unittests/ut_packaged/test_diff.py | sdpython/pymyinstall | 72b3a56a29def0694e34ccae910bf288a95cf4a5 | [
"MIT"
] | 66 | 2015-06-14T22:04:58.000Z | 2021-11-11T13:46:03.000Z | _unittests/ut_packaged/test_diff.py | sdpython/pymyinstall | 72b3a56a29def0694e34ccae910bf288a95cf4a5 | [
"MIT"
] | 5 | 2016-09-13T18:14:46.000Z | 2021-08-23T12:03:28.000Z | """
@brief test log(time=200s)
"""
import unittest
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import ExtTestCase
from pymyinstall.packaged import small_set
class TestDifference(ExtTestCase):
def test_diff(self):
fLOG(
__file__,
self._testMethodName,
... | 25.87234 | 78 | 0.535362 | import unittest
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import ExtTestCase
from pymyinstall.packaged import small_set
class TestDifference(ExtTestCase):
def test_diff(self):
fLOG(
__file__,
self._testMethodName,
OutputPrint=__name__ == "__mai... | true | true |
f734c5b8ff6599d9412f3021b918a8bb7dc23ee8 | 553 | py | Python | bot/cogs/guilds/sheeptrainer.py | issuemeaname/rammus-discord-bot | 23bcb02af11b8b764d75fa974149164f0086c1ea | [
"MIT"
] | 1 | 2020-07-07T05:02:40.000Z | 2020-07-07T05:02:40.000Z | bot/cogs/guilds/sheeptrainer.py | issuemeaname/rammus-discord-bot | 23bcb02af11b8b764d75fa974149164f0086c1ea | [
"MIT"
] | null | null | null | bot/cogs/guilds/sheeptrainer.py | issuemeaname/rammus-discord-bot | 23bcb02af11b8b764d75fa974149164f0086c1ea | [
"MIT"
] | 2 | 2019-02-07T18:26:43.000Z | 2021-07-04T16:58:41.000Z | # import discord
from discord.ext import commands
import bot.checks
class Sheeptrainer(commands.Cog, command_attrs={"hidden": True}):
_GUILD = 296463400064647168
def __init__(self, bot):
self.bot = bot
@bot.checks.in_guild(_GUILD)
async def cog_check(self, ctx):
print("a")
r... | 21.269231 | 65 | 0.641953 |
from discord.ext import commands
import bot.checks
class Sheeptrainer(commands.Cog, command_attrs={"hidden": True}):
_GUILD = 296463400064647168
def __init__(self, bot):
self.bot = bot
@bot.checks.in_guild(_GUILD)
async def cog_check(self, ctx):
print("a")
return True
... | true | true |
f734c651842c525dc107baa1fc6c1a5c794093b3 | 1,458 | py | Python | setup.py | pyarnold/Mailpile | a7c0a0c6257da167207200f3b214b0e66bb93a10 | [
"Apache-2.0"
] | 2 | 2017-02-03T07:00:57.000Z | 2020-12-18T01:07:34.000Z | setup.py | cz8s/Mailpile | a7c0a0c6257da167207200f3b214b0e66bb93a10 | [
"Apache-2.0"
] | null | null | null | setup.py | cz8s/Mailpile | a7c0a0c6257da167207200f3b214b0e66bb93a10 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python2
from datetime import date
from setuptools import setup, find_packages
import os
import re
from glob import glob
APPVER = (
line.strip() for line in open('mailpile/defaults.py', 'r')
if re.match(r'^APPVER\s*=', line)
).next().split('"')[1]
try:
# This borks sdist.
os.remove('.SEL... | 25.578947 | 76 | 0.633059 |
from datetime import date
from setuptools import setup, find_packages
import os
import re
from glob import glob
APPVER = (
line.strip() for line in open('mailpile/defaults.py', 'r')
if re.match(r'^APPVER\s*=', line)
).next().split('"')[1]
try:
# This borks sdist.
os.remove('.SELF')
except:
pass
... | true | true |
f734c7ad29376309ca2140ef6f5ab05ea0760b35 | 3,037 | py | Python | Code/main.py | Orelbenr/acoustic-fencing | 2d8c6121c915d2f12fae3c9d776e6339f028e35a | [
"MIT"
] | null | null | null | Code/main.py | Orelbenr/acoustic-fencing | 2d8c6121c915d2f12fae3c9d776e6339f028e35a | [
"MIT"
] | null | null | null | Code/main.py | Orelbenr/acoustic-fencing | 2d8c6121c915d2f12fae3c9d776e6339f028e35a | [
"MIT"
] | null | null | null | import sys
from train import train
from separate import separate
import os
from os.path import join as pjoin
import logging
from datetime import datetime
def get_logger(logger_name, file_name):
logger = logging.getLogger(logger_name)
file_handler = logging.FileHandler(file_name)
stream_handler = logging.S... | 43.385714 | 131 | 0.638459 | import sys
from train import train
from separate import separate
import os
from os.path import join as pjoin
import logging
from datetime import datetime
def get_logger(logger_name, file_name):
logger = logging.getLogger(logger_name)
file_handler = logging.FileHandler(file_name)
stream_handler = logging.S... | true | true |
f734ca6ded8fd6b46244078e8a884dc84331652f | 18,494 | py | Python | lasagne/tests/layers/test_conv.py | JeffreyDF/Lasagne | 6dd88f5fada20768087f29ae89cbd83980fe0a4e | [
"MIT"
] | 60 | 2015-01-29T21:54:04.000Z | 2019-11-12T07:38:15.000Z | lasagne/tests/layers/test_conv.py | JeffreyDF/Lasagne | 6dd88f5fada20768087f29ae89cbd83980fe0a4e | [
"MIT"
] | 5 | 2015-06-15T00:21:47.000Z | 2017-09-14T10:24:40.000Z | lasagne/tests/layers/test_conv.py | JeffreyDF/Lasagne | 6dd88f5fada20768087f29ae89cbd83980fe0a4e | [
"MIT"
] | 20 | 2015-04-28T00:21:41.000Z | 2019-09-16T01:10:37.000Z | import numpy as np
import pytest
import importlib
import theano
import lasagne
from lasagne.utils import floatX, as_tuple
def conv2d(input, kernel, pad):
"""Execute a 2D convolution.
Parameters
----------
input : numpy array
kernel : numpy array
pad : {0, 'valid', 'same', 'full'}
Return... | 37.513185 | 79 | 0.568779 | import numpy as np
import pytest
import importlib
import theano
import lasagne
from lasagne.utils import floatX, as_tuple
def conv2d(input, kernel, pad):
if pad not in ['valid', 'same', 'full']:
pad = as_tuple(pad, 2, int)
input = np.pad(input,
((0, 0), (0, 0), (pad[0], pad... | true | true |
f734caef5c5d450dabd683c8724747521c21a4ff | 21,738 | py | Python | tensorflow/python/distribute/tpu_values.py | EricLi404/tensorflow | 23759800d89f7b5362c338d9a3fd72a6810c3e22 | [
"Apache-2.0"
] | 74 | 2020-07-06T17:11:39.000Z | 2022-01-28T06:31:28.000Z | tensorflow/python/distribute/tpu_values.py | EricLi404/tensorflow | 23759800d89f7b5362c338d9a3fd72a6810c3e22 | [
"Apache-2.0"
] | 9 | 2020-10-13T23:25:29.000Z | 2022-02-10T06:54:48.000Z | tensorflow/python/distribute/tpu_values.py | EricLi404/tensorflow | 23759800d89f7b5362c338d9a3fd72a6810c3e22 | [
"Apache-2.0"
] | 12 | 2020-07-08T07:27:17.000Z | 2021-12-27T08:54:27.000Z | # Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 36.351171 | 112 | 0.699006 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import contextlib
from tensorflow.python.distribute import packed_distributed_variable as packed
from tensorflow.python.distribute import values
from tensorflow.python.distribute import values_u... | true | true |
f734cb4823063b2767bd39361c8b9837fb410f99 | 2,294 | py | Python | Exercise-3/sensor_stick/src/sensor_stick/features.py | antoszy/RoboND-perception-exercises | 8c725e77316162ae485ccee94085fd2314be7ae0 | [
"MIT"
] | null | null | null | Exercise-3/sensor_stick/src/sensor_stick/features.py | antoszy/RoboND-perception-exercises | 8c725e77316162ae485ccee94085fd2314be7ae0 | [
"MIT"
] | null | null | null | Exercise-3/sensor_stick/src/sensor_stick/features.py | antoszy/RoboND-perception-exercises | 8c725e77316162ae485ccee94085fd2314be7ae0 | [
"MIT"
] | null | null | null | import matplotlib.colors
import matplotlib.pyplot as plt
import numpy as np
from pcl_helper import *
nbinscol = 32
nbinsnor = 20
def rgb_to_hsv(rgb_list):
rgb_normalized = [1.0*rgb_list[0]/255, 1.0*rgb_list[1]/255, 1.0*rgb_list[2]/255]
hsv_normalized = matplotlib.colors.rgb_to_hsv([[rgb_normalized]])[0][0]
... | 32.309859 | 84 | 0.725806 | import matplotlib.colors
import matplotlib.pyplot as plt
import numpy as np
from pcl_helper import *
nbinscol = 32
nbinsnor = 20
def rgb_to_hsv(rgb_list):
rgb_normalized = [1.0*rgb_list[0]/255, 1.0*rgb_list[1]/255, 1.0*rgb_list[2]/255]
hsv_normalized = matplotlib.colors.rgb_to_hsv([[rgb_normalized]])[0][0]
... | true | true |
f734cb94f1c618b92f07fe70c5d48199f6e127ba | 2,737 | py | Python | .Config/FslBuildGen/Xml/SubPackageSupportConfig.py | alejandrolozano2/OpenGL_DemoFramework | 5fd85f05c98cc3d0c0a68bac438035df8cabaee7 | [
"MIT",
"BSD-3-Clause"
] | 3 | 2019-01-19T20:21:24.000Z | 2021-08-10T02:11:32.000Z | .Config/FslBuildGen/Xml/SubPackageSupportConfig.py | alejandrolozano2/OpenGL_DemoFramework | 5fd85f05c98cc3d0c0a68bac438035df8cabaee7 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | .Config/FslBuildGen/Xml/SubPackageSupportConfig.py | alejandrolozano2/OpenGL_DemoFramework | 5fd85f05c98cc3d0c0a68bac438035df8cabaee7 | [
"MIT",
"BSD-3-Clause"
] | 1 | 2021-08-10T02:11:33.000Z | 2021-08-10T02:11:33.000Z | #!/usr/bin/env python3
#****************************************************************************************************************************************************
# Copyright (c) 2014 Freescale Semiconductor, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
#... | 58.234043 | 162 | 0.656924 |
from FslBuildGen.DataTypes import PackageType
from FslBuildGen.DataTypes import SubPackageSupport
class SubPackageSupportConfig(object):
def __init__(self, packageType: int, subPackageSupport: int) -> None:
super(SubPackageSupportConfig, self).__init__()
self.Type ... | true | true |
f734cd4cfbc6e0bc534a4349136cc39749e30092 | 8,442 | py | Python | magnum/objects/x509keypair.py | mjbrewer/testIndex | 420dc071d4240a89b6f266e8d2575cedb39bfea0 | [
"Apache-2.0"
] | null | null | null | magnum/objects/x509keypair.py | mjbrewer/testIndex | 420dc071d4240a89b6f266e8d2575cedb39bfea0 | [
"Apache-2.0"
] | null | null | null | magnum/objects/x509keypair.py | mjbrewer/testIndex | 420dc071d4240a89b6f266e8d2575cedb39bfea0 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
#
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | 41.586207 | 85 | 0.622957 |
from oslo_versionedobjects import fields
from magnum.common import exception
from magnum.common import utils
from magnum.db import api as dbapi
from magnum.objects import base
@base.MagnumObjectRegistry.register
class X509KeyPair(base.MagnumPersistentObject, base.MagnumObject,
base.M... | true | true |
f734cdbc4784f67ad314325d7468e7791ca4a293 | 2,093 | py | Python | modules/cluster_xyz.py | fonsecag/TBD | d4cb9dec96e753708950e223f921a29ab7bcb9dd | [
"MIT"
] | 6 | 2021-03-04T06:58:11.000Z | 2022-01-30T02:28:48.000Z | modules/cluster_xyz.py | fonsecag/TBD | d4cb9dec96e753708950e223f921a29ab7bcb9dd | [
"MIT"
] | null | null | null | modules/cluster_xyz.py | fonsecag/TBD | d4cb9dec96e753708950e223f921a29ab7bcb9dd | [
"MIT"
] | null | null | null | from run import MainHandler
from .cluster import ClusterHandler
from util import *
class ClusterXYZHandler(ClusterHandler):
def __init__(self, args, **kwargs):
super().__init__(args, **kwargs)
self.n_stages = self.n_main_stages + self.n_substages
n_substages = ClusterHandler.n_substages # o... | 29.9 | 77 | 0.572862 | from run import MainHandler
from .cluster import ClusterHandler
from util import *
class ClusterXYZHandler(ClusterHandler):
def __init__(self, args, **kwargs):
super().__init__(args, **kwargs)
self.n_stages = self.n_main_stages + self.n_substages
n_substages = ClusterHandler.n_substages
... | true | true |
f734ce2104b99a837e3511b1075b8cf719ab35b6 | 482 | py | Python | pyxrf/db_config/hxn_db_config.py | andrewmkiss/PyXRF | 61de2029c255f77279ba5bc3896107c1a2e4212f | [
"BSD-3-Clause"
] | 19 | 2016-05-25T21:40:41.000Z | 2022-01-19T01:58:15.000Z | pyxrf/db_config/hxn_db_config.py | andrewmkiss/PyXRF | 61de2029c255f77279ba5bc3896107c1a2e4212f | [
"BSD-3-Clause"
] | 90 | 2016-01-11T17:22:05.000Z | 2021-12-02T15:59:58.000Z | pyxrf/db_config/hxn_db_config.py | andrewmkiss/PyXRF | 61de2029c255f77279ba5bc3896107c1a2e4212f | [
"BSD-3-Clause"
] | 22 | 2016-10-16T17:19:19.000Z | 2022-02-18T21:45:08.000Z | try:
from databroker.v0 import Broker
except ModuleNotFoundError:
from databroker import Broker
from hxntools.handlers.xspress3 import Xspress3HDF5Handler
from hxntools.handlers.timepix import TimepixHDF5Handler
db = Broker.named("hxn")
# db_analysis = Broker.named('hxn_analysis')
db.reg.register_handler(Xsp... | 34.428571 | 94 | 0.8361 | try:
from databroker.v0 import Broker
except ModuleNotFoundError:
from databroker import Broker
from hxntools.handlers.xspress3 import Xspress3HDF5Handler
from hxntools.handlers.timepix import TimepixHDF5Handler
db = Broker.named("hxn")
db.reg.register_handler(Xspress3HDF5Handler.HANDLER_NAME, Xspress3HDF5H... | true | true |
f734ce5df7ac9a87c9b31d2c6162e94261ab7b86 | 1,031 | bzl | Python | examples/test.bzl | Aghassi/rules_nodejs | 3eb42603c440f7e8496f2e6812337eb47827ff6a | [
"Apache-2.0"
] | 1 | 2021-06-20T18:37:14.000Z | 2021-06-20T18:37:14.000Z | examples/test.bzl | Aghassi/rules_nodejs | 3eb42603c440f7e8496f2e6812337eb47827ff6a | [
"Apache-2.0"
] | 12 | 2020-04-06T21:50:34.000Z | 2022-03-25T18:06:41.000Z | examples/test.bzl | Aghassi/rules_nodejs | 3eb42603c440f7e8496f2e6812337eb47827ff6a | [
"Apache-2.0"
] | 1 | 2018-03-07T13:48:39.000Z | 2018-03-07T13:48:39.000Z | "Define a convenience macro for examples integration testing"
load("@build_bazel_rules_nodejs//internal/bazel_integration_test:bazel_integration_test.bzl", "rules_nodejs_integration_test")
load("//:tools/defaults.bzl", "codeowners")
def example_integration_test(name, owners = [], **kwargs):
"Set defaults for the ... | 33.258065 | 126 | 0.57129 |
load("@build_bazel_rules_nodejs//internal/bazel_integration_test:bazel_integration_test.bzl", "rules_nodejs_integration_test")
load("//:tools/defaults.bzl", "codeowners")
def example_integration_test(name, owners = [], **kwargs):
dirname = name[len("examples_"):]
native.filegroup(
name = "_%s_sources"... | true | true |
f734ce7aa3455146cd42a264d89384c7c91362c6 | 701 | py | Python | send_sms.py | bthaman/noaa_precip | 7c1b33760584fb4591e10eeb59e5904df48a17d0 | [
"Python-2.0",
"OLDAP-2.7"
] | null | null | null | send_sms.py | bthaman/noaa_precip | 7c1b33760584fb4591e10eeb59e5904df48a17d0 | [
"Python-2.0",
"OLDAP-2.7"
] | null | null | null | send_sms.py | bthaman/noaa_precip | 7c1b33760584fb4591e10eeb59e5904df48a17d0 | [
"Python-2.0",
"OLDAP-2.7"
] | null | null | null | # we import the Twilio client from the dependency we just installed
# from twilio.rest import TwilioRestClient
from twilio.rest import Client
def send_text(message):
# the following line needs your Twilio Account SID and Auth Token
client = Client("AC3e84e9cae2390af9a661c1ab35955444", "4a8bf26cb30107ec85d98f6... | 43.8125 | 93 | 0.723252 |
from twilio.rest import Client
def send_text(message):
client = Client("AC3e84e9cae2390af9a661c1ab35955444", "4a8bf26cb30107ec85d98f6bf1182522")
client.messages.create(to="+15129146948", from_="+17372105122",
body=message)
if __name__ == '__main__':
send_t... | true | true |
f734cefe7c40ffddafb7ca7ca8a4bd256d52efd5 | 840 | py | Python | tests/v1/test_event_alert_type.py | MichaelTROEHLER/datadog-api-client-python | 12c46626622fb1277bb1e172753b342c671348bd | [
"Apache-2.0"
] | null | null | null | tests/v1/test_event_alert_type.py | MichaelTROEHLER/datadog-api-client-python | 12c46626622fb1277bb1e172753b342c671348bd | [
"Apache-2.0"
] | null | null | null | tests/v1/test_event_alert_type.py | MichaelTROEHLER/datadog-api-client-python | 12c46626622fb1277bb1e172753b342c671348bd | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from __future__ import absolute_import
import sys
import unittest
im... | 24.705882 | 108 | 0.72381 |
from __future__ import absolute_import
import sys
import unittest
import datadog_api_client.v1
from datadog_api_client.v1.model.event_alert_type import EventAlertType
class TestEventAlertType(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def testEventAlertTy... | true | true |
f734cfda1c639c31c88584c85e5043ba791d021a | 3,000 | py | Python | english/data_processing/lessons/code/vslide1.py | hrutkabence/tutorials | bd76294860804aee8ecda5e1445464506bf02ee0 | [
"CC0-1.0"
] | null | null | null | english/data_processing/lessons/code/vslide1.py | hrutkabence/tutorials | bd76294860804aee8ecda5e1445464506bf02ee0 | [
"CC0-1.0"
] | null | null | null | english/data_processing/lessons/code/vslide1.py | hrutkabence/tutorials | bd76294860804aee8ecda5e1445464506bf02ee0 | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from math import hypot, atan2, sin, cos, pi, degrees
import numpy as np
from matplotlib import pyplot as plt
def vplain(x1, y1, x2, y2):
""" set up line equation
vp[0] * x + vp[1] * y + vp[2] = 0
x1, y1 - horizontal coordinates of the start point o... | 30.927835 | 80 | 0.576667 |
import sys
from math import hypot, atan2, sin, cos, pi, degrees
import numpy as np
from matplotlib import pyplot as plt
def vplain(x1, y1, x2, y2):
vp = np.zeros((3,))
vp[0] = y1 - y2
vp[1] = x2 - x1
vp[2] = x1 * y2 - x2 * y1
vp = vp / hypot(vp[0], vp[1])
return vp
def section(pc, x1, y1,... | true | true |
f734d00b0261768c9a37cb2968bbdc5343c8ba0c | 1,292 | py | Python | demo_guided.py | MrJohnsson77/bat-country | 894af13bd777ab8aa989baf520db074b97cfad9a | [
"MIT"
] | 274 | 2015-07-06T14:29:09.000Z | 2022-02-06T18:06:14.000Z | demo_guided.py | amsimoes/bat-country | c0d29a0b32c196ca3d4c40fbaf960432b507e8bb | [
"MIT"
] | 11 | 2015-07-13T23:54:15.000Z | 2022-03-11T23:11:38.000Z | demo_guided.py | amsimoes/bat-country | c0d29a0b32c196ca3d4c40fbaf960432b507e8bb | [
"MIT"
] | 68 | 2015-07-06T15:16:53.000Z | 2021-08-09T19:03:31.000Z | # USAGE
# python demo_guided.py --base-model $CAFFE_ROOT/models/bvlc_googlenet \
# --image initial_images/clouds.jpg \
# --guide-image initial_images/seed_images/starry_night.jpg \
# --output examples/output/seeded/clouds_and_starry_night.jpg
# import the necessary packages
from batcountry import BatCountry
from PIL i... | 39.151515 | 81 | 0.755418 |
from batcountry import BatCountry
from PIL import Image
import numpy as np
import argparse
ap = argparse.ArgumentParser()
ap.add_argument("-b", "--base-model", required=True, help="base model path")
ap.add_argument("-l", "--layer", type=str, default="inception_4c/output",
help="layer of CNN to use")
ap.add_ar... | true | true |
f734d00b18af99f6b7b1b6eeaf82cc30c32aef02 | 3,245 | py | Python | polling_stations/apps/data_collection/management/commands/import_harborough.py | mtravis/UK-Polling-Stations | 26e0331dc29253dc436a0462ffaa01e974c5dc52 | [
"BSD-3-Clause"
] | null | null | null | polling_stations/apps/data_collection/management/commands/import_harborough.py | mtravis/UK-Polling-Stations | 26e0331dc29253dc436a0462ffaa01e974c5dc52 | [
"BSD-3-Clause"
] | null | null | null | polling_stations/apps/data_collection/management/commands/import_harborough.py | mtravis/UK-Polling-Stations | 26e0331dc29253dc436a0462ffaa01e974c5dc52 | [
"BSD-3-Clause"
] | null | null | null | from data_collection.management.commands import BaseXpressDemocracyClubCsvImporter
class Command(BaseXpressDemocracyClubCsvImporter):
council_id = "E07000131"
addresses_name = (
"local.2019-05-02/Version 1/Democracy_Club__02May2019 Harborough DC.tsv"
)
stations_name = (
"local.2019-05-... | 55.948276 | 132 | 0.642527 | from data_collection.management.commands import BaseXpressDemocracyClubCsvImporter
class Command(BaseXpressDemocracyClubCsvImporter):
council_id = "E07000131"
addresses_name = (
"local.2019-05-02/Version 1/Democracy_Club__02May2019 Harborough DC.tsv"
)
stations_name = (
"local.2019-05-... | true | true |
f734d0ce5e31881671bde02a0d35ed0eb21415f4 | 2,857 | py | Python | data/transcoder_evaluation_gfg/python/STOOGE_SORT.py | mxl1n/CodeGen | e5101dd5c5e9c3720c70c80f78b18f13e118335a | [
"MIT"
] | 241 | 2021-07-20T08:35:20.000Z | 2022-03-31T02:39:08.000Z | data/transcoder_evaluation_gfg/python/STOOGE_SORT.py | mxl1n/CodeGen | e5101dd5c5e9c3720c70c80f78b18f13e118335a | [
"MIT"
] | 49 | 2021-07-22T23:18:42.000Z | 2022-03-24T09:15:26.000Z | data/transcoder_evaluation_gfg/python/STOOGE_SORT.py | mxl1n/CodeGen | e5101dd5c5e9c3720c70c80f78b18f13e118335a | [
"MIT"
] | 71 | 2021-07-21T05:17:52.000Z | 2022-03-29T23:49:28.000Z | # Copyright (c) 2019-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
def f_gold ( arr , l , h ) :
if l >= h :
return
if arr [ l ] > arr [ h ] :
t = arr [ l ]
arr [ l... | 52.907407 | 165 | 0.431222 |
def f_gold ( arr , l , h ) :
if l >= h :
return
if arr [ l ] > arr [ h ] :
t = arr [ l ]
arr [ l ] = arr [ h ]
arr [ h ] = t
if h - l + 1 > 2 :
t = ( int ) ( ( h - l + 1 ) / 3 )
f_gold ( arr , l , ( h - t ) )
f_gold ( arr , l + t , ( h ) )
... | true | true |
f734d1983e0e270444f39c71128b6e3bc933d71c | 1,442 | py | Python | aliyun-python-sdk-linkwan/aliyunsdklinkwan/request/v20190301/GetLocalConfigSyncTaskRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 1,001 | 2015-07-24T01:32:41.000Z | 2022-03-25T01:28:18.000Z | aliyun-python-sdk-linkwan/aliyunsdklinkwan/request/v20190301/GetLocalConfigSyncTaskRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 363 | 2015-10-20T03:15:00.000Z | 2022-03-08T12:26:19.000Z | aliyun-python-sdk-linkwan/aliyunsdklinkwan/request/v20190301/GetLocalConfigSyncTaskRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 682 | 2015-09-22T07:19:02.000Z | 2022-03-22T09:51:46.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 37.947368 | 89 | 0.768377 |
from aliyunsdkcore.request import RpcRequest
from aliyunsdklinkwan.endpoint import endpoint_data
class GetLocalConfigSyncTaskRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'LinkWAN', '2019-03-01', 'GetLocalConfigSyncTask','linkwan')
self.set_method('POST')
if hasattr(sel... | true | true |
f734d1e49cc32d7b6f5465291abd73c61b5e8638 | 1,175 | py | Python | File.py | jessedeveloperinvestor/Multiple-Jesse-Projects | f66a6eed79117fd005668f79e0bee3d8ac76e2b8 | [
"Apache-2.0"
] | null | null | null | File.py | jessedeveloperinvestor/Multiple-Jesse-Projects | f66a6eed79117fd005668f79e0bee3d8ac76e2b8 | [
"Apache-2.0"
] | null | null | null | File.py | jessedeveloperinvestor/Multiple-Jesse-Projects | f66a6eed79117fd005668f79e0bee3d8ac76e2b8 | [
"Apache-2.0"
] | null | null | null | y={0:{'Jesse Leite',23,'Best computer Engineer'},1:{'Lana Rhoades',22,'Best pleasure professional'}}
with open('file.txt', 'w') as file:
file.write("Python and Jesse built this file!")
with open('file.txt', 'a') as file:
file.write('\nJesse\n'+str(y)+'\n'+str(y))
inf=[]
with open('file.data', 'r') as file:
fo... | 35.606061 | 147 | 0.560851 | y={0:{'Jesse Leite',23,'Best computer Engineer'},1:{'Lana Rhoades',22,'Best pleasure professional'}}
with open('file.txt', 'w') as file:
file.write("Python and Jesse built this file!")
with open('file.txt', 'a') as file:
file.write('\nJesse\n'+str(y)+'\n'+str(y))
inf=[]
with open('file.data', 'r') as file:
fo... | true | true |
f734d1f2191f58f7a8e4dabb4fc3ba6dbc11ad51 | 158 | py | Python | depth/core/evaluation/__init__.py | zhyever/Monocular-Depth-Estimation-Toolbox | c591b9711321450387ffa7322ec1db9a340347c2 | [
"Apache-2.0"
] | 21 | 2022-03-12T01:42:05.000Z | 2022-03-31T17:01:45.000Z | depth/core/evaluation/__init__.py | zhyever/Monocular-Depth-Estimation-Toolbox | c591b9711321450387ffa7322ec1db9a340347c2 | [
"Apache-2.0"
] | 2 | 2022-03-29T10:50:33.000Z | 2022-03-30T10:40:53.000Z | depth/core/evaluation/__init__.py | zhyever/Monocular-Depth-Estimation-Toolbox | c591b9711321450387ffa7322ec1db9a340347c2 | [
"Apache-2.0"
] | 3 | 2022-03-26T11:52:44.000Z | 2022-03-30T21:24:16.000Z | # Copyright (c) OpenMMLab. All rights reserved.
from .metrics import metrics, eval_metrics, pre_eval_to_metrics
from .eval_hooks import EvalHook, DistEvalHook | 52.666667 | 63 | 0.829114 |
from .metrics import metrics, eval_metrics, pre_eval_to_metrics
from .eval_hooks import EvalHook, DistEvalHook | true | true |
f734d27754536095a51f7b1e9025b5c86e2bfe24 | 3,601 | py | Python | amplimap/coverage.py | koelling/amplimap | cbd5b7b8c2f703982d8964a3c77bd350a47f08a6 | [
"Apache-2.0"
] | 11 | 2019-04-08T15:41:50.000Z | 2020-11-04T14:25:19.000Z | amplimap/coverage.py | koelling/amplimap | cbd5b7b8c2f703982d8964a3c77bd350a47f08a6 | [
"Apache-2.0"
] | 5 | 2018-05-23T10:30:18.000Z | 2021-06-29T09:33:17.000Z | amplimap/coverage.py | koelling/amplimap | cbd5b7b8c2f703982d8964a3c77bd350a47f08a6 | [
"Apache-2.0"
] | 9 | 2019-04-08T15:16:04.000Z | 2021-06-09T15:14:09.000Z | # -*- coding: utf-8 -*-
"""
This module contains methods for processing and aggregating coverage files generated by ``bedtools``.
"""
import pandas as pd
import numpy as np
import re
import os
from .reader import read_sample_info
cov_cols = ['Target', 'min_coverage', 'sum_coverage', 'basepairs', 'cov_per_bp', 'fract... | 36.744898 | 159 | 0.663149 |
import pandas as pd
import numpy as np
import re
import os
from .reader import read_sample_info
cov_cols = ['Target', 'min_coverage', 'sum_coverage', 'basepairs', 'cov_per_bp', 'fraction_zero_coverage', 'fraction_10x_coverage', 'fraction_30x_coverage']
cov_cols_dtypes = dict(zip(cov_cols, [str, int, int, int, float... | true | true |
f734d2d7c65ce3567f24d550214f74a82b5809d1 | 4,413 | py | Python | src/streamlink/plugins/vimeo.py | kyldery/streamlink | ef36240408c194a543557fb31e4535b0426ec153 | [
"BSD-2-Clause"
] | 1 | 2022-02-25T20:14:03.000Z | 2022-02-25T20:14:03.000Z | src/streamlink/plugins/vimeo.py | kyldery/streamlink | ef36240408c194a543557fb31e4535b0426ec153 | [
"BSD-2-Clause"
] | null | null | null | src/streamlink/plugins/vimeo.py | kyldery/streamlink | ef36240408c194a543557fb31e4535b0426ec153 | [
"BSD-2-Clause"
] | 12 | 2022-01-30T23:34:18.000Z | 2022-03-26T17:09:43.000Z | """
$description Global live streaming and video hosting social platform.
$url vimeo.com
$type live, vod
$notes Password protected streams are not supported
"""
import logging
import re
from html import unescape as html_unescape
from urllib.parse import urlparse
from streamlink.plugin import Plugin, PluginArgument, P... | 37.084034 | 98 | 0.554498 |
import logging
import re
from html import unescape as html_unescape
from urllib.parse import urlparse
from streamlink.plugin import Plugin, PluginArgument, PluginArguments, pluginmatcher
from streamlink.plugin.api import validate
from streamlink.stream.dash import DASHStream
from streamlink.stream.ffmpegmux import Mu... | true | true |
f734d363117a1d24b35c8edb306662ee55c567e1 | 625 | py | Python | flatland/database/population/node/diagram_type_instances.py | lelandstarr/flatland-model-diagram-editor | dfbd10d80542359c6951d7b039a5a4e3da2a0f50 | [
"MIT"
] | 10 | 2021-01-03T16:47:34.000Z | 2022-03-30T18:47:07.000Z | flatland/database/population/node/diagram_type_instances.py | lelandstarr/flatland-model-diagram-editor | dfbd10d80542359c6951d7b039a5a4e3da2a0f50 | [
"MIT"
] | 91 | 2021-01-09T02:14:13.000Z | 2022-02-24T10:24:10.000Z | flatland/database/population/node/diagram_type_instances.py | lelandstarr/flatland-model-diagram-editor | dfbd10d80542359c6951d7b039a5a4e3da2a0f50 | [
"MIT"
] | 1 | 2021-01-13T22:13:19.000Z | 2021-01-13T22:13:19.000Z | """
diagram_type_instances.py
"""
population = [
{'Name': 'class', 'Abbreviation': 'CD',
'About': 'Show data, logic and constraints in a domain'},
{'Name': 'state machine', 'Abbreviation': 'SMD',
'About': 'lifecycle of a class or assigner relationship'},
{'Name': 'class collaboration', 'Abbreviat... | 39.0625 | 92 | 0.6512 |
population = [
{'Name': 'class', 'Abbreviation': 'CD',
'About': 'Show data, logic and constraints in a domain'},
{'Name': 'state machine', 'Abbreviation': 'SMD',
'About': 'lifecycle of a class or assigner relationship'},
{'Name': 'class collaboration', 'Abbreviation': 'CCD',
'About': 'Shows ... | true | true |
f734d3c25a06993d61e3d706c674c3425718395c | 12,885 | py | Python | python/paddle/fluid/tests/unittests/xpu/test_softmax_with_cross_entropy_op_xpu.py | joey12300/Paddle | 59102c6dcd2def3091f5c37816354ac69d669809 | [
"Apache-2.0"
] | 1 | 2020-12-03T05:11:47.000Z | 2020-12-03T05:11:47.000Z | python/paddle/fluid/tests/unittests/xpu/test_softmax_with_cross_entropy_op_xpu.py | joey12300/Paddle | 59102c6dcd2def3091f5c37816354ac69d669809 | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/tests/unittests/xpu/test_softmax_with_cross_entropy_op_xpu.py | joey12300/Paddle | 59102c6dcd2def3091f5c37816354ac69d669809 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 32.374372 | 80 | 0.632906 |
from __future__ import print_function
import sys
sys.path.append("..")
from test_softmax_op import stable_softmax
from op_test import OpTest
import paddle.fluid.core as core
import paddle
import unittest
import numpy as np
def cross_entropy(softmax, label, soft_label, axis, ignore_index=-1):
if so... | true | true |
f734d4b1af0cc7fc43f7f8c7fe07948454d387eb | 5,473 | py | Python | tensorflow/python/kernel_tests/math_ops/argmax_op_test.py | computationalartist/tensorflow | b89cf636c412abdff53b3e8f201bde671c92209d | [
"Apache-2.0"
] | 190,993 | 2015-11-09T13:17:30.000Z | 2022-03-31T23:05:27.000Z | tensorflow/python/kernel_tests/math_ops/argmax_op_test.py | computationalartist/tensorflow | b89cf636c412abdff53b3e8f201bde671c92209d | [
"Apache-2.0"
] | 48,461 | 2015-11-09T14:21:11.000Z | 2022-03-31T23:17:33.000Z | tensorflow/python/kernel_tests/math_ops/argmax_op_test.py | computationalartist/tensorflow | b89cf636c412abdff53b3e8f201bde671c92209d | [
"Apache-2.0"
] | 104,981 | 2015-11-09T13:40:17.000Z | 2022-03-31T19:51:54.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 34.20625 | 80 | 0.661794 |
import functools
import numpy as np
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import test_util
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import math_ops
from tensorflow.python.platform import test
class ArgMaxTest(test.TestCase):
de... | true | true |
f734d54a61d5c8de8595c92a6ae6ea4360716489 | 14,386 | py | Python | pyscf/grad/casci.py | QuESt-Calculator/pyscf | 0ed03633b699505c7278f1eb501342667d0aa910 | [
"Apache-2.0"
] | 501 | 2018-12-06T23:48:17.000Z | 2022-03-31T11:53:18.000Z | pyscf/grad/casci.py | QuESt-Calculator/pyscf | 0ed03633b699505c7278f1eb501342667d0aa910 | [
"Apache-2.0"
] | 710 | 2018-11-26T22:04:52.000Z | 2022-03-30T03:53:12.000Z | pyscf/grad/casci.py | QuESt-Calculator/pyscf | 0ed03633b699505c7278f1eb501342667d0aa910 | [
"Apache-2.0"
] | 273 | 2018-11-26T10:10:24.000Z | 2022-03-30T12:25:28.000Z | #!/usr/bin/env python
# Copyright 2014-2020 The PySCF Developers. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# U... | 39.740331 | 100 | 0.605172 |
import sys
from functools import reduce
import numpy
from pyscf import lib
from pyscf import ao2mo
from pyscf.lib import logger
from pyscf.grad import rhf as rhf_grad
from pyscf.grad.mp2 import _shell_prange
from pyscf.scf import cphf
if sys.version_info < (3,):
RANGE_TYPE = list
else:
RANG... | true | true |
f734d5b2ccd738ec641aa3b8d778120e95269d71 | 18,438 | py | Python | keras/utils/layer_utils_test.py | tsheaff/keras | ee227dda766d769b7499a5549e8ed77b5e88105b | [
"Apache-2.0"
] | 1 | 2020-02-02T04:43:33.000Z | 2020-02-02T04:43:33.000Z | keras/utils/layer_utils_test.py | tsheaff/keras | ee227dda766d769b7499a5549e8ed77b5e88105b | [
"Apache-2.0"
] | 1 | 2022-03-31T16:40:51.000Z | 2022-03-31T16:40:51.000Z | keras/utils/layer_utils_test.py | tsheaff/keras | ee227dda766d769b7499a5549e8ed77b5e88105b | [
"Apache-2.0"
] | 1 | 2020-12-13T22:14:48.000Z | 2020-12-13T22:14:48.000Z | # Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 37.628571 | 255 | 0.558087 |
import keras
import tensorflow.compat.v2 as tf
import collections
import contextlib
import multiprocessing.dummy
import os
import pickle
import shutil
import sys
import time
import timeit
import numpy as np
from keras.utils import io_utils
from keras.utils import layer_utils
_PICKLEABLE_CALL_COUNT = ... | true | true |
f734d64a2d3fe42732aa1ee1e867be66cb0f7bf3 | 47,046 | py | Python | ranger/config_ranger/commands_full.py | nexayq/dot_files | 473614b8ecdb4efb3ae7098ef3d8687da0585260 | [
"MIT"
] | null | null | null | ranger/config_ranger/commands_full.py | nexayq/dot_files | 473614b8ecdb4efb3ae7098ef3d8687da0585260 | [
"MIT"
] | null | null | null | ranger/config_ranger/commands_full.py | nexayq/dot_files | 473614b8ecdb4efb3ae7098ef3d8687da0585260 | [
"MIT"
] | 2 | 2016-10-24T08:36:03.000Z | 2018-09-09T15:32:21.000Z | # -*- coding: utf-8 -*-
# This file is part of ranger, the console file manager.
# This configuration file is licensed under the same terms as ranger.
# ===================================================================
#
# NOTE: If you copied this file to ~/.config/ranger/commands_full.py,
# then it will NOT be loade... | 30.728935 | 111 | 0.57244 |
# It's all in python; lines beginning with
# But make sure you update your configs when you update ranger.
#
# ===================================================================
# Every class defined here which is a subclass of `Command' will be used as a
#
# =======================... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.