hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | 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 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
690c0c0baa72e71fb3302292e6f136edd4cafd27 | 3,594 | py | Python | deep_rl/utils/plot.py | JACKHAHA363/DeepRL | 5e91086c17fd6de85f4d53873fab17e049dd5df5 | [
"Apache-2.0"
] | null | null | null | deep_rl/utils/plot.py | JACKHAHA363/DeepRL | 5e91086c17fd6de85f4d53873fab17e049dd5df5 | [
"Apache-2.0"
] | null | null | null | deep_rl/utils/plot.py | JACKHAHA363/DeepRL | 5e91086c17fd6de85f4d53873fab17e049dd5df5 | [
"Apache-2.0"
] | null | null | null | # Adapted from https://github.com/openai/baselines/blob/master/baselines/results_plotter.py
from ..component.bench import load_monitor_log
import numpy as np
import os
import re
class Plotter:
COLORS = ['blue', 'green', 'red', 'cyan', 'magenta', 'yellow', 'black', 'purple', 'pink',
'brown', 'orange... | 36.673469 | 104 | 0.569004 |
7b87bea272c714bc08d65bbd54ca8f0cafb83010 | 722 | py | Python | services/ec2/sample.py | rolandovillca/aws_samples_boto3_sd | 92cb404b96e252c15547593e273e0ab15aa74e14 | [
"MIT"
] | null | null | null | services/ec2/sample.py | rolandovillca/aws_samples_boto3_sd | 92cb404b96e252c15547593e273e0ab15aa74e14 | [
"MIT"
] | null | null | null | services/ec2/sample.py | rolandovillca/aws_samples_boto3_sd | 92cb404b96e252c15547593e273e0ab15aa74e14 | [
"MIT"
] | null | null | null | '''
====================
Boto 3 - EC2 Example
====================
This application implements the EC2 service that lets you gets
information from Amazon EC2. See the README for more details.
'''
import boto3
import json
config = json.loads(open('config/defaults.json').read())
credentials = config['credentials']
AWS_... | 27.769231 | 64 | 0.691136 |
a465135aefbe385160c9287bd595183c71c2e124 | 4,826 | py | Python | tuun/probo/models/regression/transfer_regression.py | petuum/tuun | 8eec472dbf0e5e695449b0fa2d98985469fd5b30 | [
"Apache-2.0"
] | 33 | 2020-08-30T16:22:35.000Z | 2022-02-26T13:48:32.000Z | tuun/probo/models/regression/transfer_regression.py | petuum/tuun | 8eec472dbf0e5e695449b0fa2d98985469fd5b30 | [
"Apache-2.0"
] | 2 | 2021-01-18T19:46:43.000Z | 2021-03-24T09:59:14.000Z | tuun/probo/models/regression/transfer_regression.py | petuum/tuun | 8eec472dbf0e5e695449b0fa2d98985469fd5b30 | [
"Apache-2.0"
] | 2 | 2020-08-25T17:02:15.000Z | 2021-04-21T16:40:44.000Z | import os
import shutil
import tempfile
import joblib
import tarfile
from urllib.request import urlopen
from pathlib import Path
import numpy as np
ENV_TUUN_CACHE = 'TUUN_CACHE'
ENV_XDG_CACHE_HOME = 'XDG_CACHE_HOME'
DEFAULT_CACHE_DIR = '~/.cache'
def get_tuun_cache_dir():
"""Return default cache directory."""
... | 34.971014 | 86 | 0.631372 |
3217b00d6a8c355ea2b2ea7926ccd4a29f1b0506 | 603 | py | Python | h/migrations/versions/1a40e75a524d_add_normalised_username_index.py | y3g0r/h | a057144956fe25e669aeba5d0f0eb38f9dc09566 | [
"BSD-2-Clause"
] | null | null | null | h/migrations/versions/1a40e75a524d_add_normalised_username_index.py | y3g0r/h | a057144956fe25e669aeba5d0f0eb38f9dc09566 | [
"BSD-2-Clause"
] | null | null | null | h/migrations/versions/1a40e75a524d_add_normalised_username_index.py | y3g0r/h | a057144956fe25e669aeba5d0f0eb38f9dc09566 | [
"BSD-2-Clause"
] | null | null | null | """
Add normalised username index
Revision ID: 1a40e75a524d
Revises: 02db2fa6ea98
Create Date: 2017-03-02 13:55:24.290975
"""
from alembic import op
import sqlalchemy as sa
revision = "1a40e75a524d"
down_revision = "02db2fa6ea98"
def upgrade():
# Creating an index concurrently does not work inside a transacti... | 20.1 | 71 | 0.676617 |
245e39c83b02406f6ee86409a4188b30420705ac | 1,132 | py | Python | idt_oauth2/clients/slack.py | idonethis/idt_oauth2 | 1df13ff424a86e855663bd0d30a9a2679597db88 | [
"MIT"
] | null | null | null | idt_oauth2/clients/slack.py | idonethis/idt_oauth2 | 1df13ff424a86e855663bd0d30a9a2679597db88 | [
"MIT"
] | null | null | null | idt_oauth2/clients/slack.py | idonethis/idt_oauth2 | 1df13ff424a86e855663bd0d30a9a2679597db88 | [
"MIT"
] | null | null | null | import logging
import requests
from django.conf import settings
OAUTH2_AUTHORIZE_URL = '%s/oauth/authorize' % settings.SLACK_DOMAIN
OAUTH2_TOKEN_EXCHANGE_URL = '%s/api/oauth.access' % settings.SLACK_DOMAIN
def get_authorize_config(redirect_uri):
service_url = OAUTH2_AUTHORIZE_URL
query_params = {
'cl... | 31.444444 | 90 | 0.689046 |
b8206d5bb41899ed9ef9d0c87a325410f03499c6 | 445 | py | Python | knx_stack/definition/knxnet_ip/core/connect/req.py | majamassarini/knx-stack | 11a9baac6b7600649b5fbca43c93b200b23676b4 | [
"MIT"
] | 2 | 2021-07-28T07:42:28.000Z | 2022-01-25T18:56:05.000Z | knx_stack/definition/knxnet_ip/core/connect/req.py | majamassarini/knx-stack | 11a9baac6b7600649b5fbca43c93b200b23676b4 | [
"MIT"
] | 6 | 2021-07-25T21:36:01.000Z | 2022-02-20T21:11:31.000Z | knx_stack/definition/knxnet_ip/core/connect/req.py | majamassarini/knx-stack | 11a9baac6b7600649b5fbca43c93b200b23676b4 | [
"MIT"
] | null | null | null | from typing import NamedTuple
class Msg(NamedTuple):
addr_control_endpoint: str
port_control_endpoint: int
addr_data_endpoint: str
port_data_endpoint: int
def __repr__(self):
return "ConnectReq (control endpoint = {}:{} data endpoint {}:{})".format(
self.addr_control_endpoint,... | 26.176471 | 82 | 0.65618 |
3f0b7326cc64ecfb87374c43ab65ea8946843669 | 12,326 | py | Python | userbot/plugins/user_info.py | gamerfuckerofficial/userbot | 887332ab492a2deb6152257f0c169a895234eb7b | [
"MIT"
] | 3 | 2020-09-04T09:34:51.000Z | 2020-09-04T09:39:26.000Z | userbot/plugins/user_info.py | gamerfuckerofficial/userbot | 887332ab492a2deb6152257f0c169a895234eb7b | [
"MIT"
] | null | null | null | userbot/plugins/user_info.py | gamerfuckerofficial/userbot | 887332ab492a2deb6152257f0c169a895234eb7b | [
"MIT"
] | null | null | null | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.d (the "License");
# you may not use this file except in compliance with the License.
#
""" Userbot module for getting info
about any user on Telegram(including you!). """
from telethon.events import Ne... | 29.417661 | 92 | 0.601331 |
6df3b8b6c75246abe657f148c97f1d731ac74fa3 | 848 | py | Python | examples/example.py | pgraafstra/pastas | c065059e1df5b6c8e4afeb5278de2ef70fdf726c | [
"MIT"
] | null | null | null | examples/example.py | pgraafstra/pastas | c065059e1df5b6c8e4afeb5278de2ef70fdf726c | [
"MIT"
] | null | null | null | examples/example.py | pgraafstra/pastas | c065059e1df5b6c8e4afeb5278de2ef70fdf726c | [
"MIT"
] | null | null | null | """
This test file is meant for developing purposes. Providing an easy method to
test the functioning of PASTAS during development.
"""
import pandas as pd
import pastas as ps
ps.set_log_level("ERROR")
# read observations and create the time series model
obs = pd.read_csv("data/head_nb1.csv", index_col=0, parse_dat... | 25.69697 | 76 | 0.683962 |
b858eee43e266d8c44c741a7f664b31d1f3fe383 | 4,858 | py | Python | tests/test_update.py | timgates42/blitzdb | 36191579be14fbc2d7a47ede099bcdf31297a9fa | [
"MIT"
] | 252 | 2015-01-02T13:05:12.000Z | 2021-12-29T13:36:47.000Z | tests/test_update.py | epatters/blitzdb | 4b459e0bcde9e1f6224dd4e3bea74194586864b0 | [
"MIT"
] | 33 | 2015-01-09T20:05:10.000Z | 2019-11-08T15:48:34.000Z | tests/test_update.py | epatters/blitzdb | 4b459e0bcde9e1f6224dd4e3bea74194586864b0 | [
"MIT"
] | 39 | 2015-01-20T01:15:04.000Z | 2022-03-26T01:01:15.000Z | from __future__ import absolute_import
import pytest
from blitzdb.backends.file import Backend as FileBackend
from .helpers.movie_data import Actor
def test_update_by_list(backend):
if isinstance(backend,FileBackend):
return
actor = Actor({'name': 'Robert de Niro', 'age': 54})
backend.save(a... | 23.582524 | 71 | 0.64224 |
0d1e849673ca2ac8ab79f66f816f4f88131662f5 | 908 | py | Python | ch03/q3-02.py | iamnicoj/ctci | f71f995cb3d3257d3d58f1f167fcab8eaf84d457 | [
"MIT"
] | null | null | null | ch03/q3-02.py | iamnicoj/ctci | f71f995cb3d3257d3d58f1f167fcab8eaf84d457 | [
"MIT"
] | 3 | 2021-03-19T14:35:27.000Z | 2021-03-20T16:12:34.000Z | ch03/q3-02.py | iamnicoj/ctci | f71f995cb3d3257d3d58f1f167fcab8eaf84d457 | [
"MIT"
] | null | null | null | from stack import stack
class min_stack(stack):
def __init__(self):
super().__init__()
self.minima = stack() # This could've been a stack itself
def min(self):
if len(self.list) > 0:
return self.list[self.minima.peek()]
return None
def push(self, item):
... | 19.73913 | 68 | 0.54185 |
803e294015eca47af25e6366107a407ac778e8ca | 3,903 | py | Python | ui/dialogs/ui_addseq.py | dongniu/cadnano2 | 6805fe2af856c59b06373c0ee0142ad6bc286262 | [
"Unlicense"
] | 17 | 2015-02-07T03:46:49.000Z | 2021-09-25T09:23:41.000Z | ui/dialogs/ui_addseq.py | scholer/cadnano2 | 0b8bba1ab3277ac9859ef78615890d351561784c | [
"Unlicense"
] | 2 | 2017-08-22T03:17:16.000Z | 2021-07-03T14:42:41.000Z | ui/dialogs/ui_addseq.py | scholer/cadnano2 | 0b8bba1ab3277ac9859ef78615890d351561784c | [
"Unlicense"
] | 9 | 2015-09-06T22:41:38.000Z | 2022-03-27T13:57:37.000Z | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'dialogs/addseq.ui'
#
# Created: Thu Jul 21 17:35:26 2011
# by: PyQt4 UI code generator snapshot-4.8.3-fbc8b1362812
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QS... | 55.757143 | 171 | 0.738663 |
3a90056e723e3b566c5fdc79a6d16015248e3a03 | 1,781 | py | Python | universalTranslator.py | GHawk1124/Universal-Translator | 0acb0059f994912c813adfb755a27662f3dd80fd | [
"MIT"
] | null | null | null | universalTranslator.py | GHawk1124/Universal-Translator | 0acb0059f994912c813adfb755a27662f3dd80fd | [
"MIT"
] | null | null | null | universalTranslator.py | GHawk1124/Universal-Translator | 0acb0059f994912c813adfb755a27662f3dd80fd | [
"MIT"
] | null | null | null | """Universal Translator.
Usage:
universalTranslator.py (-h | --help)
universalTranslator.py --version
universalTranslator.py [-rc | --record] [-u | --upload] [-rg | --recognize] [-t | --translate] [-s | --say] [--config] [--noise-reduce]
universalTranslator.py (-a | -all) [-u | --upload]
universalTranslator... | 35.62 | 138 | 0.586188 |
b0d7c038fc4a60ecdb6b3ed2aa8e1d0c18be22c0 | 14,530 | py | Python | exchangelib/items/contact.py | mishmashclone/ecederstrand-exchangelib | 1bbae0e527dc82a45bf3b5946b438d69de96c20f | [
"BSD-2-Clause"
] | null | null | null | exchangelib/items/contact.py | mishmashclone/ecederstrand-exchangelib | 1bbae0e527dc82a45bf3b5946b438d69de96c20f | [
"BSD-2-Clause"
] | null | null | null | exchangelib/items/contact.py | mishmashclone/ecederstrand-exchangelib | 1bbae0e527dc82a45bf3b5946b438d69de96c20f | [
"BSD-2-Clause"
] | null | null | null | import datetime
import logging
from .item import Item
from ..fields import BooleanField, Base64Field, TextField, ChoiceField, URIField, DateTimeBackedDateField, \
PhoneNumberField, EmailAddressesField, PhysicalAddressField, Choice, MemberListField, CharField, TextListField, \
EmailAddressField, IdElementField,... | 69.855769 | 119 | 0.783345 |
b1238a20fa74c4357c4a183f0972f544f912ad9f | 7,465 | py | Python | plugins/filters.py | binamracode/Auto-Filter-Bot-V2 | bec828192628d22c64c5d13110656ede766a099a | [
"MIT"
] | null | null | null | plugins/filters.py | binamracode/Auto-Filter-Bot-V2 | bec828192628d22c64c5d13110656ede766a099a | [
"MIT"
] | null | null | null | plugins/filters.py | binamracode/Auto-Filter-Bot-V2 | bec828192628d22c64c5d13110656ede766a099a | [
"MIT"
] | 1 | 2021-11-08T09:53:14.000Z | 2021-11-08T09:53:14.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @trojanzhex
import re
import pyrogram
from pyrogram import (
filters,
Client
)
from pyrogram.types import (
InlineKeyboardButton,
InlineKeyboardMarkup,
Message,
CallbackQuery
)
from bot import Bot
from script import script
from database.mdb... | 32.885463 | 179 | 0.538513 |
28b495ef33070f67096abebea4a9e2af97c9d58d | 826 | py | Python | tests/binarycodec/test_field_id_codec.py | mDuo13/xrpl-py | 70f927dcd2dbb8644b3e210b0a8de2a214e71e3d | [
"0BSD"
] | null | null | null | tests/binarycodec/test_field_id_codec.py | mDuo13/xrpl-py | 70f927dcd2dbb8644b3e210b0a8de2a214e71e3d | [
"0BSD"
] | null | null | null | tests/binarycodec/test_field_id_codec.py | mDuo13/xrpl-py | 70f927dcd2dbb8644b3e210b0a8de2a214e71e3d | [
"0BSD"
] | null | null | null | from unittest import TestCase
import xrpl.core.binarycodec.field_id_codec as field_id_codec
from tests.binarycodec.fixtures import data_driven_fixtures
class TestFieldIDCodec(TestCase):
"""`See FieldIDs <https://xrpl.org/serialization.html#field-ids>`_."""
def setUp(self):
self.field_tests = data_dr... | 34.416667 | 81 | 0.688862 |
7302d41cefc2c103341a34d8bfe8f8c8c4613d5c | 13,322 | py | Python | tests/test_band_mapper.py | whatnick/datacube-ows | 408dd7617b800d4fa0424462936e54782f402b1b | [
"Apache-2.0"
] | null | null | null | tests/test_band_mapper.py | whatnick/datacube-ows | 408dd7617b800d4fa0424462936e54782f402b1b | [
"Apache-2.0"
] | null | null | null | tests/test_band_mapper.py | whatnick/datacube-ows | 408dd7617b800d4fa0424462936e54782f402b1b | [
"Apache-2.0"
] | null | null | null | import datetime
import datacube_ows.band_mapper as bm
from datacube_ows.band_mapper import StyleDef
from datacube_ows.ogc_utils import DataCollection, DatasetCollection
from datacube_ows.ows_configuration import BandIndex, OWSProductLayer
from xarray import DataArray, Dataset
from unittest.mock import patch
import ... | 28.711207 | 108 | 0.54759 |
59baef8dd36ba5e191eaf5cf703b757fa6dfaba9 | 2,214 | py | Python | api/environments/identities/traits/tests/test_models.py | btasker/flagsmith | f8fab5a6e8f8b649e56e16443267d8cdb645a49b | [
"BSD-3-Clause"
] | null | null | null | api/environments/identities/traits/tests/test_models.py | btasker/flagsmith | f8fab5a6e8f8b649e56e16443267d8cdb645a49b | [
"BSD-3-Clause"
] | 7 | 2021-10-01T01:17:49.000Z | 2021-10-12T15:44:48.000Z | api/environments/identities/traits/tests/test_models.py | admariner/flagsmith | cb5d9fe163fa6974b3e322c2237776b5ef09acf9 | [
"BSD-3-Clause"
] | null | null | null | from unittest import mock
import pytest
from flag_engine.identities.builders import build_identity_dict
from environments.identities.traits.models import Trait
@pytest.mark.parametrize(
"value, expected_data",
(
(1, {"value_type": "int", "integer_value": 1}),
(0, {"value_type": "int", "integ... | 30.328767 | 81 | 0.609304 |
f17325881bf9952dd30a1fe08e672af390423ebb | 2,460 | py | Python | source/utils.py | vihaton/calendar-helper | 535b50a24972f6e1b5894aa2e681809805d790ef | [
"MIT"
] | 1 | 2021-01-20T22:52:32.000Z | 2021-01-20T22:52:32.000Z | source/utils.py | vihaton/calendar-helper | 535b50a24972f6e1b5894aa2e681809805d790ef | [
"MIT"
] | null | null | null | source/utils.py | vihaton/calendar-helper | 535b50a24972f6e1b5894aa2e681809805d790ef | [
"MIT"
] | null | null | null | from __future__ import print_function
import datetime
import pickle
import os.path
from google import auth
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
# If modifying these scopes, delete the file token.pickle.
SCO... | 33.243243 | 104 | 0.653252 |
a8cc014c1a4f9df8fbe893c1e90620db84c31446 | 2,037 | py | Python | clean.py | opendxl/opendxl-tie-client-python | 652261be44986c513caed6b62112f935dcf1e295 | [
"Apache-2.0"
] | 18 | 2016-12-19T18:19:39.000Z | 2020-07-16T17:01:36.000Z | clean.py | opendxl/opendxl-tie-client-python | 652261be44986c513caed6b62112f935dcf1e295 | [
"Apache-2.0"
] | 17 | 2017-03-30T11:51:27.000Z | 2021-11-12T10:17:20.000Z | clean.py | opendxl/opendxl-tie-client-python | 652261be44986c513caed6b62112f935dcf1e295 | [
"Apache-2.0"
] | 13 | 2016-12-19T18:19:41.000Z | 2018-07-11T22:09:56.000Z | from __future__ import absolute_import
from __future__ import print_function
import os
# pylint: disable=no-name-in-module, import-error
from distutils.dir_util import remove_tree
from shutil import copyfile
def clean_dir(src_dir, directory):
if os.path.exists(directory):
print("Cleaning directory: " + di... | 39.173077 | 81 | 0.682376 |
2e684fa432d93fc7a51f04a33900aaa652f7a910 | 40,232 | py | Python | canvasapi/canvas.py | phaustin/canvasapi | a488a974ef9d7037d615320802387e7d51279d65 | [
"MIT"
] | 1 | 2018-11-20T17:17:50.000Z | 2018-11-20T17:17:50.000Z | canvasapi/canvas.py | PennState/canvasapi | 077cbd51516484a5c44834c8aa3d0c4425e4ffcf | [
"MIT"
] | null | null | null | canvasapi/canvas.py | PennState/canvasapi | 077cbd51516484a5c44834c8aa3d0c4425e4ffcf | [
"MIT"
] | null | null | null | from __future__ import absolute_import, division, print_function, unicode_literals
import warnings
from canvasapi.account import Account
from canvasapi.course import Course
from canvasapi.current_user import CurrentUser
from canvasapi.exceptions import RequiredFieldMissing
from canvasapi.file import File
from canvasa... | 34.563574 | 115 | 0.616872 |
fa3aae5b700387bb3d175ada45f015beb71c916d | 16,463 | py | Python | patches/kaggle_gcp.py | rpatil524/docker-python | 97ab4b8de203f4856cf5bcb7960419ad2b982c39 | [
"Apache-2.0"
] | 2 | 2020-12-16T20:47:59.000Z | 2021-06-03T16:32:33.000Z | patches/kaggle_gcp.py | aniketmaurya/docker-python | 5be3502c23f2212e5c53fca33586cc212936f366 | [
"Apache-2.0"
] | null | null | null | patches/kaggle_gcp.py | aniketmaurya/docker-python | 5be3502c23f2212e5c53fca33586cc212936f366 | [
"Apache-2.0"
] | null | null | null | import os
import inspect
from google.auth import credentials, environment_vars
from google.auth.exceptions import RefreshError
from google.api_core.gapic_v1.client_info import ClientInfo
from google.cloud import bigquery
from google.cloud.exceptions import Forbidden
from google.cloud.bigquery._http import Connection
fr... | 41.573232 | 123 | 0.717974 |
d0e98972adad372c61ede004d625adce31eac249 | 22,105 | py | Python | python/ray/tests/test_basic.py | FarzanT/ray | d747071dd9e883bd4ceefe80d0344f287630c4e5 | [
"Apache-2.0"
] | null | null | null | python/ray/tests/test_basic.py | FarzanT/ray | d747071dd9e883bd4ceefe80d0344f287630c4e5 | [
"Apache-2.0"
] | null | null | null | python/ray/tests/test_basic.py | FarzanT/ray | d747071dd9e883bd4ceefe80d0344f287630c4e5 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
import logging
import os
import pickle
import sys
import time
import numpy as np
import pytest
import ray
import ray.cluster_utils
import ray.test_utils
logger = logging.getLogger(__name__)
# https://github.com/ray-project/ray/issues/6662
def test_ignore_http_proxy(shutdown_only):
ray.init(num_... | 29.952575 | 78 | 0.614748 |
035f2202dc0c7018d0c5b864725419101e6e2e2a | 739 | py | Python | bradocs4py/validadoresie/validadorrs.py | namio/BRADocs4Py | 3d0343abd367e0e5ce2222740c9953d482daa6ac | [
"MIT"
] | 11 | 2019-06-19T15:08:09.000Z | 2021-11-12T17:45:49.000Z | bradocs4py/validadoresie/validadorrs.py | namio/BRADocs4Py | 3d0343abd367e0e5ce2222740c9953d482daa6ac | [
"MIT"
] | 1 | 2020-10-04T17:50:08.000Z | 2020-10-04T17:50:08.000Z | bradocs4py/validadoresie/validadorrs.py | namio/BRADocs4Py | 3d0343abd367e0e5ce2222740c9953d482daa6ac | [
"MIT"
] | 3 | 2021-07-24T01:55:56.000Z | 2021-12-26T22:51:15.000Z | # -*- coding: utf-8 -*-
import re
from itertools import chain
class ValidadorRS(object):
"""
Realiza a validação de cadeias de caracteres (strings) que representam
o número da Inscrição Estadual do Estado do Rio Grande do Sul, conforme regras
encontradas em http://www.sintegra.gov.br/Cad_Estados/cad_RS.html.
""... | 22.393939 | 79 | 0.664411 |
27b10b7078944f7ea336ecc13f4be890bd51cb46 | 4,074 | py | Python | Implementation/reject_option.py | andreArtelt/explaining_lvq_reject | 9c59ad1cba1f9e763d5d3f67c6037d38fcdcff5a | [
"MIT"
] | null | null | null | Implementation/reject_option.py | andreArtelt/explaining_lvq_reject | 9c59ad1cba1f9e763d5d3f67c6037d38fcdcff5a | [
"MIT"
] | null | null | null | Implementation/reject_option.py | andreArtelt/explaining_lvq_reject | 9c59ad1cba1f9e763d5d3f67c6037d38fcdcff5a | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
import numpy as np
from sklearn_lvq import GmlvqModel
from lvq import build_pairwise_lvq_classifiers
class RejectOption(ABC):
def __init__(self, threshold, **kwds):
self.threshold = threshold
super().__init__(**kwds)
@abstractmethod
def criterion(self... | 35.12069 | 135 | 0.69244 |
94d5c030497d6e1250fa6c88619ead8d44e550c9 | 2,267 | py | Python | docs/conf.py | korotkin/car_store_test | ff0e04116d6d3735e49252d499d766ac69131b24 | [
"MIT"
] | null | null | null | docs/conf.py | korotkin/car_store_test | ff0e04116d6d3735e49252d499d766ac69131b24 | [
"MIT"
] | null | null | null | docs/conf.py | korotkin/car_store_test | ff0e04116d6d3735e49252d499d766ac69131b24 | [
"MIT"
] | 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... | 35.984127 | 79 | 0.666079 |
952888e45d5a20d8c1a52939e67a328697a644a0 | 1,552 | py | Python | aries_cloudagent/protocols/credentials/handlers/credential_request_handler.py | euroledger/aries-cloudagent-python | caf457276b19df374c16c2890e1c7e4914f46254 | [
"Apache-2.0"
] | 2 | 2020-02-26T14:22:44.000Z | 2021-05-06T20:13:36.000Z | aries_cloudagent/protocols/credentials/handlers/credential_request_handler.py | euroledger/aries-cloudagent-python | caf457276b19df374c16c2890e1c7e4914f46254 | [
"Apache-2.0"
] | 6 | 2021-03-10T20:05:19.000Z | 2022-02-27T05:41:09.000Z | aries_cloudagent/protocols/credentials/handlers/credential_request_handler.py | euroledger/aries-cloudagent-python | caf457276b19df374c16c2890e1c7e4914f46254 | [
"Apache-2.0"
] | 4 | 2020-02-19T23:02:11.000Z | 2021-11-18T11:33:43.000Z | """Credential request handler."""
from ....messaging.base_handler import (
BaseHandler,
BaseResponder,
HandlerException,
RequestContext,
)
from ..manager import CredentialManager
from ..messages.credential_request import CredentialRequest
class CredentialRequestHandler(BaseHandler):
"""Message h... | 31.673469 | 88 | 0.688789 |
010627b14e54722c366744b7db04a2d5ae35c75f | 2,535 | py | Python | test/test_rereference.py | haydard/wyrm | ff3f675ea71a45f1dd91ecbc5944229ebb3342ec | [
"MIT"
] | null | null | null | test/test_rereference.py | haydard/wyrm | ff3f675ea71a45f1dd91ecbc5944229ebb3342ec | [
"MIT"
] | null | null | null | test/test_rereference.py | haydard/wyrm | ff3f675ea71a45f1dd91ecbc5944229ebb3342ec | [
"MIT"
] | null | null | null | from __future__ import division
import unittest
import numpy as np
from wyrm.types import Data
from wyrm.processing import rereference
from wyrm.processing import swapaxes
CHANS = 5
SAMPLES = 20
EPOS = 3
class TestRereference(unittest.TestCase):
def setUp(self):
dat = np.zeros((SAMPLES, CHANS))
... | 32.088608 | 108 | 0.605917 |
127d047d609c19b2daa5f730f26916181bf2e7e6 | 7,856 | py | Python | Bio/Restriction/__init__.py | bioinf-mcb/biopython | 1a1f4a7ee4e0efba517d3d607c56c27e72e399cc | [
"BSD-3-Clause"
] | 5 | 2015-06-14T17:01:57.000Z | 2020-10-05T03:27:56.000Z | Bio/Restriction/__init__.py | uci-ics-32/biopython | ff7d3703d442192a1f6d84c52e028d566d44ff1c | [
"BSD-3-Clause"
] | 14 | 2021-03-26T20:54:22.000Z | 2021-04-06T17:18:53.000Z | Bio/Restriction/__init__.py | uci-ics-32/biopython | ff7d3703d442192a1f6d84c52e028d566d44ff1c | [
"BSD-3-Clause"
] | 8 | 2016-02-20T22:53:21.000Z | 2022-02-04T06:10:23.000Z | #!/usr/bin/env python
#
# Restriction Analysis Libraries.
# Copyright (C) 2004. Frederic Sohm.
#
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
#
"""Restriction Digest Enzymes.
Examples
--... | 41.347368 | 84 | 0.613671 |
7a33560ef9fa27e8f2abf779796626a1590e3860 | 5,422 | py | Python | core/src/epicli/cli/engine/ansible/AnsibleInventoryUpgrade.py | Mincom/epiphany | f0215e1272b014f093ca6be6c5eb5ba6c73d2c79 | [
"Apache-2.0"
] | 1 | 2021-02-04T07:40:01.000Z | 2021-02-04T07:40:01.000Z | core/src/epicli/cli/engine/ansible/AnsibleInventoryUpgrade.py | toszo/epiphany | db9e4777bf4c013e04a685cf72f62cabb484e363 | [
"Apache-2.0"
] | 1 | 2020-06-22T17:32:44.000Z | 2020-06-22T17:32:44.000Z | core/src/epicli/cli/engine/ansible/AnsibleInventoryUpgrade.py | toszo/epiphany | db9e4777bf4c013e04a685cf72f62cabb484e363 | [
"Apache-2.0"
] | null | null | null | import os
from ansible.parsing.dataloader import DataLoader
from ansible.inventory.manager import InventoryManager
from cli.helpers.Step import Step
from cli.helpers.build_saver import get_inventory_path_for_build, check_build_output_version, BUILD_LEGACY
from cli.models.AnsibleHostModel import AnsibleHostModel
from c... | 44.809917 | 130 | 0.666913 |
2a9622fa29511bb4a30584768e70bd53064321f1 | 13,192 | py | Python | tests/conftest.py | yashbhutwala/kopf | 4ad77dae699d8516ee7c189b11c6cedbe9224975 | [
"MIT"
] | null | null | null | tests/conftest.py | yashbhutwala/kopf | 4ad77dae699d8516ee7c189b11c6cedbe9224975 | [
"MIT"
] | null | null | null | tests/conftest.py | yashbhutwala/kopf | 4ad77dae699d8516ee7c189b11c6cedbe9224975 | [
"MIT"
] | null | null | null | import asyncio
import dataclasses
import io
import json
import logging
import os
import re
import sys
import time
from unittest.mock import Mock
import asynctest
import pykube
import pytest
import pytest_mock
from kopf.config import configure
from kopf.engines.logging import ObjectPrefixingFormatter
from kopf.reactor... | 34.176166 | 100 | 0.670179 |
660bac962799b3ebada0b5eaa341d1085fbf3e62 | 18,547 | py | Python | stdplugins/glink.py | dqanshi/PornHub | 162a7053ca7f2c0b3617b852559cfaf0502d94a7 | [
"Apache-2.0"
] | 55 | 2019-07-13T15:57:54.000Z | 2021-09-20T16:50:42.000Z | stdplugins/glink.py | dqanshi/PornHub | 162a7053ca7f2c0b3617b852559cfaf0502d94a7 | [
"Apache-2.0"
] | 3 | 2020-04-15T02:08:53.000Z | 2020-06-06T13:45:18.000Z | stdplugins/glink.py | dqanshi/PornHub | 162a7053ca7f2c0b3617b852559cfaf0502d94a7 | [
"Apache-2.0"
] | 450 | 2019-07-12T13:18:41.000Z | 2022-03-29T18:47:42.000Z | """Upload link to gDrive
Syntax:
.glink = shows link
.ghlink = hides link"""
# The entire code given below is verbatim copied from
# https://github.com/cyberboysumanjay/Gdrivedownloader/blob/master/gdrive_upload.py
# there might be some changes made to suit the needs for this repository
# Licensed under MIT License
... | 43.435597 | 189 | 0.616218 |
76df59cb560f26f2e7488ab774426e74ef766093 | 638 | py | Python | setup.py | irskep/gw0rp | f985c919141e19ee099766c18b7fe416f921836c | [
"MIT",
"BSD-3-Clause"
] | 1 | 2017-05-25T17:41:23.000Z | 2017-05-25T17:41:23.000Z | setup.py | irskep/gw0rp | f985c919141e19ee099766c18b7fe416f921836c | [
"MIT",
"BSD-3-Clause"
] | null | null | null | setup.py | irskep/gw0rp | f985c919141e19ee099766c18b7fe416f921836c | [
"MIT",
"BSD-3-Clause"
] | null | null | null | """
This is a setup.py script generated by py2applet
Usage:
python setup.py py2app
"""
from setuptools import setup
OPTIONS = dict(
argv_emulation=True,
frameworks=['libavbin.dylib','pymunk/libchipmunk.dylib'],
plist = dict(CFBundleIconFile='gw0rp.icns')#, PyRuntimeLocations=['/Library/Frameworks/Pyth... | 29 | 205 | 0.688088 |
7531bea649843a70ae47b1cd8de547237f6b2826 | 578 | py | Python | 22. Generate Parentheses.py | rohitpatwa/leetcode | f4826763e8f154cac9134d53b154b8299acd39a8 | [
"Xnet",
"X11",
"CECILL-B"
] | 1 | 2020-07-15T20:48:27.000Z | 2020-07-15T20:48:27.000Z | 22. Generate Parentheses.py | rohitpatwa/leetcode | f4826763e8f154cac9134d53b154b8299acd39a8 | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | 22. Generate Parentheses.py | rohitpatwa/leetcode | f4826763e8f154cac9134d53b154b8299acd39a8 | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | # Open parenthesen < n and closed parantheses < open. Keep recursing and backtrackting to generate all combinations.
def generateParenthesis(self, n: int) -> List[str]:
self.res = []
self.n = n
self.helper("", 0, 0)
return self.res
def helper(self, curr, start, end):
... | 30.421053 | 116 | 0.519031 |
fae30c9c8c8548d017a3cfd9a1274ae471278fb2 | 158 | py | Python | programming/Workshop Work/Exercises/ex53.py | probablyacat/degree_level1 | c08262514032ed86eb68c680e369bd9095954745 | [
"MIT"
] | null | null | null | programming/Workshop Work/Exercises/ex53.py | probablyacat/degree_level1 | c08262514032ed86eb68c680e369bd9095954745 | [
"MIT"
] | null | null | null | programming/Workshop Work/Exercises/ex53.py | probablyacat/degree_level1 | c08262514032ed86eb68c680e369bd9095954745 | [
"MIT"
] | null | null | null | #finding a square root of a number
#lets define some things
#x can be any positive integer
x = 4.0
#command for square rooting value x
y = x ** 0.5
print y
| 15.8 | 35 | 0.71519 |
e790386c3f583533ffe8dc416ebf5f860593fb4f | 1,925 | py | Python | nbs/dl2/exp/nb_09c.py | gdario/course-v3 | 9e4abe6abcb640282ccee553e6f244611917916c | [
"Apache-2.0"
] | null | null | null | nbs/dl2/exp/nb_09c.py | gdario/course-v3 | 9e4abe6abcb640282ccee553e6f244611917916c | [
"Apache-2.0"
] | null | null | null | nbs/dl2/exp/nb_09c.py | gdario/course-v3 | 9e4abe6abcb640282ccee553e6f244611917916c | [
"Apache-2.0"
] | null | null | null |
#################################################
### THIS FILE WAS AUTOGENERATED! DO NOT EDIT! ###
#################################################
# file to edit: dev_nb/09c_add_progress_bar.ipynb
from exp.nb_09b import *
import time
from fastprogress.fastprogress import master_bar, progress_bar
from fastprogress.... | 31.048387 | 80 | 0.608831 |
da52fa57f203232ac4e03cabaf697a967a491846 | 1,242 | py | Python | project_euler/023_abundant_numbers.py | sabih-h/number_theory_problems | 13c88801c81dac975e4712041f5661ff74c62ab4 | [
"MIT"
] | null | null | null | project_euler/023_abundant_numbers.py | sabih-h/number_theory_problems | 13c88801c81dac975e4712041f5661ff74c62ab4 | [
"MIT"
] | null | null | null | project_euler/023_abundant_numbers.py | sabih-h/number_theory_problems | 13c88801c81dac975e4712041f5661ff74c62ab4 | [
"MIT"
] | null | null | null | from datetime import datetime
start_time = datetime.now()
#This function takes a number as arguement
#and returns its proper divisors
def sum_proper_divisors(num):
total = 0
if num % 2 == 0:
a_set = {1}
for x in range(2, int(num/2)):
if num % x == 0:
a_set.add(num/x)
a_set.add(x)
total += x
e... | 18.537313 | 58 | 0.663446 |
a18dde41609ec9c5eb76efc174de6a9d7f426ae6 | 361 | py | Python | ex090.py | renatocortez/ExerciciosPython | 9095e1666953faf18c8e5d20b8d0fc3b2493a092 | [
"MIT"
] | null | null | null | ex090.py | renatocortez/ExerciciosPython | 9095e1666953faf18c8e5d20b8d0fc3b2493a092 | [
"MIT"
] | null | null | null | ex090.py | renatocortez/ExerciciosPython | 9095e1666953faf18c8e5d20b8d0fc3b2493a092 | [
"MIT"
] | null | null | null | aluno = dict()
aluno['nome'] = str(input('Nome: '))
aluno['media'] = float(input(f'Média de {aluno["nome"]}: '))
if aluno['media'] >= 7:
aluno['situacao'] = 'Aprovado'
elif 5 <= aluno['media'] < 7:
aluno['situacao'] = 'Recuperação'
else:
aluno['situacao'] = 'Reprovado'
print('-=' * 30)
for k, v in aluno.it... | 24.066667 | 60 | 0.570637 |
0964c4c292d792376bc5911826e6edcbc3248f4b | 234 | py | Python | Primeiros Passos/1-DAY ONE/Calculo de Acrescimov2.py | pedroluceena/TreinosPI | c11a76a1361f61a71e16edb2127eb08c12c090e1 | [
"MIT"
] | null | null | null | Primeiros Passos/1-DAY ONE/Calculo de Acrescimov2.py | pedroluceena/TreinosPI | c11a76a1361f61a71e16edb2127eb08c12c090e1 | [
"MIT"
] | null | null | null | Primeiros Passos/1-DAY ONE/Calculo de Acrescimov2.py | pedroluceena/TreinosPI | c11a76a1361f61a71e16edb2127eb08c12c090e1 | [
"MIT"
] | null | null | null | print('AUMENTO DE SALARIO')
salario=float(input('Qual é o valor do salario:R$'))
acrescimo=salario*0.15
s=salario+acrescimo
print('Parabéns o seu salario é R${} ,teve um aumento de 15% com isso ficou R${:.2f} reais'.format(salario,s)) | 46.8 | 110 | 0.735043 |
2f7359d27bc3e89c449b486f851556d3df150ec1 | 1,165 | py | Python | tests/algorithms/test_algorithm_hparams.py | mosaicml/composer | a253d7dee8278e66d036bc191111bbe264ace0da | [
"Apache-2.0"
] | 945 | 2021-10-13T16:24:20.000Z | 2022-03-31T21:21:54.000Z | tests/algorithms/test_algorithm_hparams.py | mosaicml/composer | a253d7dee8278e66d036bc191111bbe264ace0da | [
"Apache-2.0"
] | 544 | 2021-10-13T20:23:27.000Z | 2022-03-31T02:47:54.000Z | tests/algorithms/test_algorithm_hparams.py | mosaicml/composer | a253d7dee8278e66d036bc191111bbe264ace0da | [
"Apache-2.0"
] | 39 | 2021-10-13T14:33:33.000Z | 2022-03-31T11:13:19.000Z | # Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0
from typing import Type
import pytest
import composer.algorithms
from composer.algorithms.algorithm_hparams_registry import algorithm_registry
from composer.core import Algorithm
from tests.algorithms.algorithm_settings import get_alg_k... | 36.40625 | 90 | 0.820601 |
c8060d1e820e0441ece9d1e2942e35359593e29e | 714 | py | Python | create_derivatives/test_helpers.py | RockefellerArchiveCenter/pictor | 244b1a2016664974f38885d0ab2e6ac472306a85 | [
"MIT"
] | null | null | null | create_derivatives/test_helpers.py | RockefellerArchiveCenter/pictor | 244b1a2016664974f38885d0ab2e6ac472306a85 | [
"MIT"
] | 88 | 2021-07-21T15:14:40.000Z | 2022-03-10T20:11:40.000Z | create_derivatives/test_helpers.py | RockefellerArchiveCenter/pictor | 244b1a2016664974f38885d0ab2e6ac472306a85 | [
"MIT"
] | null | null | null | import shutil
from pathlib import Path
def make_dir(directory_path, remove_first=False, parents=True):
"""Makes a directory. If remove_first is set to true, removes directory if it exists; if set to false, does not make directory if it exists"""
path = Path(directory_path)
if path.exists() and remove_firs... | 37.578947 | 146 | 0.72409 |
10123e28c3e589361067b10abd3dd3b087cdeee9 | 5,858 | py | Python | model.py | Macc520/Vessel-segement-Pytorch | 6c76d8cad7f0d42cc359515dfc43956858382cb0 | [
"Unlicense"
] | null | null | null | model.py | Macc520/Vessel-segement-Pytorch | 6c76d8cad7f0d42cc359515dfc43956858382cb0 | [
"Unlicense"
] | null | null | null | model.py | Macc520/Vessel-segement-Pytorch | 6c76d8cad7f0d42cc359515dfc43956858382cb0 | [
"Unlicense"
] | null | null | null | # ==================================================================
class attention_block(nn.Module):
def __init__(self,ch_in, ch_out):
super(attention_block,self).__init__()
self.sigmoid = nn.Sigmoid()
self.conv = nn.Conv2d(ch_in, ch_out, 1)
self.BN = nn.BatchNorm2d(ch_out... | 30.831579 | 85 | 0.551895 |
544e421e41e3e87bc17e31b8398c0cd18dadabf9 | 31,487 | py | Python | espnet/nets/pytorch_backend/e2e_asr_mulenc.py | roshansh-cmu/espnet | 5fa6dcc4e649dc66397c629d0030d09ecef36b80 | [
"Apache-2.0"
] | null | null | null | espnet/nets/pytorch_backend/e2e_asr_mulenc.py | roshansh-cmu/espnet | 5fa6dcc4e649dc66397c629d0030d09ecef36b80 | [
"Apache-2.0"
] | null | null | null | espnet/nets/pytorch_backend/e2e_asr_mulenc.py | roshansh-cmu/espnet | 5fa6dcc4e649dc66397c629d0030d09ecef36b80 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Johns Hopkins University (Shinji Watanabe)
# Copyright 2017 Johns Hopkins University (Ruizhi Li)
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""Define e2e module for multi-encoder network. https://arxiv.org/pdf/1811.04903.pdf."""
import argparse
import logging
import math
import os
fr... | 35.378652 | 88 | 0.523422 |
8a19fc34804be4ef0f39509118cf6fa5e2cd93b9 | 6,514 | py | Python | scrapers/GenericScraper.py | jonmsawyer/jscraper | ab10db6ba180586fca049141715dd687013edc42 | [
"MIT"
] | null | null | null | scrapers/GenericScraper.py | jonmsawyer/jscraper | ab10db6ba180586fca049141715dd687013edc42 | [
"MIT"
] | null | null | null | scrapers/GenericScraper.py | jonmsawyer/jscraper | ab10db6ba180586fca049141715dd687013edc42 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
'''GenericScraper is a derived class of TemplateScraper for driving the generic image scraper. This
image scraper will attempt to scrape any image off of any URI resource using common known methods
to download those images.
'''
# pylint: disable=ungrouped-imports
import os
import sys... | 40.459627 | 100 | 0.534695 |
5b5e137c2e0d90fadc30a66dcead441675992fcf | 859 | py | Python | test/test_ldap_login.py | jazlee/centric-ibridge | 27158ff64e742f30d789bd46123cb7af7c81d975 | [
"Apache-2.0"
] | null | null | null | test/test_ldap_login.py | jazlee/centric-ibridge | 27158ff64e742f30d789bd46123cb7af7c81d975 | [
"Apache-2.0"
] | 1 | 2022-02-04T06:59:12.000Z | 2022-02-04T06:59:12.000Z | test/test_ldap_login.py | jazlee/centric-ibridge | 27158ff64e742f30d789bd46123cb7af7c81d975 | [
"Apache-2.0"
] | 4 | 2022-02-02T16:51:01.000Z | 2022-02-03T04:28:13.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2022 Busana Apparel Group. All rights reserved.
#
# This product and it's source code is protected by patents, copyright laws and
# international copyright treaties, as well as other intellectual property
# laws and treaties. The product is licensed, not s... | 33.038462 | 79 | 0.750873 |
1e4dd076dab0f442656b89469d9ad47b6eb0790b | 1,345 | py | Python | src/cui/uploader/command/repository/Deleter.py | ytyaru0/GitHub.Uploader.Pi3.Https.201802280700 | 0d31c37f42f1b2dde8185563b085bd7997d171cd | [
"CC0-1.0"
] | null | null | null | src/cui/uploader/command/repository/Deleter.py | ytyaru0/GitHub.Uploader.Pi3.Https.201802280700 | 0d31c37f42f1b2dde8185563b085bd7997d171cd | [
"CC0-1.0"
] | null | null | null | src/cui/uploader/command/repository/Deleter.py | ytyaru0/GitHub.Uploader.Pi3.Https.201802280700 | 0d31c37f42f1b2dde8185563b085bd7997d171cd | [
"CC0-1.0"
] | null | null | null | #!python3
#encoding:utf-8
import os.path
from web.log.Log import Log
from database.Database import Database as Db
class Deleter:
def __init__(self, client, args):
self.__client = client
self.__args = args
self.__userRepo = Db().Repositories[self.__args.username]
self.__repo_name = o... | 35.394737 | 86 | 0.672119 |
397fe893623b3f0550846779a90778d3e87cf8d7 | 459 | py | Python | corehq/ex-submodules/casexml/apps/case/tests/test_const.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 471 | 2015-01-10T02:55:01.000Z | 2022-03-29T18:07:18.000Z | corehq/ex-submodules/casexml/apps/case/tests/test_const.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 14,354 | 2015-01-01T07:38:23.000Z | 2022-03-31T20:55:14.000Z | corehq/ex-submodules/casexml/apps/case/tests/test_const.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 175 | 2015-01-06T07:16:47.000Z | 2022-03-29T13:27:01.000Z | from datetime import datetime
# these match properties in the xml
ORIGINAL_DATE = datetime(2010, 6, 29, 13, 42, 50)
MODIFY_DATE = datetime(2010, 6, 30, 13, 42, 50)
MODIFY_2_DATE = datetime(2010, 7, 4, 13, 42, 50)
UPDATE_DATE = datetime(2010, 5, 12, 13, 42, 50)
CLOSE_DATE = datetime(2010, 7, 1, 13, 42, 50)
REFER_DATE =... | 38.25 | 52 | 0.69281 |
9887ff673529314804a2c875d1956e1bda68c3ed | 62,550 | py | Python | compose/cli/main.py | YvesGaelCheny/compose | 63be435515f60e2af4d27d7462b4c6fbe92fe7af | [
"Apache-2.0"
] | null | null | null | compose/cli/main.py | YvesGaelCheny/compose | 63be435515f60e2af4d27d7462b4c6fbe92fe7af | [
"Apache-2.0"
] | null | null | null | compose/cli/main.py | YvesGaelCheny/compose | 63be435515f60e2af4d27d7462b4c6fbe92fe7af | [
"Apache-2.0"
] | null | null | null | import contextlib
import functools
import json
import logging
import pipes
import re
import subprocess
import sys
from distutils.spawn import find_executable
from inspect import getdoc
from operator import attrgetter
import docker.errors
import docker.utils
from . import errors
from . import signals
from .. import __... | 37.165775 | 105 | 0.578961 |
825ae99956e03ab2cd6892857b7f07af4bfb90a5 | 15,663 | py | Python | query/query.py | domielias/PyQuery | de61e14da9e0a92f2772e1a5d6ef4db476caa362 | [
"MIT"
] | 4 | 2020-06-19T20:21:32.000Z | 2020-09-25T03:34:44.000Z | query/query.py | domielias/PyQuery | de61e14da9e0a92f2772e1a5d6ef4db476caa362 | [
"MIT"
] | 2 | 2020-09-25T03:07:23.000Z | 2020-10-09T18:20:48.000Z | query/query.py | domielias/PyQuery | de61e14da9e0a92f2772e1a5d6ef4db476caa362 | [
"MIT"
] | 1 | 2020-09-26T03:51:49.000Z | 2020-09-26T03:51:49.000Z | from .settings import (
WHERE_SPECIAL_ARGUMENTS, AUTOMATIC_JOINS_PLACEHOLDER,
FIELD_FORMAT, SELECT_FORMAT, JOIN_CLAUSE_FORMAT, WHERE_CLAUSE_FORMAT, WHERE_AND_CONNECTOR_FORMAT,
WHERE_EQUAL_OPERATION_FORMAT, ORDER_BY_CLAUSE_FORMAT, ORDER_BY_ASC_FORMAT, ORDER_BY_DESC_FORMAT,
LIMIT_FORMAT,VALUE_STRING_FORM... | 37.471292 | 156 | 0.624401 |
1e5af5e3a3bb32b7344bf26c01b55ea03eec2ed4 | 1,551 | py | Python | src/python/bot/tokenizer/antlr_tokenizer.py | eepeep/clusterfuzz | b48371466493ba1f46bd2769f01eadcf49d0cff1 | [
"Apache-2.0"
] | 3 | 2020-12-30T07:00:55.000Z | 2021-03-16T10:55:05.000Z | src/python/bot/tokenizer/antlr_tokenizer.py | eepeep/clusterfuzz | b48371466493ba1f46bd2769f01eadcf49d0cff1 | [
"Apache-2.0"
] | 34 | 2020-08-18T18:47:00.000Z | 2021-07-14T07:47:35.000Z | src/python/bot/tokenizer/antlr_tokenizer.py | eepeep/clusterfuzz | b48371466493ba1f46bd2769f01eadcf49d0cff1 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 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 agreed to in writing, ... | 31.653061 | 77 | 0.717602 |
6ec2fc81f992cc5a36b98f1af9425060ace971ad | 20,639 | py | Python | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_dedicated_host_groups_operations.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 2 | 2019-05-17T21:24:53.000Z | 2020-02-12T11:13:42.000Z | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_dedicated_host_groups_operations.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 15 | 2019-07-12T18:18:04.000Z | 2019-07-25T20:55:51.000Z | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_dedicated_host_groups_operations.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 2 | 2020-05-21T22:51:22.000Z | 2020-05-26T20:53:01.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 47.997674 | 180 | 0.665827 |
35511581f9e4688e36ca86ca30874863536c8600 | 1,327 | py | Python | StackApp/env/lib/python2.7/site-packages/flask_api/response.py | jonathanmusila/StackOverflow-Lite | a9a03f129592c6f741eb4d1e608ca2db0e40bf11 | [
"MIT"
] | 2 | 2017-11-24T12:44:30.000Z | 2020-04-11T17:28:43.000Z | StackApp/env/lib/python2.7/site-packages/flask_api/response.py | jonathanmusila/StackOverflow-Lite | a9a03f129592c6f741eb4d1e608ca2db0e40bf11 | [
"MIT"
] | 6 | 2017-11-10T19:45:18.000Z | 2017-11-12T14:50:42.000Z | StackApp/env/lib/python2.7/site-packages/flask_api/response.py | jonathanmusila/StackOverflow-Lite | a9a03f129592c6f741eb4d1e608ca2db0e40bf11 | [
"MIT"
] | 9 | 2018-01-04T05:32:39.000Z | 2018-03-24T02:41:28.000Z | # coding: utf8
from __future__ import unicode_literals
from flask import request, Response
from flask._compat import text_type
class APIResponse(Response):
api_return_types = (list, dict)
def __init__(self, content=None, *args, **kwargs):
super(APIResponse, self).__init__(None, *args, **kwargs)
... | 32.365854 | 73 | 0.607385 |
ec743bd95f5027c8b883c45d261c00a010193900 | 316 | py | Python | Python/ex048.py | MarcosRibas/Projeto100Exercicios | 15c16eb0d9c4182d93e4bb83e11acad0728f5ec9 | [
"MIT"
] | null | null | null | Python/ex048.py | MarcosRibas/Projeto100Exercicios | 15c16eb0d9c4182d93e4bb83e11acad0728f5ec9 | [
"MIT"
] | null | null | null | Python/ex048.py | MarcosRibas/Projeto100Exercicios | 15c16eb0d9c4182d93e4bb83e11acad0728f5ec9 | [
"MIT"
] | null | null | null | #Ex048 Faça um programa que calcule a soma entre todos os números impares que são múltiplos de três e que se
# encontram no intervalo de 1 até 500.
s = 0
for c in range(0,500,3):
if c % 2 == 1:
s = s + c
print(f'A soma de somados todos os números impáres múltiplos de três no intervalo de 1 a 500 é {s}') | 45.142857 | 108 | 0.689873 |
60cfa3dcdd9f5a10de5f54603e4b45c806a30108 | 2,891 | py | Python | backend/services/google_manager.py | bshimanuki/checkmate | d68eb5d49d42a83ea32dcd32a21b8e7533e6eb5d | [
"MIT"
] | 1 | 2022-01-08T06:03:48.000Z | 2022-01-08T06:03:48.000Z | backend/services/google_manager.py | bshimanuki/checkmate | d68eb5d49d42a83ea32dcd32a21b8e7533e6eb5d | [
"MIT"
] | null | null | null | backend/services/google_manager.py | bshimanuki/checkmate | d68eb5d49d42a83ea32dcd32a21b8e7533e6eb5d | [
"MIT"
] | null | null | null | from aiogoogle import Aiogoogle
from aiogoogle.auth.creds import ServiceAccountCreds
from django.conf import settings
scopes = [
'https://www.googleapis.com/auth/drive',
]
class GoogleManager:
__instance = None
@classmethod
def instance(cls):
'''
Get a single instance per process.
... | 31.423913 | 104 | 0.536493 |
546c6176b4496540f8e9583bde3b9403ffca376b | 939 | py | Python | setup.py | antoniodimariano/metrics_consumer | 5c485f3b6c2b6788f947c02b49083ce237424bfc | [
"Apache-2.0"
] | null | null | null | setup.py | antoniodimariano/metrics_consumer | 5c485f3b6c2b6788f947c02b49083ce237424bfc | [
"Apache-2.0"
] | null | null | null | setup.py | antoniodimariano/metrics_consumer | 5c485f3b6c2b6788f947c02b49083ce237424bfc | [
"Apache-2.0"
] | null | null | null | from setuptools import setup, find_packages
from codecs import open
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name='websites_metrics_consumer',
version='0.0.4',
packages=find_packages(exclude=['contrib', 'docs', 'tests*']),
install_requires=["psycopg2","confluent_kafka... | 36.115385 | 117 | 0.699681 |
1a40ea74ac546102e2b6bbeeb183104322c9292c | 6,987 | py | Python | pipeline_withFRD.py | vikasg603/Vehicle-Front-Rear-Detection-for-License-Plate-Detection-Enhancement | afc70fc41633df4f47326b43e28cd596e0cff5e6 | [
"MIT"
] | 29 | 2019-07-22T01:57:42.000Z | 2022-03-31T15:51:42.000Z | pipeline_withFRD.py | vikasg603/Vehicle-Front-Rear-Detection-for-License-Plate-Detection-Enhancement | afc70fc41633df4f47326b43e28cd596e0cff5e6 | [
"MIT"
] | 6 | 2020-02-13T06:11:55.000Z | 2021-06-17T18:13:08.000Z | pipeline_withFRD.py | vikasg603/Vehicle-Front-Rear-Detection-for-License-Plate-Detection-Enhancement | afc70fc41633df4f47326b43e28cd596e0cff5e6 | [
"MIT"
] | 17 | 2019-09-19T09:56:16.000Z | 2021-06-12T22:42:30.000Z | '''
FRD Net, the function 'detect' in darknet has been modified to be able to receive cv2.imread as an input
see darknet.py for more information
'''
from os.path import splitext, basename, isdir
from os import makedirs, remove
import sys
import cv2
import numpy as np
import traceback
from src import FRD
from src.draw... | 31.759091 | 104 | 0.649778 |
68e74caf269bc6c301232411e0ce4f6664e07a4c | 3,167 | py | Python | api/rateyard_api/admin/__init__.py | scriptium/rateyard | 4ac72b9bd5cabea461bd7941dd1ad28d4d08003d | [
"MIT"
] | 7 | 2021-01-15T18:01:13.000Z | 2021-04-03T22:00:24.000Z | api/rateyard_api/admin/__init__.py | scriptium/rateyard | 4ac72b9bd5cabea461bd7941dd1ad28d4d08003d | [
"MIT"
] | null | null | null | api/rateyard_api/admin/__init__.py | scriptium/rateyard | 4ac72b9bd5cabea461bd7941dd1ad28d4d08003d | [
"MIT"
] | null | null | null | from functools import wraps
from flask import Blueprint, jsonify
from flask_jwt_extended import verify_jwt_in_request, get_jwt_identity
import db
def admin_token_required(fn):
@wraps(fn)
def wrapper(*args, **kwargs):
verify_jwt_in_request()
identity = get_jwt_identity()
if identity['... | 48.723077 | 112 | 0.755605 |
8343a584e0b48e1cf42cb5d038316f1f0f217d9b | 13,649 | py | Python | release/stubs.min/System/Windows/Media/Animation_parts/CharKeyFrameCollection.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | release/stubs.min/System/Windows/Media/Animation_parts/CharKeyFrameCollection.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | release/stubs.min/System/Windows/Media/Animation_parts/CharKeyFrameCollection.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | class CharKeyFrameCollection(Freezable, ISealable, IList, ICollection, IEnumerable):
"""
Represents a collection of System.Windows.Media.Animation.CharKeyFrame objects.
CharKeyFrameCollection()
"""
def Add(self, keyFrame):
"""
Add(self: CharKeyFrameCollection,keyFrame: CharKeyFrame)... | 26.14751 | 221 | 0.683127 |
3062ffa07024e124ab195f916b75a8af60f431cb | 437 | py | Python | ObjectOrientedProgramming/classes.py | theprogrammingthinker/Python-practice | fef11a7fbd5082a0614b01f88a13ea29d68860bf | [
"Unlicense"
] | 1 | 2017-05-02T10:28:36.000Z | 2017-05-02T10:28:36.000Z | ObjectOrientedProgramming/classes.py | theprogrammingthinker/Python-practice | fef11a7fbd5082a0614b01f88a13ea29d68860bf | [
"Unlicense"
] | null | null | null | ObjectOrientedProgramming/classes.py | theprogrammingthinker/Python-practice | fef11a7fbd5082a0614b01f88a13ea29d68860bf | [
"Unlicense"
] | null | null | null | class Sample(object):
pass
x = Sample()
print(type(x))
class Dog(object):
# Class object Attribute
species = 'mamal'
def __init__(self, breed, name, fur = True):
self.breed = breed
self.name = name
self.fur = fur
sam = Dog(breed="lab", name='sas')
print(sam)
print(sam.bre... | 14.566667 | 48 | 0.620137 |
aea090f8ddab98a8f8c4d143f52b9a9293e3ef99 | 6,866 | py | Python | manager/projects/ui/urls.py | jlbrewe/hub | c737669e6493ad17536eaa240bed3394b20c6b7d | [
"Apache-2.0"
] | null | null | null | manager/projects/ui/urls.py | jlbrewe/hub | c737669e6493ad17536eaa240bed3394b20c6b7d | [
"Apache-2.0"
] | null | null | null | manager/projects/ui/urls.py | jlbrewe/hub | c737669e6493ad17536eaa240bed3394b20c6b7d | [
"Apache-2.0"
] | null | null | null | from django.urls import include, path, re_path
from manager.paths import RootPaths
from projects.paths import ProjectPaths
from projects.ui.views import files, jobs, projects, reviews, snapshots, sources
# URLs that must go before `accounts.ui.urls`
before_account_urls = [
path(RootPaths.projects.value + "/", pro... | 39.234286 | 87 | 0.318526 |
69f81cf9a9a8798bd87a26eb702d18a49dcda138 | 2,337 | py | Python | rmgweb/rmg/urls.py | KEHANG/RMG-website | a3b8cdf4b1fb4b47c584f03fac7d72f9ee6d038c | [
"X11",
"Unlicense",
"MIT"
] | null | null | null | rmgweb/rmg/urls.py | KEHANG/RMG-website | a3b8cdf4b1fb4b47c584f03fac7d72f9ee6d038c | [
"X11",
"Unlicense",
"MIT"
] | null | null | null | rmgweb/rmg/urls.py | KEHANG/RMG-website | a3b8cdf4b1fb4b47c584f03fac7d72f9ee6d038c | [
"X11",
"Unlicense",
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
################################################################################
#
# RMG Website - A Django-powered website for Reaction Mechanism Generator
#
# Copyright (c) 2011 Prof. William H. Green (whgreen@mit.edu) and the
# RMG Team (rmg_dev@mit.edu)
#
# Permission ... | 34.880597 | 80 | 0.668378 |
7b8db5481df114ec12bf395944d8927f0d6f3ec3 | 10,332 | py | Python | mantel/_test.py | Mancheron/mantel | 3c6e0ce02225cbe073d4dc935f788cb26f2c3f0f | [
"MIT"
] | 20 | 2015-03-16T17:23:55.000Z | 2020-10-13T19:58:19.000Z | mantel/_test.py | Mancheron/mantel | 3c6e0ce02225cbe073d4dc935f788cb26f2c3f0f | [
"MIT"
] | 5 | 2015-05-16T14:25:19.000Z | 2020-08-16T12:23:05.000Z | mantel/_test.py | Mancheron/mantel | 3c6e0ce02225cbe073d4dc935f788cb26f2c3f0f | [
"MIT"
] | 15 | 2015-05-29T23:56:40.000Z | 2021-01-06T06:49:39.000Z | from itertools import permutations
import numpy as np
from scipy import spatial, stats
def test(X, Y, perms=10000, method="pearson", tail="two-tail", ignore_nans=False):
"""
Takes two distance matrices (either redundant matrices or condensed vectors)
and performs a Mantel test. The Mantel test is a signif... | 43.230126 | 92 | 0.670248 |
7278b8e5e098280d153cdea69b18e30259427db0 | 443 | py | Python | Qshop/Seller/migrations/0007_goodstype_type_picture.py | songdanlee/DjangoWorkSpace | 5dea8601f21f5408797a8801f74b76c696a33d83 | [
"MIT"
] | null | null | null | Qshop/Seller/migrations/0007_goodstype_type_picture.py | songdanlee/DjangoWorkSpace | 5dea8601f21f5408797a8801f74b76c696a33d83 | [
"MIT"
] | 1 | 2021-05-10T11:45:52.000Z | 2021-05-10T11:45:52.000Z | Qshop/Seller/migrations/0007_goodstype_type_picture.py | songdanlee/DjangoWorkSpace | 5dea8601f21f5408797a8801f74b76c696a33d83 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.8 on 2019-09-09 22:15
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Seller', '0006_auto_20190909_2131'),
]
operations = [
migrations.AddField(
model_name='goodstype',
name='type_pictur... | 23.315789 | 101 | 0.625282 |
42ae7677e20427de66b90c47fd5c9cca03bd5396 | 6,597 | py | Python | automl/google/cloud/automl_v1beta1/proto/video_pb2.py | olumighty1/google-cloud-python | 021e3fbef2fec6af38182bd37b5609022898f5ae | [
"Apache-2.0"
] | null | null | null | automl/google/cloud/automl_v1beta1/proto/video_pb2.py | olumighty1/google-cloud-python | 021e3fbef2fec6af38182bd37b5609022898f5ae | [
"Apache-2.0"
] | null | null | null | automl/google/cloud/automl_v1beta1/proto/video_pb2.py | olumighty1/google-cloud-python | 021e3fbef2fec6af38182bd37b5609022898f5ae | [
"Apache-2.0"
] | 1 | 2021-07-21T17:59:33.000Z | 2021-07-21T17:59:33.000Z | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/cloud/automl_v1beta1/proto/video.proto
import sys
_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1"))
from google.protobuf import descriptor as _descriptor
from google.protobuf import messa... | 34.721053 | 530 | 0.771411 |
1166a8568b13f1cbdded140cbd55920e72413d6c | 341 | py | Python | pinry/core/tests/forms.py | Stackato-Apps/pinry | 0404f3deaeb4221357f9e34bc04d5283d580fbec | [
"BSD-2-Clause"
] | 1 | 2015-02-02T02:48:12.000Z | 2015-02-02T02:48:12.000Z | pinry/core/tests/forms.py | wids-eria/pinry | bde1aa109c162a24fca0d41d3b5cadf0c433c21b | [
"BSD-2-Clause"
] | 7 | 2016-07-19T00:19:21.000Z | 2016-07-19T09:06:13.000Z | pinry/core/tests/forms.py | wids-eria/pinry | bde1aa109c162a24fca0d41d3b5cadf0c433c21b | [
"BSD-2-Clause"
] | 1 | 2019-02-03T03:36:19.000Z | 2019-02-03T03:36:19.000Z | from django.test import TestCase
from ..forms import ImageForm
__all__ = ['ImageFormTest']
class ImageFormTest(TestCase):
def test_image_field_prefix(self):
"""Assert that the image field has a proper name"""
form = ImageForm()
self.assertInHTML("<input id='id_qqfile' name='qqfile' type='... | 31 | 90 | 0.68915 |
3372e6e7fad74fc3686c1d9ca3f41b668367ae02 | 1,562 | py | Python | cCdbWrapper_fsHTMLEncode.py | SkyLined/cBugId | fde6d3eff9d73c71fe6ac81c975c1a3e43afad3c | [
"CC-BY-4.0"
] | 22 | 2016-08-11T14:50:55.000Z | 2021-06-06T09:39:26.000Z | cCdbWrapper_fsHTMLEncode.py | SkyLined/cBugId | fde6d3eff9d73c71fe6ac81c975c1a3e43afad3c | [
"CC-BY-4.0"
] | 19 | 2016-09-07T05:54:40.000Z | 2020-07-02T07:46:38.000Z | cCdbWrapper_fsHTMLEncode.py | SkyLined/cBugId | fde6d3eff9d73c71fe6ac81c975c1a3e43afad3c | [
"CC-BY-4.0"
] | 11 | 2016-09-03T22:42:50.000Z | 2018-10-01T18:28:59.000Z | import re;
from .fsHTMLCP437 import fsHTMLCP437;
def fsHTMLEncodeLine(sString, uTabStop, bCP437):
asResult = [];
uLineIndex = 0;
for sChar in sString:
if uTabStop is not None and sChar == "\t":
while 1:
asResult.append(" ");
uLineIndex += 1;
if uLineIndex % uTabStop == 0: b... | 38.097561 | 119 | 0.65493 |
36f5ad5123713dc5dceff7185d0e5f11052857ce | 332 | py | Python | code_all/day18/demo03.py | testcg/python | 4db4bd5d0e44af807d2df80cf8c8980b40cc03c4 | [
"MIT"
] | null | null | null | code_all/day18/demo03.py | testcg/python | 4db4bd5d0e44af807d2df80cf8c8980b40cc03c4 | [
"MIT"
] | null | null | null | code_all/day18/demo03.py | testcg/python | 4db4bd5d0e44af807d2df80cf8c8980b40cc03c4 | [
"MIT"
] | null | null | null | """
函数式编程
"""
from common.iterable_tools import IterableHelper
list01 = [342, 4, 54, 56, 6776]
# 定义函数,在列表中查找所有大于100的数
def condition01(number):
return number > 100
# 定义函数,在列表中查找所有偶数
def condition02(number):
return number % 2 == 0
for item in IterableHelper.find_all(list01,condition01):
print(item)
... | 10.375 | 56 | 0.680723 |
12c38aea8495d6c184035fdf21ecafbd4f88ff84 | 1,160 | py | Python | setup.py | NielsTilch/torchxrayvision | 5a5a51feaf3d24e4b2c6a056528ea3e70db82758 | [
"Apache-2.0"
] | 1 | 2022-03-09T15:43:35.000Z | 2022-03-09T15:43:35.000Z | setup.py | NielsTilch/torchxrayvision | 5a5a51feaf3d24e4b2c6a056528ea3e70db82758 | [
"Apache-2.0"
] | null | null | null | setup.py | NielsTilch/torchxrayvision | 5a5a51feaf3d24e4b2c6a056528ea3e70db82758 | [
"Apache-2.0"
] | null | null | null | import setuptools
from setuptools import setup, find_packages
from torchxrayvision import _version
with open("README.md", "r") as fh:
long_description = fh.read()
REQUIREMENTS = [i.strip() for i in open("requirements.txt").readlines()]
setuptools.setup(
name="torchxrayvision",
version=_version.__vers... | 37.419355 | 134 | 0.696552 |
fed88892a6b56b5b0d646c9d958dc5ce5b3c7136 | 977 | py | Python | XGBClassifier.py | AyberkCakar/ML-method-software-metric-estimation-algorithms | 49df42953ae1468ff69847ba4c47b3f96983af3e | [
"MIT"
] | 1 | 2021-12-28T20:10:18.000Z | 2021-12-28T20:10:18.000Z | XGBClassifier.py | AyberkCakar/ML-method-software-metric-estimation-algorithms | 49df42953ae1468ff69847ba4c47b3f96983af3e | [
"MIT"
] | null | null | null | XGBClassifier.py | AyberkCakar/ML-method-software-metric-estimation-algorithms | 49df42953ae1468ff69847ba4c47b3f96983af3e | [
"MIT"
] | null | null | null | import pandas as pd
from sklearn.model_selection import train_test_split
from xgboost import XGBClassifier
from sklearn import metrics
data = pd.read_csv("BugHunterDataset/subtract/all/method.csv")
def mapNumberOfBugs(row):
return 1 if row['Number of Bugs'] > 0 else 0
data['Number of Bugs'] = data.apply(mapNumb... | 39.08 | 340 | 0.758444 |
305630d91141ff448d5894b6163224bc1898de43 | 981 | py | Python | allennlp/allennlp/modules/masked_layer_norm.py | rahular/joint-coref-srl | cd85fb4e11af1a1ea400ed657d0a4511c1d6c6be | [
"MIT"
] | null | null | null | allennlp/allennlp/modules/masked_layer_norm.py | rahular/joint-coref-srl | cd85fb4e11af1a1ea400ed657d0a4511c1d6c6be | [
"MIT"
] | null | null | null | allennlp/allennlp/modules/masked_layer_norm.py | rahular/joint-coref-srl | cd85fb4e11af1a1ea400ed657d0a4511c1d6c6be | [
"MIT"
] | null | null | null | import torch
class MaskedLayerNorm(torch.nn.Module):
"""
See LayerNorm for details.
Note, however, that unlike LayerNorm this norm includes a batch component.
"""
def __init__(self, size: int, gamma0: float = 0.1, eps: float = 1e-6) -> None:
super().__init__()
self.gamma = torch.... | 35.035714 | 82 | 0.621814 |
3beafe70659f60fc7cc639e016725417785c7312 | 18,574 | py | Python | cms/menu.py | isotoma/django-cms | 90203d9c5fb8acbb2f11f6a23193e75c7705b43d | [
"BSD-3-Clause"
] | null | null | null | cms/menu.py | isotoma/django-cms | 90203d9c5fb8acbb2f11f6a23193e75c7705b43d | [
"BSD-3-Clause"
] | null | null | null | cms/menu.py | isotoma/django-cms | 90203d9c5fb8acbb2f11f6a23193e75c7705b43d | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from collections import defaultdict
from django.contrib.sites.models import Site
from django.utils.translation import get_language
from cms.apphook_pool import apphook_pool
from cms.models.permissionmodels import ACCESS_DESCENDANTS
from cms.models.permissionmodels import ACCESS_PAGE_AND_DESCEN... | 38.455487 | 113 | 0.591741 |
86919681591f5da1419dbe3b6359735be86d3f9e | 12,631 | py | Python | gsextract/gse_parser.py | newspaperman/gsextract-b8 | 84935984648f82dd4d78aaa7abae8892788fe4f7 | [
"Unlicense"
] | 1 | 2020-11-21T08:20:02.000Z | 2020-11-21T08:20:02.000Z | gsextract/gse_parser.py | newspaperman/gsextract-b8 | 84935984648f82dd4d78aaa7abae8892788fe4f7 | [
"Unlicense"
] | null | null | null | gsextract/gse_parser.py | newspaperman/gsextract-b8 | 84935984648f82dd4d78aaa7abae8892788fe4f7 | [
"Unlicense"
] | 1 | 2020-11-22T09:17:10.000Z | 2020-11-22T09:17:10.000Z | from .parsers.pure_bb import PureBb
from .parsers.pure_gse import PureGse
from .parsers.ipv4_packet import Ipv4Packet
from kaitaistruct import KaitaiStream, BytesIO
from .pcaplib import Writer
from datetime import datetime
from scapy.layers.all import IP, TCP, Ether, ICMP
from scapy.all import send, sendp, sendpfast
im... | 48.394636 | 212 | 0.600032 |
80279acdd7984ac6d5efd33c73c55dc2e063652a | 5,532 | py | Python | src/test/data/pa2/student_contributed/good.py | Leo-Enrique-Wu/chocopy_compiler_semantic_analysis | e89f6434dd7d274d4838457316143f312226495f | [
"BSD-2-Clause"
] | null | null | null | src/test/data/pa2/student_contributed/good.py | Leo-Enrique-Wu/chocopy_compiler_semantic_analysis | e89f6434dd7d274d4838457316143f312226495f | [
"BSD-2-Clause"
] | null | null | null | src/test/data/pa2/student_contributed/good.py | Leo-Enrique-Wu/chocopy_compiler_semantic_analysis | e89f6434dd7d274d4838457316143f312226495f | [
"BSD-2-Clause"
] | null | null | null | boolVar : bool = True
bool1Var : bool = True
bool2Var : bool = True
objVar : object = None
int1Var : int = 0
int2Var : int = 0
str1Var : str = "apple"
str2Var : str = "banana"
intList : [int] = None
int1List : [int] = None
# Type checking rule: Literals > bool-false
boolFalseLiteral : bool = False
# Type chec... | 25.260274 | 78 | 0.713124 |
89a4e4367aaec3d52d06228912d5739b94525d1a | 14,763 | py | Python | official/benchmark/bert_benchmark.py | zcdzcdzcd/models | a31b526a7617a152a138a865b5689bf5b59f655d | [
"Apache-2.0"
] | 5 | 2020-11-16T06:26:19.000Z | 2022-03-27T02:01:40.000Z | official/benchmark/bert_benchmark.py | zcdzcdzcd/models | a31b526a7617a152a138a865b5689bf5b59f655d | [
"Apache-2.0"
] | 5 | 2020-11-13T18:50:30.000Z | 2022-02-10T01:42:36.000Z | official/benchmark/bert_benchmark.py | zcdzcdzcd/models | a31b526a7617a152a138a865b5689bf5b59f655d | [
"Apache-2.0"
] | 1 | 2020-06-24T08:17:17.000Z | 2020-06-24T08:17:17.000Z | # Copyright 2019 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.951157 | 114 | 0.723837 |
1612c40bef16aa9ac5621ab241da283aab2292a0 | 1,430 | py | Python | libbgp/tests/unit/bgp/attribute/test_origin.py | smartbgp/libbgp | 371d43b3655c40067725f5066c50391606154c60 | [
"Apache-2.0"
] | 14 | 2017-01-20T11:26:28.000Z | 2021-05-12T22:38:48.000Z | libbgp/tests/unit/bgp/attribute/test_origin.py | smartbgp/libbgp | 371d43b3655c40067725f5066c50391606154c60 | [
"Apache-2.0"
] | null | null | null | libbgp/tests/unit/bgp/attribute/test_origin.py | smartbgp/libbgp | 371d43b3655c40067725f5066c50391606154c60 | [
"Apache-2.0"
] | 2 | 2017-09-04T05:54:10.000Z | 2017-11-15T17:02:46.000Z | # Copyright 2015-2017 Cisco Systems, 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 req... | 31.777778 | 91 | 0.691608 |
268935c08949fe99f93a9f5582adce2ebcf25785 | 1,415 | py | Python | DLCoursera_part1_week2_logistic_regression.py | zhouhan921001/DeepLearning-homework | 20562dc49ca5898b531a678c0e54c8d985fcc72f | [
"MIT"
] | null | null | null | DLCoursera_part1_week2_logistic_regression.py | zhouhan921001/DeepLearning-homework | 20562dc49ca5898b531a678c0e54c8d985fcc72f | [
"MIT"
] | null | null | null | DLCoursera_part1_week2_logistic_regression.py | zhouhan921001/DeepLearning-homework | 20562dc49ca5898b531a678c0e54c8d985fcc72f | [
"MIT"
] | null | null | null | import numpy as np
m_train = train_set_x_orig.shape[0]
m_test = test_set_x_orig.shape[0]
num_px = train_set_x_orig.shape[1]
#reshape data
train_set_x = train_set_x_orig.reshape(train_set_x_orig.shape[0],-1).T
test_set_x = test_set_x_orig.reshape(test_set_x_orig.shape[0],-1).T
def sigmoid(z):
sig = 1 / (1 + np.exp... | 19.383562 | 87 | 0.660777 |
5f0afb02668ec10cb4a208cc1b75543ffaa591ad | 2,459 | py | Python | YOLOw-Keras/yad2k/models/keras_darknet19.py | yehudabetito/yolo_nets_uda | a3ae826e69289fbc16a43b0644fb37063a1952fe | [
"MIT"
] | 2 | 2019-08-05T07:18:11.000Z | 2020-04-20T11:31:20.000Z | YOLOw-Keras/yad2k/models/keras_darknet19.py | yehudabetito/yolo_nets_uda | a3ae826e69289fbc16a43b0644fb37063a1952fe | [
"MIT"
] | null | null | null | YOLOw-Keras/yad2k/models/keras_darknet19.py | yehudabetito/yolo_nets_uda | a3ae826e69289fbc16a43b0644fb37063a1952fe | [
"MIT"
] | 1 | 2019-08-05T07:18:22.000Z | 2019-08-05T07:18:22.000Z | """Darknet19 Model Defined in Keras."""
import functools
from functools import partial
from keras.layers import Conv2D, MaxPooling2D
from keras.layers.advanced_activations import LeakyReLU
from keras.layers.normalization import BatchNormalization
from keras.models import Model
from keras.regularizers import l2... | 34.152778 | 78 | 0.690931 |
432137935672a4a4741ecf2b4de3ee7c6c01971f | 71 | py | Python | setup.py | fanninpm/xopen | a7f650f8fcde4972f889c27a2ae8a80e0c9a9b06 | [
"MIT"
] | 24 | 2017-12-09T01:27:59.000Z | 2020-09-28T16:26:00.000Z | setup.py | fanninpm/xopen | a7f650f8fcde4972f889c27a2ae8a80e0c9a9b06 | [
"MIT"
] | 61 | 2021-01-28T10:34:22.000Z | 2022-03-28T21:03:39.000Z | setup.py | fanninpm/xopen | a7f650f8fcde4972f889c27a2ae8a80e0c9a9b06 | [
"MIT"
] | 11 | 2016-09-15T18:53:50.000Z | 2021-01-19T12:58:36.000Z | from setuptools import setup
setup(setup_requires=["setuptools_scm"])
| 17.75 | 40 | 0.816901 |
c29c47a94d9ccf56c7f1f6092ca8accf5ade1341 | 8,079 | py | Python | tests/core/full_node/test_conditions.py | fugginoob/taco-blockchain | bee7b5d2ba555728438f7d13cd80f7f8ca3bd353 | [
"Apache-2.0"
] | null | null | null | tests/core/full_node/test_conditions.py | fugginoob/taco-blockchain | bee7b5d2ba555728438f7d13cd80f7f8ca3bd353 | [
"Apache-2.0"
] | null | null | null | tests/core/full_node/test_conditions.py | fugginoob/taco-blockchain | bee7b5d2ba555728438f7d13cd80f7f8ca3bd353 | [
"Apache-2.0"
] | null | null | null | """
These are quick-to-run test that check spends can be added to the blockchain when they're valid
or that they're failing for the right reason when they're invalid.
"""
import logging
import time
from typing import List, Optional
import pytest
from blspy import G2Element
from clvm_tools.binutils import assemble
... | 38.655502 | 110 | 0.700706 |
10360792cd34b91518fb64acce7d11733a671b54 | 5,398 | py | Python | neutron/plugins/ml2/drivers/type_gre.py | venkataanil/juno_neutron | 2e62e150c264ccae2dd75fb78caae453eaa77e9f | [
"Apache-2.0"
] | null | null | null | neutron/plugins/ml2/drivers/type_gre.py | venkataanil/juno_neutron | 2e62e150c264ccae2dd75fb78caae453eaa77e9f | [
"Apache-2.0"
] | null | null | null | neutron/plugins/ml2/drivers/type_gre.py | venkataanil/juno_neutron | 2e62e150c264ccae2dd75fb78caae453eaa77e9f | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | 37.486111 | 79 | 0.634309 |
7e287e269fa87792abc5179bc73420f0bf52d752 | 14,064 | py | Python | test/base/test_batch.py | duburcqa/tianshou | 26fb87433de0d2604078ecbc99502efe0a815d5d | [
"MIT"
] | 1 | 2021-12-18T02:31:04.000Z | 2021-12-18T02:31:04.000Z | test/base/test_batch.py | duburcqa/tianshou | 26fb87433de0d2604078ecbc99502efe0a815d5d | [
"MIT"
] | null | null | null | test/base/test_batch.py | duburcqa/tianshou | 26fb87433de0d2604078ecbc99502efe0a815d5d | [
"MIT"
] | null | null | null | import torch
import copy
import pickle
import pytest
import numpy as np
from tianshou.data import Batch, to_torch
def test_batch():
assert list(Batch()) == []
assert Batch().is_empty()
assert Batch(b={'c': {}}).is_empty()
assert len(Batch(a=[1, 2, 3], b={'c': {}})) == 3
assert not Batch(a=[1, 2, ... | 37.806452 | 77 | 0.593146 |
a6cf70251d12cc3169c83045805b4bac54232e54 | 3,526 | py | Python | my_utils/squad_eval.py | ashishbaghudana/san_mrc | 03ed7d94c735f1fe2854bb9c208385b5fde44905 | [
"BSD-3-Clause"
] | 1 | 2019-08-23T13:33:37.000Z | 2019-08-23T13:33:37.000Z | my_utils/squad_eval.py | ashishbaghudana/san_mrc | 03ed7d94c735f1fe2854bb9c208385b5fde44905 | [
"BSD-3-Clause"
] | null | null | null | my_utils/squad_eval.py | ashishbaghudana/san_mrc | 03ed7d94c735f1fe2854bb9c208385b5fde44905 | [
"BSD-3-Clause"
] | null | null | null | """ Official evaluation script for v1.1 of the SQuAD dataset.
Credit from: https://worksheets.codalab.org/rest/bundles/0xbcd57bee090b421c982906709c8c27e1/contents/blob/
"""
from __future__ import print_function
import argparse
import json
import string
import sys
from collections import Counter
import re
def normal... | 35.616162 | 106 | 0.658537 |
7bac5e6b258d48fa1d9cdbbf82aa03f2d8a47f88 | 1,349 | py | Python | as05ctl.py | netlabcode/gc-sim | 6bc65ea9b216e3b2d9e2d9d94f33b79c9f4a139f | [
"MIT"
] | null | null | null | as05ctl.py | netlabcode/gc-sim | 6bc65ea9b216e3b2d9e2d9d94f33b79c9f4a139f | [
"MIT"
] | null | null | null | as05ctl.py | netlabcode/gc-sim | 6bc65ea9b216e3b2d9e2d9d94f33b79c9f4a139f | [
"MIT"
] | null | null | null | import binascii
import _thread
import time
import socket
import time
import sqlite3
from sqlite3 import Error
import datetime
#Predefined parameters
MU01 = '100.5.0.11'
MU02 = '100.5.0.12'
MU03 = '100.5.0.13'
PORT1 = 991
PORT2 = 992
def serverXMUCC():
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sx1:
... | 20.439394 | 65 | 0.646405 |
3b8e629e423654ee6b252c437f7f8d7dab1ffffd | 3,162 | py | Python | pyroms_toolbox/pyroms_toolbox/BGrid_SODA/flood.py | gorsol/pyroms | d293c9949daf95ec8a0a4e2ff1f67af8969c2b3f | [
"BSD-3-Clause"
] | 1 | 2020-01-21T14:30:29.000Z | 2020-01-21T14:30:29.000Z | pyroms_toolbox/pyroms_toolbox/BGrid_SODA/flood.py | gorsol/pyroms | d293c9949daf95ec8a0a4e2ff1f67af8969c2b3f | [
"BSD-3-Clause"
] | null | null | null | pyroms_toolbox/pyroms_toolbox/BGrid_SODA/flood.py | gorsol/pyroms | d293c9949daf95ec8a0a4e2ff1f67af8969c2b3f | [
"BSD-3-Clause"
] | null | null | null | # encoding: utf-8
import numpy as np
from pyroms import _remapping
import pyroms
def flood(varz, Bgrd, Bpos='t', irange=None, jrange=None, \
spval=-9.99e+33, dmax=0, cdepth=0, kk=0):
"""
var = flood(var, Bgrd)
optional switch:
- Bpos='t', 'uv' specify the grid position wher... | 30.403846 | 76 | 0.500316 |
d04e2e205208305b564274024b3dd7b08da4a0f4 | 22,153 | py | Python | sdk/python/pulumi_github/team.py | pulumi/pulumi-github | 303ed7a28cbfe6ba1db75b3b365dcfa0b00e6e91 | [
"ECL-2.0",
"Apache-2.0"
] | 20 | 2020-04-27T15:05:01.000Z | 2022-02-08T00:28:32.000Z | sdk/python/pulumi_github/team.py | pulumi/pulumi-github | 303ed7a28cbfe6ba1db75b3b365dcfa0b00e6e91 | [
"ECL-2.0",
"Apache-2.0"
] | 103 | 2020-05-01T17:36:32.000Z | 2022-03-31T15:26:35.000Z | sdk/python/pulumi_github/team.py | pulumi/pulumi-github | 303ed7a28cbfe6ba1db75b3b365dcfa0b00e6e91 | [
"ECL-2.0",
"Apache-2.0"
] | 4 | 2020-06-24T19:15:02.000Z | 2021-11-26T08:05:46.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import ... | 41.024074 | 166 | 0.632871 |
0e438cb966123973ef19b8868438cc884b8abeac | 1,661 | py | Python | examples/examples.py | jixiangqd/krds_openapi_sdk | c8bce69f81490ccef80327c318ecf0f816439488 | [
"Apache-2.0"
] | null | null | null | examples/examples.py | jixiangqd/krds_openapi_sdk | c8bce69f81490ccef80327c318ecf0f816439488 | [
"Apache-2.0"
] | null | null | null | examples/examples.py | jixiangqd/krds_openapi_sdk | c8bce69f81490ccef80327c318ecf0f816439488 | [
"Apache-2.0"
] | 1 | 2018-03-21T07:39:44.000Z | 2018-03-21T07:39:44.000Z | from krds_client import *
krds_client = KRDSClient('your_ak', 'your_sk', 'your_service_region')
# Demo
#
# r = krds_client.CreateDBInstance(DBInstanceClass='db.ram.1|db.disk.10', DBInstanceName='test', Engine='mysql',
# EngineVersion='5.6', MasterUserName='test', MasterUserPassword='T... | 61.518519 | 112 | 0.712222 |
6dc7f59bfb7cb6bccd03e8969aefe9266f25fa94 | 6,646 | py | Python | data_v1/rdf/py/gs_counties.py | FellowsFreiesWissen/- | 3e74e6531985b0e9ba2e34bf1f6a1224cc7b52f3 | [
"MIT"
] | 1 | 2021-02-08T20:33:41.000Z | 2021-02-08T20:33:41.000Z | data_v1/rdf/py/gs_counties.py | FellowsFreiesWissen/- | 3e74e6531985b0e9ba2e34bf1f6a1224cc7b52f3 | [
"MIT"
] | null | null | null | data_v1/rdf/py/gs_counties.py | FellowsFreiesWissen/- | 3e74e6531985b0e9ba2e34bf1f6a1224cc7b52f3 | [
"MIT"
] | 1 | 2021-01-01T17:23:40.000Z | 2021-01-01T17:23:40.000Z | __author__ = "Florian Thiery"
__copyright__ = "MIT Licence 2021, Florian Thiery"
__credits__ = ["Florian Thiery"]
__license__ = "MIT"
__version__ = "beta"
__maintainer__ = "Florian Thiery"
__email__ = "mail@fthiery.de"
__status__ = "beta"
__update__ = "2021-05-11"
# import dependencies
import uuid
import requests
impo... | 50.348485 | 302 | 0.601113 |
a3e3fec684950a6ef15e2c29444b6402fbf9ea24 | 509 | py | Python | packages/galapagos/scripts/run_parking.py | 100kimch/ros_galapagos | 8f92cb93246c263b61199aef113e43cefc5f3939 | [
"MIT"
] | 2 | 2020-10-26T05:01:35.000Z | 2022-02-14T10:37:17.000Z | packages/galapagos/scripts/run_parking.py | 100kimch/ros_galapagos | 8f92cb93246c263b61199aef113e43cefc5f3939 | [
"MIT"
] | null | null | null | packages/galapagos/scripts/run_parking.py | 100kimch/ros_galapagos | 8f92cb93246c263b61199aef113e43cefc5f3939 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import rospy
from sensor_msgs.msg import CompressedImage, LaserScan
import processor
from constants import PATH_RASPICAM, PATH_USBCAM, PATH_LIDAR, SELECTED_STATE, IS_DEBUG_MODE
IS_DEBUG_MODE = True
SELECTED_STATE = 'parking'
rospy.Subscriber(PATH_RASPICAM, CompressedImage, processor.process_fi... | 36.357143 | 91 | 0.844794 |
557f31be472664702243843064c47eaa93177bf4 | 9,019 | py | Python | p4_hlir/hlir/p4_headers.py | TodoOrTODO/p4-hlir | 4dfdf93441cd226d526c10d99b9b7930676bcf58 | [
"Apache-2.0"
] | null | null | null | p4_hlir/hlir/p4_headers.py | TodoOrTODO/p4-hlir | 4dfdf93441cd226d526c10d99b9b7930676bcf58 | [
"Apache-2.0"
] | null | null | null | p4_hlir/hlir/p4_headers.py | TodoOrTODO/p4-hlir | 4dfdf93441cd226d526c10d99b9b7930676bcf58 | [
"Apache-2.0"
] | null | null | null | # Copyright 2013-present Barefoot Networks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 31.1 | 95 | 0.596075 |
3017b54a7e03962af96a648d1f591c8052abd626 | 15,804 | py | Python | vddb_async/src/task_manager/cleaner.py | dlf412/thunderCopyright | c736c9eefc7c934cc830d9d6f27a00cf147e02aa | [
"MIT"
] | 1 | 2021-06-10T02:56:43.000Z | 2021-06-10T02:56:43.000Z | vddb_async/src/task_manager/cleaner.py | dlf412/thunderCopyright | c736c9eefc7c934cc830d9d6f27a00cf147e02aa | [
"MIT"
] | null | null | null | vddb_async/src/task_manager/cleaner.py | dlf412/thunderCopyright | c736c9eefc7c934cc830d9d6f27a00cf147e02aa | [
"MIT"
] | 1 | 2020-03-25T23:55:58.000Z | 2020-03-25T23:55:58.000Z | from server import server, catch_and_die, cluster
from tm_sqls import *
from task_stat import *
from db_txn import db_execute, db_query, db_result, db_txn
from collections import defaultdict
from functools import partial
import logging
from time import time
from datetime import datetime
from collections import defaul... | 45.413793 | 98 | 0.514047 |
9b64c50342b0471ae939e6fdbe8f3a0250c47f00 | 36,498 | py | Python | TrainingExtensions/common/src/python/aimet_common/winnow/mask_propagator.py | Rohan-Chaudhury/aimet | 1c38cac8cc0fd32dca40ce5e39940805d29f7a4a | [
"BSD-3-Clause"
] | null | null | null | TrainingExtensions/common/src/python/aimet_common/winnow/mask_propagator.py | Rohan-Chaudhury/aimet | 1c38cac8cc0fd32dca40ce5e39940805d29f7a4a | [
"BSD-3-Clause"
] | null | null | null | TrainingExtensions/common/src/python/aimet_common/winnow/mask_propagator.py | Rohan-Chaudhury/aimet | 1c38cac8cc0fd32dca40ce5e39940805d29f7a4a | [
"BSD-3-Clause"
] | 1 | 2021-03-06T18:40:33.000Z | 2021-03-06T18:40:33.000Z | # /usr/bin/env python3.5
# -*- mode: python -*-
# =============================================================================
#
# @@-COPYRIGHT-START-@@
#
# Copyright (c) 2019-2020, Qualcomm Innovation Center, Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modif... | 54.151335 | 120 | 0.644008 |
af407c0f206a6c47d9c00c1bba3d8ac33e55686a | 2,217 | py | Python | backend/old_truth_28517/urls.py | crowdbotics-apps/old-truth-28517 | d8f8f6be1c59e8d416711c2053b5a83283957153 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/old_truth_28517/urls.py | crowdbotics-apps/old-truth-28517 | d8f8f6be1c59e8d416711c2053b5a83283957153 | [
"FTL",
"AML",
"RSA-MD"
] | 20 | 2021-07-07T00:10:21.000Z | 2021-07-07T00:10:25.000Z | backend/old_truth_28517/urls.py | crowdbotics-apps/old-truth-28517 | d8f8f6be1c59e8d416711c2053b5a83283957153 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | """old_truth_28517 URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Cla... | 35.190476 | 87 | 0.710871 |
2d59e901a187a97cf95400ddad216fa3cedbafbd | 2,173 | py | Python | airflow/cli/commands/plugins_command.py | ChaseKnowlden/airflow | 6b71eac1997a7c0db3b8e3aed6b4e65d01871440 | [
"Apache-2.0"
] | 15,947 | 2019-01-05T13:51:02.000Z | 2022-03-31T23:33:16.000Z | airflow/cli/commands/plugins_command.py | ChaseKnowlden/airflow | 6b71eac1997a7c0db3b8e3aed6b4e65d01871440 | [
"Apache-2.0"
] | 14,603 | 2019-01-05T09:43:19.000Z | 2022-03-31T23:11:59.000Z | airflow/cli/commands/plugins_command.py | ChaseKnowlden/airflow | 6b71eac1997a7c0db3b8e3aed6b4e65d01871440 | [
"Apache-2.0"
] | 8,429 | 2019-01-05T19:45:47.000Z | 2022-03-31T22:13:01.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... | 38.122807 | 75 | 0.734008 |
364aadb9523f0299c16eac248553e7acbd5db777 | 24,106 | py | Python | pandas/core/indexes/range.py | tomahawk123/pandas | 3fe697f3c9dcb0c0a7a9b91c0098d31b39f51fef | [
"BSD-3-Clause"
] | null | null | null | pandas/core/indexes/range.py | tomahawk123/pandas | 3fe697f3c9dcb0c0a7a9b91c0098d31b39f51fef | [
"BSD-3-Clause"
] | 1 | 2016-08-15T12:35:16.000Z | 2016-08-15T12:35:16.000Z | pandas/core/indexes/range.py | tomahawk123/pandas | 3fe697f3c9dcb0c0a7a9b91c0098d31b39f51fef | [
"BSD-3-Clause"
] | 2 | 2017-05-27T03:25:12.000Z | 2021-09-21T21:51:12.000Z | from datetime import timedelta
import operator
from sys import getsizeof
import warnings
import numpy as np
from pandas._libs import index as libindex, lib
import pandas.compat as compat
from pandas.compat import get_range_parameters, lrange, range
from pandas.compat.numpy import function as nv
from pandas.util._deco... | 34.936232 | 79 | 0.538165 |
4968258b2266caf38f6c23b89d8b4d51bea20676 | 1,740 | py | Python | solutions/Fall20/L5/dominanceFrontier.py | mhomidi/bril | a62e1beef1b8193bbdf9bd1f3931ffc7236b714e | [
"MIT"
] | 2 | 2022-02-21T00:23:20.000Z | 2022-02-21T20:03:52.000Z | solutions/Fall20/L5/dominanceFrontier.py | mhomidi/bril | a62e1beef1b8193bbdf9bd1f3931ffc7236b714e | [
"MIT"
] | null | null | null | solutions/Fall20/L5/dominanceFrontier.py | mhomidi/bril | a62e1beef1b8193bbdf9bd1f3931ffc7236b714e | [
"MIT"
] | null | null | null | from dominatorTree import *
from dominators import find_dominators
from solutions.utils.form_blocks import form_blocks
from solutions.utils import cfg
import json
import sys
import os
dir_path = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(1, dir_path + '/../../../')
def get_dominance_frontiers(functi... | 29 | 115 | 0.682759 |
0efae5be55d86436809c1618ec3d9de59e63a9ec | 2,807 | py | Python | BOReL/environments/mujoco/rand_param_envs/gym/envs/safety/semisuper.py | hai-h-nguyen/pomdp-baselines | 629180d56641810d99653a116cca41ede65172eb | [
"MIT"
] | 40 | 2021-10-15T14:53:00.000Z | 2022-03-31T02:27:20.000Z | BOReL/environments/mujoco/rand_param_envs/gym/envs/safety/semisuper.py | hai-h-nguyen/pomdp-baselines | 629180d56641810d99653a116cca41ede65172eb | [
"MIT"
] | 1 | 2022-03-13T04:02:30.000Z | 2022-03-13T04:02:30.000Z | BOReL/environments/mujoco/rand_param_envs/gym/envs/safety/semisuper.py | hai-h-nguyen/pomdp-baselines | 629180d56641810d99653a116cca41ede65172eb | [
"MIT"
] | 5 | 2021-11-28T04:08:13.000Z | 2022-03-17T02:33:51.000Z | """
Superclass for all semi-supervised envs
These are toy problems but the principle is useful -- RL agents in the real world
will likely be learning from an inconsistent signal. For example, a human might
use a clicker to reward an RL agent but likely wouldn't do so with perfect consistency.
Note: In all semisupervi... | 27.792079 | 91 | 0.733523 |
02ff668ce52305381839a432f072ea9d065c9bd8 | 1,189 | py | Python | awswrangler/__init__.py | mumblepins/aws-data-wrangler | 4572fb53858ed204bb706d80e9f44fb8dd2e8679 | [
"Apache-2.0"
] | null | null | null | awswrangler/__init__.py | mumblepins/aws-data-wrangler | 4572fb53858ed204bb706d80e9f44fb8dd2e8679 | [
"Apache-2.0"
] | null | null | null | awswrangler/__init__.py | mumblepins/aws-data-wrangler | 4572fb53858ed204bb706d80e9f44fb8dd2e8679 | [
"Apache-2.0"
] | null | null | null | """Initial Module.
Source repository: https://github.com/awslabs/aws-data-wrangler
Documentation: https://aws-data-wrangler.readthedocs.io/
"""
import logging as _logging
from awswrangler import ( # noqa
athena,
catalog,
chime,
cloudwatch,
data_api,
dynamodb,
emr,
exceptions,
la... | 18.292308 | 97 | 0.645921 |
9e81e27629dab37504407ca3d2140575273639a2 | 2,827 | py | Python | tests/conftest.py | bollwyvl/pathy | 36c8de95572047862557f4009103db1037816f78 | [
"Apache-2.0"
] | null | null | null | tests/conftest.py | bollwyvl/pathy | 36c8de95572047862557f4009103db1037816f78 | [
"Apache-2.0"
] | null | null | null | tests/conftest.py | bollwyvl/pathy | 36c8de95572047862557f4009103db1037816f78 | [
"Apache-2.0"
] | null | null | null | import json
import os
import shutil
import tempfile
from pathlib import Path
import pytest
from pathy import Pathy, use_fs, use_fs_cache
from pathy.clients import set_client_params
from pathy.gcs import has_gcs
has_credentials = "GCS_CREDENTIALS" in os.environ
# Which adapters to use
TEST_ADAPTERS = ["gcs", "fs"] i... | 25.93578 | 85 | 0.666431 |
d1c259c2e06613f74d133d7055d2ffa694714fa7 | 168 | py | Python | todos/admin.py | yuliiabuchko/todo | 2a553ef6177f978126bbd746113eb4a50b9e3dea | [
"MIT"
] | null | null | null | todos/admin.py | yuliiabuchko/todo | 2a553ef6177f978126bbd746113eb4a50b9e3dea | [
"MIT"
] | 1 | 2021-04-08T21:17:38.000Z | 2021-04-08T21:17:38.000Z | todos/admin.py | yuliiabuchko/todo | 2a553ef6177f978126bbd746113eb4a50b9e3dea | [
"MIT"
] | null | null | null | from django.contrib import admin
from todos.models import *
@admin.register(Event, Statistic, Entry, Task, Status, Week)
class TodoAdmin(admin.ModelAdmin):
pass
| 18.666667 | 60 | 0.761905 |
7c02b486b89981f9110dd32d63b4a286719557fa | 21,612 | py | Python | detectron2/data/detection_utils.py | IliasMAOUDJ/detectron2 | 2764af5120d29e63422884d4c9aebcacf74fea44 | [
"Apache-2.0"
] | null | null | null | detectron2/data/detection_utils.py | IliasMAOUDJ/detectron2 | 2764af5120d29e63422884d4c9aebcacf74fea44 | [
"Apache-2.0"
] | null | null | null | detectron2/data/detection_utils.py | IliasMAOUDJ/detectron2 | 2764af5120d29e63422884d4c9aebcacf74fea44 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) Facebook, Inc. and its affiliates.
"""
Common data processing utilities that are used in a
typical object detection data pipeline.
"""
import logging
import numpy as np
from typing import List, Union
import pycocotools.mask as mask_util
import torch
from PIL import Image
from d... | 35.256117 | 105 | 0.634 |
96bb1c844aed51159fdeb8c2b04d0b95ba79ca1e | 1,057 | py | Python | src/downloader_4anime/events.py | fabriciopashaj/downloader-4anime | d313059a38d53d6019279da212e9196135e24ea5 | [
"MIT"
] | null | null | null | src/downloader_4anime/events.py | fabriciopashaj/downloader-4anime | d313059a38d53d6019279da212e9196135e24ea5 | [
"MIT"
] | 1 | 2021-11-01T21:45:30.000Z | 2021-11-11T13:15:24.000Z | src/downloader_4anime/events.py | fabriciopashaj/downloader-4anime | d313059a38d53d6019279da212e9196135e24ea5 | [
"MIT"
] | null | null | null | from typing import Callable, Union, Optional
EventDescriptor = Union[str, tuple[str, int]]
EventHandler = Union[Callable, list[Callable]]
class EventEmitter(object):
def __init__(self, events: list[str] = []):
self.__events = dict(((e, []) for e in events))
def on(self, event, handler: Callable):
if event not i... | 30.2 | 73 | 0.685904 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.