hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f725901ae4990c796dfc0c6fd9dcacb4bed91c78 | 3,385 | py | Python | examples/basic_operations/update_ad_group.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | examples/basic_operations/update_ad_group.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | examples/basic_operations/update_ad_group.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 32.548077 | 79 | 0.676809 |
import argparse
import sys
from google.ads.googleads.client import GoogleAdsClient
from google.ads.googleads.errors import GoogleAdsException
from google.api_core import protobuf_helpers
def main(client, customer_id, ad_group_id, cpc_bid_micro_amount):
ad_group_service = client.get_service("AdGr... | true | true |
f72590d6e6483328b9562e5788fc07feb3ad4594 | 11,628 | py | Python | tests/suite.py | dannielarriola/uai-coursebuilder | fbd440a8bfe1a928ac52985aea2949d5e91ad203 | [
"Apache-2.0"
] | null | null | null | tests/suite.py | dannielarriola/uai-coursebuilder | fbd440a8bfe1a928ac52985aea2949d5e91ad203 | [
"Apache-2.0"
] | 27 | 2016-08-31T19:04:46.000Z | 2016-09-29T00:22:32.000Z | tests/suite.py | dannielarriola/uai-coursebuilder | fbd440a8bfe1a928ac52985aea2949d5e91ad203 | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 Google 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 required by applicable law or ... | 36.566038 | 80 | 0.689456 |
__author__ = 'Sean Lip'
import argparse
import cStringIO
import logging
import os
import shutil
import sys
import unittest
import task_queue
import webtest
import appengine_config
from tools.etl import etl
from google.appengine.api.search import simple_search_stub
from google.appengine.datastore imp... | true | true |
f7259138e078865f2f6c44a93538b382ee2f400a | 786 | py | Python | pyleecan/Methods/Output/OutElec/get_Nr.py | tobsen2code/pyleecan | 5b1ded9e389e0c79ed7b7c878b6e939f2d9962e9 | [
"Apache-2.0"
] | 5 | 2020-03-05T15:22:39.000Z | 2022-03-02T15:26:08.000Z | pyleecan/Methods/Output/OutElec/get_Nr.py | Eomys/Pyleecan | 4d7f0cbabf0311006963e7a2f435db2ecd901118 | [
"Apache-2.0"
] | 8 | 2020-07-09T07:43:01.000Z | 2022-03-08T12:52:06.000Z | pyleecan/Methods/Output/OutElec/get_Nr.py | Eomys/Pyleecan | 4d7f0cbabf0311006963e7a2f435db2ecd901118 | [
"Apache-2.0"
] | 4 | 2019-12-23T12:38:01.000Z | 2022-01-07T10:47:48.000Z | from numpy import ones
def get_Nr(self, Time=None):
"""Create speed in function of time vector Nr
Parameters
----------
self : OutElec
An OutElec object
Time : Data
a time axis (SciDataTool Data object)
Returns
-------
Nr: ndarray
speed in function of time
... | 23.818182 | 84 | 0.611959 | from numpy import ones
def get_Nr(self, Time=None):
if Time is None:
if self.axes_dict is not None and "time" in self.axes_dict:
Time = self.axes_dict["time"]
else:
raise Exception('You must define "time" property before calling get_Nr')
if self.OP.get_N0() is None:
... | true | true |
f725918c5d899450e00f379c56c435cdc1df4d6a | 8,936 | py | Python | python/ccxt/async/base/exchange.py | bilibilihuangyifan/ccxt | e3e058067808014c7110813d626d8a076ce96edb | [
"MIT"
] | 73 | 2018-05-15T00:53:50.000Z | 2022-03-07T14:45:11.000Z | python/ccxt/async/base/exchange.py | bilibilihuangyifan/ccxt | e3e058067808014c7110813d626d8a076ce96edb | [
"MIT"
] | 20 | 2018-05-15T08:46:45.000Z | 2018-06-19T08:49:27.000Z | python/ccxt/async/base/exchange.py | bilibilihuangyifan/ccxt | e3e058067808014c7110813d626d8a076ce96edb | [
"MIT"
] | 11 | 2018-05-15T00:09:30.000Z | 2022-03-07T14:45:27.000Z | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
__version__ = '1.13.142'
# -----------------------------------------------------------------------------
import asyncio
import concurrent
import socket
import time
import math
import random
import certifi
import ... | 40.618182 | 135 | 0.602171 |
__version__ = '1.13.142'
import asyncio
import concurrent
import socket
import time
import math
import random
import certifi
import aiohttp
import ssl
import yarl
from ccxt.async.base.throttle import throttle
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import ExchangeNotAvailable
from ... | false | true |
f72592c33a736521f66954a48dff265345cf299f | 1,296 | py | Python | Homeautomation/Alarmpi/get_trypico2wave.py | EtechProjects/Curtains-and-Blinds-Tests | 7bfacf50ee7a4b951337e60f0fa288fbe59762e2 | [
"Apache-2.0"
] | null | null | null | Homeautomation/Alarmpi/get_trypico2wave.py | EtechProjects/Curtains-and-Blinds-Tests | 7bfacf50ee7a4b951337e60f0fa288fbe59762e2 | [
"Apache-2.0"
] | null | null | null | Homeautomation/Alarmpi/get_trypico2wave.py | EtechProjects/Curtains-and-Blinds-Tests | 7bfacf50ee7a4b951337e60f0fa288fbe59762e2 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os.path
import subprocess
import uuid
from aptts import alarmpi_tts
class trypico2wave(alarmpi_tts):
def play(self, content, ramdrive='/mnt/ram/'):
if self.debug:
print "Trying pico2wave."
rval = True
p2w = self.sconfig['head']
lang =self.sc... | 28.173913 | 70 | 0.595679 |
import os.path
import subprocess
import uuid
from aptts import alarmpi_tts
class trypico2wave(alarmpi_tts):
def play(self, content, ramdrive='/mnt/ram/'):
if self.debug:
print "Trying pico2wave."
rval = True
p2w = self.sconfig['head']
lang =self.sconfig['lang']
if not os.path.isfile(p2w)... | false | true |
f72595be695d8aadf33d417466be973d11af82cd | 21,863 | py | Python | qkeras/qoctave.py | thaarres/qkeras | a04bfe65a144ef6dd0ca0880866ef6109c3638fc | [
"Apache-2.0"
] | 1 | 2019-12-08T16:22:21.000Z | 2019-12-08T16:22:21.000Z | qkeras/qoctave.py | Athena-INT/qkeras | 4cd7bb948bca11507d124cdddc3afda4956a72db | [
"Apache-2.0"
] | null | null | null | qkeras/qoctave.py | Athena-INT/qkeras | 4cd7bb948bca11507d124cdddc3afda4956a72db | [
"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,... | 36.806397 | 80 | 0.634725 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import re
from keras.layers import Activation
from keras.layers import Add
from keras.layers import AveragePooling2D
from keras.layers import Conv2D
from keras.layers import SeparableConv2D
fro... | true | true |
f7259600ce77f1327a75cfc7ad33fc54ddf8e263 | 261 | py | Python | daily_work/daily_work/doctype/daily_default_setting/daily_default_setting.py | muirawachanga/mwai | 1a95cba5bc6368361fc48984ba05307ae4093ead | [
"MIT"
] | null | null | null | daily_work/daily_work/doctype/daily_default_setting/daily_default_setting.py | muirawachanga/mwai | 1a95cba5bc6368361fc48984ba05307ae4093ead | [
"MIT"
] | null | null | null | daily_work/daily_work/doctype/daily_default_setting/daily_default_setting.py | muirawachanga/mwai | 1a95cba5bc6368361fc48984ba05307ae4093ead | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2019, steve and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class DailyDefaultSetting(Document):
pass
| 23.727273 | 49 | 0.785441 |
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class DailyDefaultSetting(Document):
pass
| true | true |
f7259615a162f1f9b8997248b81998d51618e2f1 | 1,384 | py | Python | cli.py | stesla/arxtools | 7f1a3b973e3d78faed4085d547b7d27ebcd9838d | [
"MIT"
] | null | null | null | cli.py | stesla/arxtools | 7f1a3b973e3d78faed4085d547b7d27ebcd9838d | [
"MIT"
] | null | null | null | cli.py | stesla/arxtools | 7f1a3b973e3d78faed4085d547b7d27ebcd9838d | [
"MIT"
] | null | null | null | import click
import configparser
import json
import sys
from arxtools import export_clues, fetch_clues
from arxtools.clue import Clue
@click.group()
def cli():
pass
def get_character_info(name):
config = configparser.ConfigParser()
config.read('arxtools.ini')
try:
return config[name.lower()]... | 24.714286 | 68 | 0.682803 | import click
import configparser
import json
import sys
from arxtools import export_clues, fetch_clues
from arxtools.clue import Clue
@click.group()
def cli():
pass
def get_character_info(name):
config = configparser.ConfigParser()
config.read('arxtools.ini')
try:
return config[name.lower()]... | true | true |
f7259776fb98e992d885bf99cf4adf99f37e8745 | 8,549 | py | Python | gui/qt/utxo_list.py | ComputerCraftr/openswap | 7de04aa80dab79bebe4b64483011dad70a48694c | [
"MIT"
] | 16 | 2018-11-05T13:19:02.000Z | 2021-04-06T12:11:49.000Z | gui/qt/utxo_list.py | ComputerCraftr/openswap | 7de04aa80dab79bebe4b64483011dad70a48694c | [
"MIT"
] | 11 | 2018-11-11T08:56:03.000Z | 2018-12-08T02:31:57.000Z | gui/qt/utxo_list.py | ComputerCraftr/openswap | 7de04aa80dab79bebe4b64483011dad70a48694c | [
"MIT"
] | 5 | 2019-01-07T13:45:05.000Z | 2020-06-12T14:13:21.000Z | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2015 Thomas Voegtlin
#
# 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... | 52.771605 | 138 | 0.63177 |
from .util import *
from electroncash.i18n import _
class UTXOList(MyTreeWidget):
filter_columns = [0, 2]
def __init__(self, parent=None):
MyTreeWidget.__init__(self, parent, self.create_menu, [ _('Address'), _('Label'), _('Amount'), _('Height'), _('Output point')], 1)
... | true | true |
f72597acf84a319c1cde2a9c2a80f3c7b7cfc2a4 | 984 | py | Python | src/platform/avr/pmfeatures.py | ArtemovSA/PyMite | a22fbae773b285ccf4993905a46dd396cb762f69 | [
"OLDAP-2.6",
"Python-2.0"
] | 51 | 2015-03-24T07:53:03.000Z | 2021-08-06T12:55:53.000Z | src/platform/avr/pmfeatures.py | ArtemovSA/PyMite | a22fbae773b285ccf4993905a46dd396cb762f69 | [
"OLDAP-2.6",
"Python-2.0"
] | null | null | null | src/platform/avr/pmfeatures.py | ArtemovSA/PyMite | a22fbae773b285ccf4993905a46dd396cb762f69 | [
"OLDAP-2.6",
"Python-2.0"
] | 15 | 2015-04-09T14:17:27.000Z | 2022-01-26T02:42:47.000Z | # This file is Copyright 2010 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | 32.8 | 74 | 0.707317 |
PM_FEATURES = {
"HAVE_PRINT": True,
"HAVE_GC": True,
"HAVE_FLOAT": False,
"HAVE_DEL": True,
"HAVE_IMPORTS": True,
"HAVE_DEFAULTARGS": True,
"HAVE_REPLICATION": True,
"HAVE_CLASSES": False,
"HAVE_ASSERT": False,
"HAVE_GENERATORS": False,
"HAVE_BACKTICK": True,
... | true | true |
f7259813b4e802d256d946467bf98359af8d5554 | 2,970 | py | Python | ally/Order/tests/PricingConstruction.py | jpwatt/PyAlly | 463ac0ad22df7dd79456c58ab8da4d378427983c | [
"MIT"
] | 2 | 2021-02-28T22:02:38.000Z | 2021-12-20T19:00:25.000Z | ally/Order/tests/PricingConstruction.py | jpwatt/PyAlly | 463ac0ad22df7dd79456c58ab8da4d378427983c | [
"MIT"
] | null | null | null | ally/Order/tests/PricingConstruction.py | jpwatt/PyAlly | 463ac0ad22df7dd79456c58ab8da4d378427983c | [
"MIT"
] | null | null | null | # MIT License
#
# Copyright (c) 2020 Brett Graves
#
# 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,... | 23.385827 | 80 | 0.66835 |
import xml.etree.ElementTree as ET
import unittest
from ..classes import *
from .classes import *
from ..order import Order
class TestPricingConstruction(unittest.TestCase):
def test_market_construction(self):
p = Market()
self.assertEqual(
p.attributes,
{'Typ':'1'},
"Should h... | true | true |
f72598b7fb1cec8183f6a3b3b326c48b968194b9 | 2,843 | py | Python | starvine/bvcopula/tests/test_freeze_params.py | wgurecky/StarVine | b952a88eeaff476484ba6a26420cfe4ef575d162 | [
"BSD-3-Clause"
] | 12 | 2018-10-04T06:15:13.000Z | 2020-01-08T03:32:30.000Z | starvine/bvcopula/tests/test_freeze_params.py | wgurecky/StarVine | b952a88eeaff476484ba6a26420cfe4ef575d162 | [
"BSD-3-Clause"
] | 25 | 2017-08-29T06:28:37.000Z | 2020-10-16T23:56:57.000Z | starvine/bvcopula/tests/test_freeze_params.py | wgurecky/StarVine | b952a88eeaff476484ba6a26420cfe4ef575d162 | [
"BSD-3-Clause"
] | 3 | 2017-04-08T20:19:09.000Z | 2020-01-09T20:01:02.000Z | ##
# \brief Test ability to determine best fit copula via AIC
from __future__ import print_function, division
from starvine.bvcopula.pc_base import PairCopula
import unittest
import numpy as np
import os
pwd_ = os.getcwd()
dataDir = pwd_ + "/tests/data/"
np.random.seed(123)
class TestGaussFrozen(unittest.TestCase):
... | 35.098765 | 86 | 0.651425 |
from __future__ import print_function, division
from starvine.bvcopula.pc_base import PairCopula
import unittest
import numpy as np
import os
pwd_ = os.getcwd()
dataDir = pwd_ + "/tests/data/"
np.random.seed(123)
class TestGaussFrozen(unittest.TestCase):
@classmethod
def setUpClass(self):
np.random.s... | true | true |
f7259984a8976fd2deb189a6e90d3aaeabfca3d9 | 1,402 | py | Python | source/appModules/totalcmd.py | oleguldberg/nvda | 05f55ff146ef8ba481a2de4f1bcf187200474cea | [
"bzip2-1.0.6"
] | 1,592 | 2015-11-10T12:05:44.000Z | 2022-03-31T11:50:40.000Z | source/appModules/totalcmd.py | oleguldberg/nvda | 05f55ff146ef8ba481a2de4f1bcf187200474cea | [
"bzip2-1.0.6"
] | 9,479 | 2015-11-10T20:56:48.000Z | 2022-03-31T23:51:30.000Z | source/appModules/totalcmd.py | oleguldberg/nvda | 05f55ff146ef8ba481a2de4f1bcf187200474cea | [
"bzip2-1.0.6"
] | 682 | 2015-11-10T11:19:23.000Z | 2022-03-31T07:51:29.000Z | #appModules/totalcmd.py
#A part of NonVisual Desktop Access (NVDA)
#Copyright (C) 2006-2012 NVDA Contributors
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.
import appModuleHandler
from NVDAObjects.IAccessible import IAccessible
import speech
import controlTypes
import... | 28.04 | 73 | 0.752496 |
import appModuleHandler
from NVDAObjects.IAccessible import IAccessible
import speech
import controlTypes
import ui
oldActivePannel=0
class AppModule(appModuleHandler.AppModule):
def chooseNVDAObjectOverlayClasses(self, obj, clsList):
if obj.windowClassName in ("TMyListBox", "TMyListBox.UnicodeClass"):
c... | true | true |
f7259a6ab0d551d886b30961db6d5aff508bdecb | 772 | py | Python | scripts/plotting/reprocessed_kccg_samples_pca/main.py | populationgenomics/ancestry | faf6fd4bc3a1f8b2a2adb7e59cf584d4bfdf79e6 | [
"MIT"
] | null | null | null | scripts/plotting/reprocessed_kccg_samples_pca/main.py | populationgenomics/ancestry | faf6fd4bc3a1f8b2a2adb7e59cf584d4bfdf79e6 | [
"MIT"
] | 21 | 2021-03-09T06:35:59.000Z | 2022-02-21T22:56:15.000Z | scripts/plotting/reprocessed_kccg_samples_pca/main.py | populationgenomics/ancestry | faf6fd4bc3a1f8b2a2adb7e59cf584d4bfdf79e6 | [
"MIT"
] | null | null | null | """Entry point for the analysis runner."""
import os
import sys
import hail as hl
import hailtop.batch as hb
from analysis_runner import dataproc
OUTPUT = os.getenv('OUTPUT')
assert OUTPUT
hl.init(default_reference='GRCh38')
POP = sys.argv[1] if len(sys.argv) > 1 else 'nfe'
service_backend = hb.ServiceBackend(
... | 24.125 | 86 | 0.727979 |
import os
import sys
import hail as hl
import hailtop.batch as hb
from analysis_runner import dataproc
OUTPUT = os.getenv('OUTPUT')
assert OUTPUT
hl.init(default_reference='GRCh38')
POP = sys.argv[1] if len(sys.argv) > 1 else 'nfe'
service_backend = hb.ServiceBackend(
billing_project=os.getenv('HAIL_BILLING_PR... | true | true |
f7259b305c1ad5cae4a9beae16737854d8e966c3 | 7,804 | py | Python | botstory/ast/story_context/__init__.py | botstory/bot-story | 9c5b2fc7f7a14dbd467d70f60d5ba855ef89dac3 | [
"MIT"
] | 5 | 2017-01-14T13:42:13.000Z | 2021-07-27T21:52:04.000Z | botstory/ast/story_context/__init__.py | botstory/bot-story | 9c5b2fc7f7a14dbd467d70f60d5ba855ef89dac3 | [
"MIT"
] | 235 | 2016-11-07T23:33:28.000Z | 2018-03-13T11:27:33.000Z | botstory/ast/story_context/__init__.py | hyzhak/bot-story | 9c5b2fc7f7a14dbd467d70f60d5ba855ef89dac3 | [
"MIT"
] | 5 | 2017-01-14T13:42:14.000Z | 2020-11-06T08:33:20.000Z | from botstory import matchers, utils
from botstory.ast import callable, forking, loop
from botstory.ast.story_context import reducers
from botstory.utils import advanced_json_encoder
import numbers
import logging
import uuid
logger = logging.getLogger(__name__)
class MissedStoryPart(Exception):
pass
class Sto... | 32.381743 | 103 | 0.631471 | from botstory import matchers, utils
from botstory.ast import callable, forking, loop
from botstory.ast.story_context import reducers
from botstory.utils import advanced_json_encoder
import numbers
import logging
import uuid
logger = logging.getLogger(__name__)
class MissedStoryPart(Exception):
pass
class Sto... | true | true |
f7259b4e1f74cc2b78fa2fe6a806234b94c86cc1 | 6,467 | py | Python | scd_manager.py | gavinlive/scd-data-manager | 570b67bacb4bf17f0b49c5875933f233ddd76e6c | [
"MIT"
] | null | null | null | scd_manager.py | gavinlive/scd-data-manager | 570b67bacb4bf17f0b49c5875933f233ddd76e6c | [
"MIT"
] | 1 | 2020-06-09T08:48:01.000Z | 2020-06-09T09:23:07.000Z | scd_manager.py | gavinlive/scd-data-manager | 570b67bacb4bf17f0b49c5875933f233ddd76e6c | [
"MIT"
] | null | null | null | import os, sys
import pydicom as pyd
import matplotlib.pyplot as plt
import collections
import pandas as pd
PatientRecord = collections.namedtuple('PatientRecord', ['patient_id', 'image_folder', 'original_id', 'gender', 'age', 'pathology', 'all_scans', 'scans', 'scans_list', 'scans_total'])
PatientScans = collections... | 44.6 | 183 | 0.598113 | import os, sys
import pydicom as pyd
import matplotlib.pyplot as plt
import collections
import pandas as pd
PatientRecord = collections.namedtuple('PatientRecord', ['patient_id', 'image_folder', 'original_id', 'gender', 'age', 'pathology', 'all_scans', 'scans', 'scans_list', 'scans_total'])
PatientScans = collections... | true | true |
f7259c70b3269cebc23b86955129c52126b5c426 | 587 | py | Python | Python1/python1Homework/input_counter1.py | ceeblet/OST_PythonCertificationTrack | 042e0ce964bc88b3f4132dcbd7e06c5f504eae34 | [
"MIT"
] | null | null | null | Python1/python1Homework/input_counter1.py | ceeblet/OST_PythonCertificationTrack | 042e0ce964bc88b3f4132dcbd7e06c5f504eae34 | [
"MIT"
] | null | null | null | Python1/python1Homework/input_counter1.py | ceeblet/OST_PythonCertificationTrack | 042e0ce964bc88b3f4132dcbd7e06c5f504eae34 | [
"MIT"
] | null | null | null | #!/usr/local/bin/python3
"""input_counter.py"""
myset = set()
mydict = {}
mysetlength = len(myset)
while True:
text = input("Enter a line (or Enter to quit): ")
if not text:
break
for punc in ",?;.":
text = text.replace(punc, "")
textwords = (text.lower().split())
for word in textwo... | 26.681818 | 53 | 0.584327 |
myset = set()
mydict = {}
mysetlength = len(myset)
while True:
text = input("Enter a line (or Enter to quit): ")
if not text:
break
for punc in ",?;.":
text = text.replace(punc, "")
textwords = (text.lower().split())
for word in textwords:
myset.add(word)
newsetleng... | true | true |
f7259ef31d09ee215158684c34454fabb4e5926d | 614 | py | Python | aws-auth0-auth/helloWorld.py | skarlekar/ms-auth-tutorials | 0de172817e54533be93700de19028cfa8757861f | [
"MIT"
] | null | null | null | aws-auth0-auth/helloWorld.py | skarlekar/ms-auth-tutorials | 0de172817e54533be93700de19028cfa8757861f | [
"MIT"
] | 1 | 2021-06-01T21:41:36.000Z | 2021-06-01T21:41:36.000Z | aws-auth0-auth/helloWorld.py | skarlekar/ms-auth-tutorials | 0de172817e54533be93700de19028cfa8757861f | [
"MIT"
] | 1 | 2017-10-26T15:08:40.000Z | 2017-10-26T15:08:40.000Z | """Simple helloWorld service."""
import json
def sayHello(event, context):
"""Return a message in the response body."""
print('Event is: {}'.format(json.dumps(event)))
body = {
"message": "Hello! Your Auth0 authorized function executed successfully!"
}
response = {
"statusCode": 2... | 22.740741 | 81 | 0.599349 | import json
def sayHello(event, context):
print('Event is: {}'.format(json.dumps(event)))
body = {
"message": "Hello! Your Auth0 authorized function executed successfully!"
}
response = {
"statusCode": 200,
"body": json.dumps(body)
}
return response
# integr... | true | true |
f7259f1cbf5a3448b4489597dc832795cc8d1b52 | 9,120 | py | Python | fuji_server/models/data_provenance.py | vemonet/fuji | 92aabcb58d76a58981c677bcf0da8e57309c6096 | [
"MIT"
] | null | null | null | fuji_server/models/data_provenance.py | vemonet/fuji | 92aabcb58d76a58981c677bcf0da8e57309c6096 | [
"MIT"
] | null | null | null | fuji_server/models/data_provenance.py | vemonet/fuji | 92aabcb58d76a58981c677bcf0da8e57309c6096 | [
"MIT"
] | null | null | null | # coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from fuji_server.models.base_model_ import Model
from fuji_server.models.data_provenance_output import DataProvenanceOutput # noqa: F401,E501
from fuji_server.models.d... | 31.448276 | 311 | 0.639035 |
from __future__ import absolute_import
from datetime import date, datetime
from typing import List, Dict
from fuji_server.models.base_model_ import Model
from fuji_server.models.data_provenance_output import DataProvenanceOutput
from fuji_server.models.debug import Debug
from fuji_server.models.fair_result_... | true | true |
f725a0d77d7b829ac919d0eaca76f246b6e73be7 | 43,643 | py | Python | dbaas/maintenance/migrations/0030_auto__add_field_maintenance_disable_alarms.py | didindinn/database-as-a-service | 747de31ff8546f7874ddd654af860e130afd17a0 | [
"BSD-3-Clause"
] | 303 | 2015-01-08T10:35:54.000Z | 2022-02-28T08:54:06.000Z | dbaas/maintenance/migrations/0030_auto__add_field_maintenance_disable_alarms.py | nouraellm/database-as-a-service | 5e655c9347bea991b7218a01549f5e44f161d7be | [
"BSD-3-Clause"
] | 124 | 2015-01-14T12:56:15.000Z | 2022-03-22T20:45:11.000Z | dbaas/maintenance/migrations/0030_auto__add_field_maintenance_disable_alarms.py | nouraellm/database-as-a-service | 5e655c9347bea991b7218a01549f5e44f161d7be | [
"BSD-3-Clause"
] | 110 | 2015-01-02T11:59:48.000Z | 2022-02-28T08:54:06.000Z | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Maintenance.disable_alarms'
db.add_column(u'maintenance_m... | 97.200445 | 227 | 0.578512 |
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
db.add_column(u'maintenance_maintenance', 'disable_alarms',
self.gf('djan... | true | true |
f725a15222a68089d26599b0bfbcfc3a016ae93b | 1,466 | py | Python | _action_files/nb2post.py | inc0/fastpages | 28603b7c6f38f83eea715ab12d71895078dbff9a | [
"Apache-2.0"
] | null | null | null | _action_files/nb2post.py | inc0/fastpages | 28603b7c6f38f83eea715ab12d71895078dbff9a | [
"Apache-2.0"
] | null | null | null | _action_files/nb2post.py | inc0/fastpages | 28603b7c6f38f83eea715ab12d71895078dbff9a | [
"Apache-2.0"
] | null | null | null | """Converts Jupyter Notebooks to Jekyll compliant blog posts"""
from datetime import datetime
import re, os, logging
from nbdev import export2html
from nbdev.export2html import Config, Path, _re_digits, _to_html, _re_block_notes
from fast_template import rename_for_jekyll
warnings = set()
# Modify the naming proc... | 39.621622 | 100 | 0.723056 | from datetime import datetime
import re, os, logging
from nbdev import export2html
from nbdev.export2html import Config, Path, _re_digits, _to_html, _re_block_notes
from fast_template import rename_for_jekyll
warnings = set()
def _nb2htmlfname(nb_path, dest=None):
fname = rename_for_jekyll(nb_path, warnings... | true | true |
f725a1d093a3821295e1aa148bb4213f8b3be699 | 7,204 | py | Python | Chapter05/stock_trading_visual_continuous_env.py | harinipsamy/Tensorflow-2-Reinforcement-Learning-Cookbook | b8858554e4c819c96de10c100f8213ab41561c69 | [
"MIT"
] | null | null | null | Chapter05/stock_trading_visual_continuous_env.py | harinipsamy/Tensorflow-2-Reinforcement-Learning-Cookbook | b8858554e4c819c96de10c100f8213ab41561c69 | [
"MIT"
] | null | null | null | Chapter05/stock_trading_visual_continuous_env.py | harinipsamy/Tensorflow-2-Reinforcement-Learning-Cookbook | b8858554e4c819c96de10c100f8213ab41561c69 | [
"MIT"
] | 1 | 2021-03-27T18:35:14.000Z | 2021-03-27T18:35:14.000Z | #!/usr/bin/env python
# Visual stock/share trading RL environment with continuous trade actions
# Chapter 5, TensorFlow 2 Reinforcement Learning Cookbook | Praveen Palanisamy
import os
import random
from typing import Dict
import cv2
import gym
import numpy as np
import pandas as pd
from gym import spaces
from tradi... | 35.141463 | 88 | 0.593282 |
import os
import random
from typing import Dict
import cv2
import gym
import numpy as np
import pandas as pd
from gym import spaces
from trading_utils import TradeVisualizer
env_config = {
"ticker": "MSFT",
"opening_account_balance": 1000,
"observation_horizon_sequence_length": 30,
}
class Sto... | true | true |
f725a200284daaaded9eadc2048d2708f4206809 | 109,449 | py | Python | olfactorybulb/slices/CoronalSlice/TC4_0.py | fameshpatel/olfactorybulb | 8d7a644b4560309ef177c0590ff73ed4c2432604 | [
"MIT"
] | null | null | null | olfactorybulb/slices/CoronalSlice/TC4_0.py | fameshpatel/olfactorybulb | 8d7a644b4560309ef177c0590ff73ed4c2432604 | [
"MIT"
] | null | null | null | olfactorybulb/slices/CoronalSlice/TC4_0.py | fameshpatel/olfactorybulb | 8d7a644b4560309ef177c0590ff73ed4c2432604 | [
"MIT"
] | null | null | null |
from neuron import h
class TransformTC4:
def __init__(self):
# Create a section lookup by section name
# Note: this assumes each section has a unique name
self.name2section = { sec.name(): sec for sec in h.allsec() }
# This will store the new section coordinates
self.sect... | 92.910866 | 3,305 | 0.576177 |
from neuron import h
class TransformTC4:
def __init__(self):
self.name2section = { sec.name(): sec for sec in h.allsec() }
self.section_coords = { }
def set_coords(self, sec_name):
nrn_section = self.name2section[sec_name]
new_co... | true | true |
f725a28db4c34f0091289d14f2db993acdf9d82d | 9,405 | py | Python | core/addons/api/__init__.py | photos-network/core | dae64af83dccfa37fc0923370072a360da941c28 | [
"Apache-2.0"
] | 4 | 2020-12-30T12:48:46.000Z | 2022-03-29T17:44:00.000Z | core/addons/api/__init__.py | photos-network/core | dae64af83dccfa37fc0923370072a360da941c28 | [
"Apache-2.0"
] | null | null | null | core/addons/api/__init__.py | photos-network/core | dae64af83dccfa37fc0923370072a360da941c28 | [
"Apache-2.0"
] | 2 | 2021-01-24T19:13:53.000Z | 2021-11-02T16:43:25.000Z | """REST API implementation."""
import json
import logging
import os
import pathlib
from datetime import datetime
from aiohttp import web
from core.addons.api.dto.details import Details
from core.addons.api.dto.location import Location
from core.addons.api.dto.photo import PhotoDetailsResponse, PhotoEncoder, PhotoResp... | 32.543253 | 101 | 0.612547 | import json
import logging
import os
import pathlib
from datetime import datetime
from aiohttp import web
from core.addons.api.dto.details import Details
from core.addons.api.dto.location import Location
from core.addons.api.dto.photo import PhotoDetailsResponse, PhotoEncoder, PhotoResponse
from core.addons.api.dto.p... | true | true |
f725a39885307cc168891a50213872ddbdd21689 | 1,475 | py | Python | _unittests/ut_module/test_code_style.py | sdpython/papierstat | f69de884c59ada30b58224dca39f2a44d92122c1 | [
"MIT"
] | 7 | 2019-03-21T09:52:31.000Z | 2021-01-17T16:56:27.000Z | _unittests/ut_module/test_code_style.py | sdpython/papierstat | f69de884c59ada30b58224dca39f2a44d92122c1 | [
"MIT"
] | 33 | 2018-02-08T23:56:57.000Z | 2021-02-10T23:55:43.000Z | _unittests/ut_module/test_code_style.py | sdpython/papierstat | f69de884c59ada30b58224dca39f2a44d92122c1 | [
"MIT"
] | 1 | 2021-02-11T09:16:33.000Z | 2021-02-11T09:16:33.000Z | """
@brief test log(time=150s)
"""
import os
import unittest
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import check_pep8, ExtTestCase
class TestCodeStyle(ExtTestCase):
"""Test style."""
def test_style_src(self):
thi = os.path.abspath(os.path.dirname(__file__))
sr... | 38.815789 | 88 | 0.520678 | import os
import unittest
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import check_pep8, ExtTestCase
class TestCodeStyle(ExtTestCase):
def test_style_src(self):
thi = os.path.abspath(os.path.dirname(__file__))
src_ = os.path.normpath(os.path.join(thi, "..", "..", "src"))
... | true | true |
f725a3fd1b003a319b8f8190e60431bedbbcf49d | 1,698 | py | Python | src/LossFunctions/ActionCrossEntropy.py | Marcel-Rodekamp/MLP | 349ac8e10679e2ec53980908c580902996a493e7 | [
"MIT"
] | 1 | 2021-06-15T09:01:09.000Z | 2021-06-15T09:01:09.000Z | src/LossFunctions/ActionCrossEntropy.py | Marcel-Rodekamp/MLP | 349ac8e10679e2ec53980908c580902996a493e7 | [
"MIT"
] | null | null | null | src/LossFunctions/ActionCrossEntropy.py | Marcel-Rodekamp/MLP | 349ac8e10679e2ec53980908c580902996a493e7 | [
"MIT"
] | null | null | null | import torch
class ActionCrossEntropyFunction(torch.autograd.Function):
@staticmethod
def forward(self,input,target,action,force = None):
self.mb_size,self.dim = input.size()
# save the force for backward
self.force = force
# get action difference
action_input = torch... | 36.913043 | 148 | 0.689046 | import torch
class ActionCrossEntropyFunction(torch.autograd.Function):
@staticmethod
def forward(self,input,target,action,force = None):
self.mb_size,self.dim = input.size()
self.force = force
action_input = torch.tensor( [action(input[i_mb,:].numpy()) for i_mb in ... | true | true |
f725a5330ea476bf3d80b1dcb996e9b5875e2f37 | 918 | py | Python | setup.py | NgHoangDat/lescode | f19d8f2ca47aee947d2b2d88e5008ce4a58faeb6 | [
"MIT"
] | 1 | 2020-06-17T03:33:58.000Z | 2020-06-17T03:33:58.000Z | setup.py | NgHoangDat/lescode | f19d8f2ca47aee947d2b2d88e5008ce4a58faeb6 | [
"MIT"
] | null | null | null | setup.py | NgHoangDat/lescode | f19d8f2ca47aee947d2b2d88e5008ce4a58faeb6 | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
__VERSION__ = "0.2.10"
setuptools.setup(
name="lescode",
packages=setuptools.find_packages(),
version=__VERSION__,
author="nghoangdat",
author_email="18.hoang.dat.12@gmail.com",
descripti... | 27 | 88 | 0.641612 | import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
__VERSION__ = "0.2.10"
setuptools.setup(
name="lescode",
packages=setuptools.find_packages(),
version=__VERSION__,
author="nghoangdat",
author_email="18.hoang.dat.12@gmail.com",
descripti... | true | true |
f725a7c0a43b428ee68f9ed16d64cc59f6ac188b | 11,328 | py | Python | haystack/utils/squad_data.py | ArzelaAscoIi/haystack | be8f50c9e3de4e264b3f345f5f4b9c9ec518ed08 | [
"Apache-2.0"
] | 1 | 2022-02-15T04:32:41.000Z | 2022-02-15T04:32:41.000Z | haystack/utils/squad_data.py | ArzelaAscoIi/haystack | be8f50c9e3de4e264b3f345f5f4b9c9ec518ed08 | [
"Apache-2.0"
] | null | null | null | haystack/utils/squad_data.py | ArzelaAscoIi/haystack | be8f50c9e3de4e264b3f345f5f4b9c9ec518ed08 | [
"Apache-2.0"
] | null | null | null | from typing import List
import logging
import json
import random
import pandas as pd
from tqdm import tqdm
from haystack.schema import Document, Label
from haystack.modeling.data_handler.processor import _read_squad_file
logging.basicConfig()
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
tqdm... | 36.779221 | 124 | 0.566561 | from typing import List
import logging
import json
import random
import pandas as pd
from tqdm import tqdm
from haystack.schema import Document, Label
from haystack.modeling.data_handler.processor import _read_squad_file
logging.basicConfig()
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
tqdm... | true | true |
f725a83f718d805f89f9a0c04adb8de750d17bf3 | 7,720 | py | Python | tests/test_settings.py | zbyte64/django-dockit | 8d00a46cb0b6237de622fcb6816067078106a0c4 | [
"BSD-3-Clause"
] | 5 | 2015-02-25T17:01:48.000Z | 2021-06-03T07:46:47.000Z | tests/test_settings.py | zbyte64/django-dockit | 8d00a46cb0b6237de622fcb6816067078106a0c4 | [
"BSD-3-Clause"
] | 1 | 2015-03-11T15:19:55.000Z | 2015-04-13T04:14:24.000Z | tests/test_settings.py | zbyte64/django-dockit | 8d00a46cb0b6237de622fcb6816067078106a0c4 | [
"BSD-3-Clause"
] | null | null | null | # Django settings for {{ project_name }} project.
import os
PROJECT_DIR = os.path.dirname(os.path.abspath(__file__))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add ... | 34.618834 | 122 | 0.651684 |
import os
PROJECT_DIR = os.path.dirname(os.path.abspath(__file__))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
'USER': '',
... | true | true |
f725a8967049f2e2f616b7777ed95915bf059305 | 82 | py | Python | src/yeelight_atmosphere/__init__.py | NikSavilov/yeelight-atmosphere | 8860c2869380be50a6305b5b2aa77ed3636145d3 | [
"MIT"
] | null | null | null | src/yeelight_atmosphere/__init__.py | NikSavilov/yeelight-atmosphere | 8860c2869380be50a6305b5b2aa77ed3636145d3 | [
"MIT"
] | 7 | 2021-11-13T13:07:21.000Z | 2021-11-19T16:30:37.000Z | src/yeelight_atmosphere/__init__.py | NikSavilov/yeelight-atmosphere | 8860c2869380be50a6305b5b2aa77ed3636145d3 | [
"MIT"
] | null | null | null | """
Package allows to interact with Yeelight bulbs.
"""
__author__ = "Savilov N."
| 16.4 | 47 | 0.707317 | __author__ = "Savilov N."
| true | true |
f725a9201795c774934495e6a45ebb15b68ea359 | 5,930 | py | Python | doc/conf.py | open-dynamic-robot-initiative/mw_dual_motor_torque_ctrl | 765b2ac852952d0643caec652b2b92e9d7d18dd9 | [
"BSD-3-Clause"
] | 10 | 2020-07-06T01:06:58.000Z | 2022-03-13T23:37:46.000Z | doc/conf.py | open-dynamic-robot-initiative/mw_dual_motor_torque_ctrl | 765b2ac852952d0643caec652b2b92e9d7d18dd9 | [
"BSD-3-Clause"
] | 4 | 2019-08-30T06:37:14.000Z | 2021-10-05T12:28:39.000Z | doc/conf.py | open-dynamic-robot-initiative/mw_dual_motor_torque_ctrl | 765b2ac852952d0643caec652b2b92e9d7d18dd9 | [
"BSD-3-Clause"
] | 5 | 2021-01-01T16:03:55.000Z | 2022-02-17T22:02:35.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# ODRI Motor Board Firmware for CAN Communication documentation build
# configuration file, created by sphinx-quickstart on Thu Aug 12 17:06:32 2021.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible confi... | 30.885417 | 79 | 0.679764 |
extensions = [
"sphinx.ext.intersphinx",
"sphinx.ext.todo",
"sphinx.ext.mathjax",
"sphinx.ext.githubpages",
]
templates_path = ["_templates"]
source_suffix = ".rst"
master_doc = "index"
project = "ODRI Firmware for CAN"
copyright = "2021, Max Planck Gesellsch... | true | true |
f725a9a56796d9cae327f43226b54d5c38fbe39b | 312 | py | Python | language_bar/language_bar.py | lxgreen/wm | ae38e9ab280147f568e1dcbc54bdda908ab9f97c | [
"MIT"
] | null | null | null | language_bar/language_bar.py | lxgreen/wm | ae38e9ab280147f568e1dcbc54bdda908ab9f97c | [
"MIT"
] | null | null | null | language_bar/language_bar.py | lxgreen/wm | ae38e9ab280147f568e1dcbc54bdda908ab9f97c | [
"MIT"
] | null | null | null | #!/usr/bin/python
import subprocess
def main():
layout_map = {"us":"EN", "il":"HE", "ru":"RU"}
layout = subprocess.Popen("/home/lxgreen/scripts/wm"
"/language_bar/xkb-switch",
stdout=subprocess.PIPE).stdout.read()
print layout_map[layout[:2]]
if __name__ == '__main__':
main()
| 22.285714 | 56 | 0.61859 |
import subprocess
def main():
layout_map = {"us":"EN", "il":"HE", "ru":"RU"}
layout = subprocess.Popen("/home/lxgreen/scripts/wm"
"/language_bar/xkb-switch",
stdout=subprocess.PIPE).stdout.read()
print layout_map[layout[:2]]
if __name__ == '__main__':
main()
| false | true |
f725a9c6f543a4459d5a893dca60433b20e32993 | 4,539 | py | Python | sort.py | sagittarian/personal-sort | c7875141b4e15173e4a4a2267a23ff8236e6d729 | [
"MIT"
] | null | null | null | sort.py | sagittarian/personal-sort | c7875141b4e15173e4a4a2267a23ff8236e6d729 | [
"MIT"
] | null | null | null | sort.py | sagittarian/personal-sort | c7875141b4e15173e4a4a2267a23ff8236e6d729 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
'''A simple implementation of a sorting algorithm, meant to allow
people to manually rank a list of items using whatever subjective or
objective criteria they want.
This program can be called as a script and used interactively. You
can provide the list of things to sort as command line argument... | 28.192547 | 72 | 0.548579 |
from functools import cmp_to_key
class memoize:
def __init__(self, func):
self.func = func
self.cache = {}
def __call__(self, *args):
key = tuple(args)
if key not in self.cache:
self.cache[key] = self.func(*args)
return self.cache[key]
@memoize
def cmpfu... | true | true |
f725a9f9f6417c88c9e26be77336dc65fc531a7b | 1,577 | py | Python | preprocessing/homography_converter/uNetXST_homographies/2_F.py | LimJiaJing/Cam2BEV | 8177e13f7a3662daee28cce62f35b85f500941c0 | [
"MIT"
] | 335 | 2020-05-11T07:24:01.000Z | 2022-03-31T08:14:22.000Z | preprocessing/homography_converter/uNetXST_homographies/2_F.py | hoanganhpham1006/Cam2BEV | f788a9f58b464bc7b114e5a0dd1afcd6683f10e3 | [
"MIT"
] | 23 | 2020-07-12T23:42:31.000Z | 2022-03-26T09:42:01.000Z | preprocessing/homography_converter/uNetXST_homographies/2_F.py | hoanganhpham1006/Cam2BEV | f788a9f58b464bc7b114e5a0dd1afcd6683f10e3 | [
"MIT"
] | 63 | 2020-05-11T16:27:56.000Z | 2022-03-17T17:11:18.000Z | # ==============================================================================
# MIT License
#
# Copyright 2020 Institute for Automotive Engineering of RWTH Aachen University.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "S... | 50.870968 | 213 | 0.698795 |
import numpy as np
H = [
np.array([[0.03506686613905922, 27.971438297785962, -0.17694724954191404], [0.3821882391578238, 9.481642330993019e-17, 5.46222110929461], [25.000001047737943, 6.202207287472715e-15, 27.000001047737943]])
]
| true | true |
f725ab2fdd412236541d778007d38e8624e6c5f3 | 1,105 | py | Python | gcloud/periodictask/apps.py | springborland/bk-sops | a9057672c10efb5f2414a805a30ead4092429c76 | [
"Apache-2.0"
] | 1 | 2021-05-19T04:31:34.000Z | 2021-05-19T04:31:34.000Z | gcloud/periodictask/apps.py | sighttviewliu/bk-sops | 6bf2f38bd93990f20f7c3a4decafc310e09e679c | [
"Apache-2.0"
] | null | null | null | gcloud/periodictask/apps.py | sighttviewliu/bk-sops | 6bf2f38bd93990f20f7c3a4decafc310e09e679c | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2020 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 40.925926 | 115 | 0.755656 |
from django.apps import AppConfig
class PeriodicTaskConfig(AppConfig):
name = "gcloud.periodictask"
verbose_name = "GcloudPeriodicTask"
def ready(self):
from .signals.handlers import (
pre_periodic_task_start_handler,
periodic_task_history_post_save_handler,
... | true | true |
f725abd59251190289dabcf79ac0661b33697890 | 1,839 | py | Python | alembic/versions/4f53ec506661_add_study_template.py | jonathanzong/dmca | 70157cff983310e5951024aa80e99e7a5404d758 | [
"MIT"
] | 2 | 2022-02-16T22:50:06.000Z | 2022-02-21T19:38:02.000Z | alembic/versions/4f53ec506661_add_study_template.py | jonathanzong/dmca | 70157cff983310e5951024aa80e99e7a5404d758 | [
"MIT"
] | 2 | 2022-02-01T05:48:07.000Z | 2022-02-01T05:49:29.000Z | alembic/versions/4f53ec506661_add_study_template.py | jonathanzong/bartleby | 70157cff983310e5951024aa80e99e7a5404d758 | [
"MIT"
] | null | null | null | """add study template
Revision ID: 4f53ec506661
Revises: 4302608638bc
Create Date: 2018-05-23 15:44:01.450488
"""
# revision identifiers, used by Alembic.
revision = '4f53ec506661'
down_revision = '4302608638bc'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade(engi... | 28.292308 | 125 | 0.712887 |
revision = '4f53ec506661'
down_revision = '4302608638bc'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade(engine_name):
globals()["upgrade_%s" % engine_name]()
def downgrade(engine_name):
globals()["downgrade_%s" % engine_name]()
def upgrade_developme... | true | true |
f725acb2361d7d3cd6f93696255dbd053911f91e | 18,253 | py | Python | iotbx/regression/tst_map_model_manager_3.py | TiankunZhou/cctbx_project | 373f302f00c12d7239f8e37e3165e62bc1d852cc | [
"BSD-3-Clause-LBNL"
] | null | null | null | iotbx/regression/tst_map_model_manager_3.py | TiankunZhou/cctbx_project | 373f302f00c12d7239f8e37e3165e62bc1d852cc | [
"BSD-3-Clause-LBNL"
] | null | null | null | iotbx/regression/tst_map_model_manager_3.py | TiankunZhou/cctbx_project | 373f302f00c12d7239f8e37e3165e62bc1d852cc | [
"BSD-3-Clause-LBNL"
] | null | null | null | from __future__ import absolute_import, division, print_function
from cctbx.array_family import flex
import os, sys
from libtbx.utils import Sorry
from libtbx.test_utils import approx_equal
from mmtbx.model import manager as model_manager
from iotbx.data_manager import DataManager
def exercise(file_name, out = sys.std... | 38.027083 | 92 | 0.718402 | from __future__ import absolute_import, division, print_function
from cctbx.array_family import flex
import os, sys
from libtbx.utils import Sorry
from libtbx.test_utils import approx_equal
from mmtbx.model import manager as model_manager
from iotbx.data_manager import DataManager
def exercise(file_name, out = sys.std... | true | true |
f725ad5a075727936af4a26120e61b5c25cd3bc9 | 193,257 | py | Python | backend/mips_to_c/src/translate.py | Rainchus/decomp.me | 607aab29a18656dcbc0443505ef2944c10afa085 | [
"MIT"
] | null | null | null | backend/mips_to_c/src/translate.py | Rainchus/decomp.me | 607aab29a18656dcbc0443505ef2944c10afa085 | [
"MIT"
] | null | null | null | backend/mips_to_c/src/translate.py | Rainchus/decomp.me | 607aab29a18656dcbc0443505ef2944c10afa085 | [
"MIT"
] | null | null | null | import abc
from collections import defaultdict
from contextlib import contextmanager
from dataclasses import dataclass, field, replace
import math
import struct
import sys
import traceback
import typing
from typing import (
AbstractSet,
Callable,
Collection,
DefaultDict,
Dict,
Iterator,
List... | 38.14032 | 131 | 0.598064 | import abc
from collections import defaultdict
from contextlib import contextmanager
from dataclasses import dataclass, field, replace
import math
import struct
import sys
import traceback
import typing
from typing import (
AbstractSet,
Callable,
Collection,
DefaultDict,
Dict,
Iterator,
List... | true | true |
f725ad7f8cee325b6f43a8b62288b6b7f43cee75 | 2,727 | py | Python | ibis/backends/clickhouse/tests/test_types.py | GrapeBaBa/ibis | 507bb14efdcfd719a0487ee23fe1c85c177517f6 | [
"Apache-2.0"
] | 1 | 2015-11-05T15:40:12.000Z | 2015-11-05T15:40:12.000Z | ibis/backends/clickhouse/tests/test_types.py | GrapeBaBa/ibis | 507bb14efdcfd719a0487ee23fe1c85c177517f6 | [
"Apache-2.0"
] | 7 | 2021-09-02T21:18:10.000Z | 2022-01-31T12:03:40.000Z | ibis/backends/clickhouse/tests/test_types.py | GrapeBaBa/ibis | 507bb14efdcfd719a0487ee23fe1c85c177517f6 | [
"Apache-2.0"
] | null | null | null | import pytest
from pkg_resources import parse_version
import ibis.expr.datatypes as dt
from ibis.backends.clickhouse.client import ClickhouseDataType
def test_column_types(alltypes):
df = alltypes.execute()
assert df.tinyint_col.dtype.name == 'int8'
assert df.smallint_col.dtype.name == 'int16'
assert... | 41.953846 | 76 | 0.635497 | import pytest
from pkg_resources import parse_version
import ibis.expr.datatypes as dt
from ibis.backends.clickhouse.client import ClickhouseDataType
def test_column_types(alltypes):
df = alltypes.execute()
assert df.tinyint_col.dtype.name == 'int8'
assert df.smallint_col.dtype.name == 'int16'
assert... | true | true |
f725adf48debebf7012aabc4bd719b3c1bf15fb2 | 13,130 | py | Python | torchreid/data_manager/cuhk03.py | phoenix1712/deep-person-reid | 8537a9d94b31cbf85e475bd115bb2714086f9be0 | [
"MIT"
] | 11 | 2019-01-10T08:03:31.000Z | 2020-10-23T03:14:23.000Z | torchreid/data_manager/cuhk03.py | xinshengwang/deep-person-reid | 70365320f5319e180d7fce4993003382b06906b0 | [
"MIT"
] | 1 | 2020-11-13T08:20:53.000Z | 2021-01-12T23:06:55.000Z | torchreid/data_manager/cuhk03.py | xinshengwang/deep-person-reid | 70365320f5319e180d7fce4993003382b06906b0 | [
"MIT"
] | 8 | 2019-03-05T09:12:54.000Z | 2022-02-05T06:21:21.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import glob
import re
import sys
import urllib
import tarfile
import zipfile
import os.path as osp
from scipy.io import loadmat
import numpy as np
import h5py
from scipy.misc import imsave
from torch... | 46.560284 | 127 | 0.6131 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import glob
import re
import sys
import urllib
import tarfile
import zipfile
import os.path as osp
from scipy.io import loadmat
import numpy as np
import h5py
from scipy.misc import imsave
from torch... | true | true |
f725ae061cedbfc0818ee7c7320e4bbe82b540ad | 62,902 | py | Python | pandas/core/groupby/generic.py | selasley/pandas | 5b5574520dba1e79ac95e5079724a41151c20b9a | [
"BSD-3-Clause"
] | null | null | null | pandas/core/groupby/generic.py | selasley/pandas | 5b5574520dba1e79ac95e5079724a41151c20b9a | [
"BSD-3-Clause"
] | null | null | null | pandas/core/groupby/generic.py | selasley/pandas | 5b5574520dba1e79ac95e5079724a41151c20b9a | [
"BSD-3-Clause"
] | null | null | null | """
Define the SeriesGroupBy and DataFrameGroupBy
classes that hold the groupby interfaces (and some implementations).
These are user facing as the result of the ``df.groupby(...)`` operations,
which here returns a DataFrameGroupBy object.
"""
from __future__ import annotations
from collections import abc
from functo... | 34.204459 | 88 | 0.555833 | from __future__ import annotations
from collections import abc
from functools import partial
from textwrap import dedent
from typing import (
Any,
Callable,
Hashable,
Iterable,
Mapping,
NamedTuple,
Sequence,
TypeVar,
Union,
cast,
)
import warnings
import numpy as np
from panda... | true | true |
f725aeade897e373631ced4d97f1f6a440b377d9 | 1,600 | py | Python | utils/runner/optimizer/builder.py | UESTC-Liuxin/CVMI_Sementic_Segmentation | dc5bf6e940cf6961ef65abb6e7ec372f29d55249 | [
"Apache-2.0"
] | null | null | null | utils/runner/optimizer/builder.py | UESTC-Liuxin/CVMI_Sementic_Segmentation | dc5bf6e940cf6961ef65abb6e7ec372f29d55249 | [
"Apache-2.0"
] | null | null | null | utils/runner/optimizer/builder.py | UESTC-Liuxin/CVMI_Sementic_Segmentation | dc5bf6e940cf6961ef65abb6e7ec372f29d55249 | [
"Apache-2.0"
] | null | null | null | '''
Author: Liu Xin
Date: 2021-11-21 18:10:58
LastEditors: Liu Xin
LastEditTime: 2021-11-21 21:38:30
Description: file content
FilePath: /CVMI_Sementic_Segmentation/utils/runner/optimizer/builder.py
'''
import copy
import inspect
import torch
from utils.registry import Registry, build
OPTIMIZERS = Registry('optimizer'... | 30.188679 | 73 | 0.683125 | import copy
import inspect
import torch
from utils.registry import Registry, build
OPTIMIZERS = Registry('optimizer')
OPTIMIZER_BUILDERS = Registry('optimizer builder')
def register_torch_optimizers():
torch_optimizers = []
for module_name in dir(torch.optim):
if module_name.startswith('__'):
... | true | true |
f725afde370dd3d08133a4a847cf11682d4bc65e | 30 | py | Python | py_yahoo/__init__.py | satheshrgs/py_yahoo | c18d680a9c75bb28364b95ada8b4dead0302d6ed | [
"MIT"
] | null | null | null | py_yahoo/__init__.py | satheshrgs/py_yahoo | c18d680a9c75bb28364b95ada8b4dead0302d6ed | [
"MIT"
] | null | null | null | py_yahoo/__init__.py | satheshrgs/py_yahoo | c18d680a9c75bb28364b95ada8b4dead0302d6ed | [
"MIT"
] | null | null | null | from .py_yahoo import YWeather | 30 | 30 | 0.866667 | from .py_yahoo import YWeather | true | true |
f725b02ef1848fb30f10583d1d0ba4ed093eebfa | 878 | py | Python | examples/demo1/main.py | Layto888/laylib-1.0.1 | c7317c29659a476adf6e90eb729b09ce4c49e219 | [
"MIT"
] | 1 | 2018-08-04T14:44:42.000Z | 2018-08-04T14:44:42.000Z | examples/demo1/main.py | Layto888/laylib-1.0 | c7317c29659a476adf6e90eb729b09ce4c49e219 | [
"MIT"
] | null | null | null | examples/demo1/main.py | Layto888/laylib-1.0 | c7317c29659a476adf6e90eb729b09ce4c49e219 | [
"MIT"
] | null | null | null | """
Demo 01 Made with python and pygame
to test and improve the laylib-pygame framework for fast game prototyping.
----
Author: Amardjia Amine
Date: 20/10/18
Github: ---
- This demo shows how the Resources manager loads and
separates the different data and their associated variables.
All resources are ... | 22.512821 | 75 | 0.632118 |
from laylib import Environment
from engine import Engine
import sys
def main():
demo = Environment(
800,
600,
False,
'2D Demo'
)
demo.load_complete(Engine(), '../data')
demo.gInstance.main_loop()
demo.destroy()
... | true | true |
f725b0a65f050af516439f7b25d526190cc56ff4 | 15,585 | py | Python | mpunet/callbacks/callbacks.py | sandeepsinghsengar/MPUNet2Plus | fd97800cd349ee47d2c9cce1851a332dcbcb047c | [
"MIT"
] | 156 | 2018-12-19T19:21:30.000Z | 2022-03-10T13:14:52.000Z | mpunet/callbacks/callbacks.py | sandeepsinghsengar/MPUNet2Plus | fd97800cd349ee47d2c9cce1851a332dcbcb047c | [
"MIT"
] | 25 | 2019-07-30T07:45:26.000Z | 2022-02-10T00:38:31.000Z | mpunet/callbacks/callbacks.py | sandeepsinghsengar/MPUNet2Plus | fd97800cd349ee47d2c9cce1851a332dcbcb047c | [
"MIT"
] | 33 | 2019-01-26T16:34:50.000Z | 2022-02-20T13:48:44.000Z | import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import tensorflow as tf
import psutil
import numpy as np
import os
from tensorflow.keras.callbacks import Callback
from datetime import datetime
from mpunet.logging import ScreenLogger
from mpunet.utils.plotting import (imshow_with_label_overlay, i... | 37.019002 | 86 | 0.569714 | import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import tensorflow as tf
import psutil
import numpy as np
import os
from tensorflow.keras.callbacks import Callback
from datetime import datetime
from mpunet.logging import ScreenLogger
from mpunet.utils.plotting import (imshow_with_label_overlay, i... | true | true |
f725b10ac41ecee5ca5b5e982437b8bbd0484e3c | 273 | py | Python | src/password_generator.py | thiamsantos/python-labs | 91262d64b3772526d91db96976f2df77011a2343 | [
"MIT"
] | null | null | null | src/password_generator.py | thiamsantos/python-labs | 91262d64b3772526d91db96976f2df77011a2343 | [
"MIT"
] | null | null | null | src/password_generator.py | thiamsantos/python-labs | 91262d64b3772526d91db96976f2df77011a2343 | [
"MIT"
] | null | null | null | import string
import random
def generate_password():
chars = string.ascii_letters + string.digits + string.punctuation
return ''.join([random.choice(chars) for i in range(0, 15)])
def main():
print(generate_password())
if __name__ == '__main__':
main()
| 19.5 | 69 | 0.692308 | import string
import random
def generate_password():
chars = string.ascii_letters + string.digits + string.punctuation
return ''.join([random.choice(chars) for i in range(0, 15)])
def main():
print(generate_password())
if __name__ == '__main__':
main()
| true | true |
f725b1ae42f7b8692600bca55736971aa629fa7d | 4,921 | py | Python | lib/jnpr/healthbot/swagger/models/rule_schema_formula_min.py | Juniper/healthbot-py-client | 49f0884b5d01ac8430aa7ed4c9acb4e7a2b717a6 | [
"Apache-2.0"
] | 10 | 2019-10-23T12:54:37.000Z | 2022-02-07T19:24:30.000Z | lib/jnpr/healthbot/swagger/models/rule_schema_formula_min.py | Juniper/healthbot-py-client | 49f0884b5d01ac8430aa7ed4c9acb4e7a2b717a6 | [
"Apache-2.0"
] | 5 | 2019-09-30T04:29:25.000Z | 2022-02-16T12:21:06.000Z | lib/jnpr/healthbot/swagger/models/rule_schema_formula_min.py | Juniper/healthbot-py-client | 49f0884b5d01ac8430aa7ed4c9acb4e7a2b717a6 | [
"Apache-2.0"
] | 4 | 2019-09-30T01:17:48.000Z | 2020-08-25T07:27:54.000Z | # coding: utf-8
"""
Paragon Insights APIs
API interface for PI application # noqa: E501
OpenAPI spec version: 4.0.0
Contact: healthbot-feedback@juniper.net
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class RuleSchemaF... | 32.806667 | 186 | 0.59622 |
import pprint
import re
import six
class RuleSchemaFormulaMin(object):
swagger_types = {
'field_name': 'str',
'time_range': 'str'
}
attribute_map = {
'field_name': 'field-name',
'time_range': 'time-range'
}
def __init__(self, field_name=None, time_range=No... | true | true |
f725b253adc761c90bb78171d6e459fcd4106d11 | 5,638 | py | Python | tests/integration/climsoft/controller/test_regkey_controller.py | opencdms/opencdms-api | f1ed6e1d883025a8658746fe457e0c975718c7be | [
"MIT"
] | 3 | 2020-12-01T09:25:18.000Z | 2022-02-14T23:57:34.000Z | tests/integration/climsoft/controller/test_regkey_controller.py | opencdms/opencdms-api | f1ed6e1d883025a8658746fe457e0c975718c7be | [
"MIT"
] | 11 | 2021-12-05T10:09:00.000Z | 2022-02-17T08:11:22.000Z | tests/integration/climsoft/controller/test_regkey_controller.py | opencdms/opencdms-api | f1ed6e1d883025a8658746fe457e0c975718c7be | [
"MIT"
] | 2 | 2021-03-10T19:03:05.000Z | 2021-12-11T08:36:04.000Z | import json
import pytest
from sqlalchemy.sql import text as sa_text
from sqlalchemy.orm.session import sessionmaker
from opencdms.models.climsoft import v4_1_1_core as climsoft_models
from apps.climsoft.db.engine import db_engine
from apps.climsoft.schemas import regkey_schema
from datagen.climsoft import regkey as cl... | 37.586667 | 118 | 0.707166 | import json
import pytest
from sqlalchemy.sql import text as sa_text
from sqlalchemy.orm.session import sessionmaker
from opencdms.models.climsoft import v4_1_1_core as climsoft_models
from apps.climsoft.db.engine import db_engine
from apps.climsoft.schemas import regkey_schema
from datagen.climsoft import regkey as cl... | true | true |
f725b3453489b66fbfc7b49799e450b8abfbfc00 | 11,264 | py | Python | deployer/src/config_creator.py | yugabyte/docsearch-scraper | 8b58d364c7721cbce892843e946834a3ccc5fcd7 | [
"MIT"
] | null | null | null | deployer/src/config_creator.py | yugabyte/docsearch-scraper | 8b58d364c7721cbce892843e946834a3ccc5fcd7 | [
"MIT"
] | null | null | null | deployer/src/config_creator.py | yugabyte/docsearch-scraper | 8b58d364c7721cbce892843e946834a3ccc5fcd7 | [
"MIT"
] | 1 | 2020-04-01T22:01:17.000Z | 2020-04-01T22:01:17.000Z | from collections import OrderedDict
import tldextract
import re
from . import helpers
from . import helpdesk_helper
from urllib.parse import urlparse
def extract_root_from_input(input_string):
# We cant parse the url since user might have not enter a proper link
# We assume that the string is already the pro... | 34.552147 | 110 | 0.532404 | from collections import OrderedDict
import tldextract
import re
from . import helpers
from . import helpdesk_helper
from urllib.parse import urlparse
def extract_root_from_input(input_string):
if input_string.endswith('/'):
return input_string
domain = re.match(".+?([^/]/(?!/))",
... | true | true |
f725b3e77a5288c1d9314ff987b54ca1c859daff | 46,076 | py | Python | tests/plugins/test_reactor_config.py | MartinBasti/atomic-reactor | 4431225c5a474c7f88c63ec1f25216d4b84a0f1d | [
"BSD-3-Clause"
] | null | null | null | tests/plugins/test_reactor_config.py | MartinBasti/atomic-reactor | 4431225c5a474c7f88c63ec1f25216d4b84a0f1d | [
"BSD-3-Clause"
] | null | null | null | tests/plugins/test_reactor_config.py | MartinBasti/atomic-reactor | 4431225c5a474c7f88c63ec1f25216d4b84a0f1d | [
"BSD-3-Clause"
] | null | null | null | """
Copyright (c) 2017 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import unicode_literals
from jsonschema import ValidationError
import io
import logging
import os
import pkg_resources
import... | 35.092155 | 100 | 0.532924 | from __future__ import unicode_literals
from jsonschema import ValidationError
import io
import logging
import os
import pkg_resources
import pytest
from textwrap import dedent
import re
import yaml
import smtplib
from copy import deepcopy
import atomic_reactor
import koji
from atomic_reactor.core import DockerTasker... | true | true |
f725b47e46e1f08db69cea2aabe9aacaac375090 | 1,044 | py | Python | scripts/create_playlist.py | Spotify-Open-Recommendation-Engine/spotify-open-recommendation-engine | 9417d8d45f662f3ca6337d599b4a91d932df2fed | [
"MIT"
] | 1 | 2021-12-10T08:08:20.000Z | 2021-12-10T08:08:20.000Z | scripts/create_playlist.py | Spotify-Open-Recommendation-Engine/spotify-open-recommendation-engine | 9417d8d45f662f3ca6337d599b4a91d932df2fed | [
"MIT"
] | 3 | 2021-11-07T00:40:49.000Z | 2021-11-30T03:29:17.000Z | scripts/create_playlist.py | Spotify-Open-Recommendation-Engine/spotify-open-recommendation-engine | 9417d8d45f662f3ca6337d599b4a91d932df2fed | [
"MIT"
] | 1 | 2021-12-10T08:08:14.000Z | 2021-12-10T08:08:14.000Z | """
create_playlist.py
creates a playlist in user librabry and returns the playlist id
parameters: auth, list of tracks to add
"""
import spotipy
from spotipy.oauth2 import SpotifyOAuth
from .spotifyoauth import get_token
from ..common import session
def create_playlist(name, songs):
#get token
session[... | 30.705882 | 138 | 0.694444 | import spotipy
from spotipy.oauth2 import SpotifyOAuth
from .spotifyoauth import get_token
from ..common import session
def create_playlist(name, songs):
session['token_info'], authorized = get_token()
if authorized:
sp = spotipy.Spotify(auth=session.get('token_info').get('access_token')... | true | true |
f725b4e6f7ed90c7f9aa29ca91d0ae4c5bd280a2 | 183 | py | Python | tests/configs/config_for_test.py | akamaus/picograd | fe3a377806d3abd389a59d48981123c569c0e545 | [
"MIT"
] | null | null | null | tests/configs/config_for_test.py | akamaus/picograd | fe3a377806d3abd389a59d48981123c569c0e545 | [
"MIT"
] | null | null | null | tests/configs/config_for_test.py | akamaus/picograd | fe3a377806d3abd389a59d48981123c569c0e545 | [
"MIT"
] | null | null | null | from picograd.configs.base import BaseConfig
class Config(BaseConfig):
def __init__(self, **kwargs):
self.a = 2
self.b = None
super().__init__(**kwargs)
| 20.333333 | 44 | 0.628415 | from picograd.configs.base import BaseConfig
class Config(BaseConfig):
def __init__(self, **kwargs):
self.a = 2
self.b = None
super().__init__(**kwargs)
| true | true |
f725b4f6bffa7492d249043f68f18a216407ef16 | 1,145 | py | Python | scripts-master/python/MCSingleFile.py | HanLabBU/Trace-conditioning-hippocampus | 960e4b4d92e42697649b9b9a684ecf9c4cbb79f6 | [
"Apache-2.0"
] | null | null | null | scripts-master/python/MCSingleFile.py | HanLabBU/Trace-conditioning-hippocampus | 960e4b4d92e42697649b9b9a684ecf9c4cbb79f6 | [
"Apache-2.0"
] | null | null | null | scripts-master/python/MCSingleFile.py | HanLabBU/Trace-conditioning-hippocampus | 960e4b4d92e42697649b9b9a684ecf9c4cbb79f6 | [
"Apache-2.0"
] | null | null | null | '''
Script to motion correct a single multipage .tif stack using the Python Tif Motion Correction (ptmc) package
Requires ptmc, PIL and their dependencies
'''
from ptmc import io
from ptmc import processing as pro
from PIL import Image
import numpy as np
if __name__ == "__main__":
#Full Processing without I/O ta... | 38.166667 | 108 | 0.70131 |
from ptmc import io
from ptmc import processing as pro
from PIL import Image
import numpy as np
if __name__ == "__main__":
imgstack, fileparts = io.loadImageStack()
medstack = pro.doMedianFilter(imgstack, med_fsize=3)
homomorphstack = pro.doHomomorphicFilter(medstack, sigmaVal=7)
homosh... | true | true |
f725b57fcbeafb739b268af3654544d0b94e7b35 | 980 | py | Python | prj/api/views.py | rendrom/django-dynamit | 4280da60212ffd9ad6a8cb96a7eba0890a98fee5 | [
"MIT"
] | 3 | 2015-01-20T18:43:16.000Z | 2015-12-09T06:46:55.000Z | prj/api/views.py | rendrom/django-dynamit | 4280da60212ffd9ad6a8cb96a7eba0890a98fee5 | [
"MIT"
] | null | null | null | prj/api/views.py | rendrom/django-dynamit | 4280da60212ffd9ad6a8cb96a7eba0890a98fee5 | [
"MIT"
] | null | null | null | from prj.api import serializers, permissions, authenticators
from rest_framework.views import APIView
from django.contrib.auth.models import User
from rest_framework.response import Response
from rest_framework import viewsets
from django.contrib.auth import login, logout
from rest_framework.permissions import AllowAny... | 32.666667 | 71 | 0.743878 | from prj.api import serializers, permissions, authenticators
from rest_framework.views import APIView
from django.contrib.auth.models import User
from rest_framework.response import Response
from rest_framework import viewsets
from django.contrib.auth import login, logout
from rest_framework.permissions import AllowAny... | true | true |
f725b5d9ea2e0f39b32bd5e6e8f910abfce3039b | 7,348 | py | Python | tensorflow_datasets/structured/htru2.py | jedlimlx/datasets | dffdc800d3d1f5c39f311f35de3530487153d335 | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/structured/htru2.py | jedlimlx/datasets | dffdc800d3d1f5c39f311f35de3530487153d335 | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/structured/htru2.py | jedlimlx/datasets | dffdc800d3d1f5c39f311f35de3530487153d335 | [
"Apache-2.0"
] | null | null | null | """Dataset for Predicting a Pulsar Star"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow_datasets.public_api as tfds
import tensorflow as tf
import os
_CITATION = """\
@article{10.1093/mnras/stw656,
author = {Lyon, R. J. and Stappe... | 56.523077 | 1,490 | 0.69951 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow_datasets.public_api as tfds
import tensorflow as tf
import os
_CITATION = """\
@article{10.1093/mnras/stw656,
author = {Lyon, R. J. and Stappers, B. W. and Cooper, S. and Brooke, J. M. ... | true | true |
f725b98098001c143ac1f1d06ba793a9900a5629 | 4,010 | py | Python | test/mitmproxy/io/test_protobuf.py | asfaltboy/mitmproxy | f245d247674b0d7c7cca327cd2be5a0bcf01b27d | [
"MIT"
] | 7 | 2020-11-29T11:42:44.000Z | 2022-03-28T15:31:38.000Z | test/mitmproxy/io/test_protobuf.py | asfaltboy/mitmproxy | f245d247674b0d7c7cca327cd2be5a0bcf01b27d | [
"MIT"
] | 7 | 2020-06-16T06:35:02.000Z | 2022-03-15T20:15:53.000Z | test/mitmproxy/io/test_protobuf.py | asfaltboy/mitmproxy | f245d247674b0d7c7cca327cd2be5a0bcf01b27d | [
"MIT"
] | 1 | 2021-08-31T05:02:59.000Z | 2021-08-31T05:02:59.000Z | import pytest
from mitmproxy import certs
from mitmproxy import http
from mitmproxy import exceptions
from mitmproxy.test import tflow, tutils
from mitmproxy.io import protobuf
class TestProtobuf:
def test_roundtrip_client(self):
c = tflow.tclient_conn()
del c.reply
c.rfile = None
... | 33.140496 | 85 | 0.638903 | import pytest
from mitmproxy import certs
from mitmproxy import http
from mitmproxy import exceptions
from mitmproxy.test import tflow, tutils
from mitmproxy.io import protobuf
class TestProtobuf:
def test_roundtrip_client(self):
c = tflow.tclient_conn()
del c.reply
c.rfile = None
... | true | true |
f725baf4c670c00b71a89f3aa043b3ec06944a52 | 530 | py | Python | AI DIET PLANNER Microservice/website/migrations/0011_auto_20201208_0103.py | ricksaha2000/MedBay-V1 | ee8ead4c3583066c778dc76ed0749feb70f412c8 | [
"MIT"
] | null | null | null | AI DIET PLANNER Microservice/website/migrations/0011_auto_20201208_0103.py | ricksaha2000/MedBay-V1 | ee8ead4c3583066c778dc76ed0749feb70f412c8 | [
"MIT"
] | null | null | null | AI DIET PLANNER Microservice/website/migrations/0011_auto_20201208_0103.py | ricksaha2000/MedBay-V1 | ee8ead4c3583066c778dc76ed0749feb70f412c8 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.3 on 2020-12-07 19:33
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('website', '0010_auto_20201120_2052'),
]
operations = [
migrations.AlterField(
model_name='profile',
name='image',
... | 27.894737 | 194 | 0.615094 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('website', '0010_auto_20201120_2052'),
]
operations = [
migrations.AlterField(
model_name='profile',
name='image',
field=models.ImageField(default='C:\\... | true | true |
f725bb2c710b888e594d6f958fc334d74efebf61 | 10,916 | py | Python | lib/ContigFilter_mlee/ContigFilter_mleeImpl.py | mollee55/ContigFilter | fa57051bab1c4c4d2341ecdcef9bb14955ed0a1d | [
"MIT"
] | null | null | null | lib/ContigFilter_mlee/ContigFilter_mleeImpl.py | mollee55/ContigFilter | fa57051bab1c4c4d2341ecdcef9bb14955ed0a1d | [
"MIT"
] | null | null | null | lib/ContigFilter_mlee/ContigFilter_mleeImpl.py | mollee55/ContigFilter | fa57051bab1c4c4d2341ecdcef9bb14955ed0a1d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#BEGIN_HEADER
# The header block is where all import statments should live
import logging
import os
from pprint import pformat
from Bio import SeqIO
from installed_clients.AssemblyUtilClient import AssemblyUtil
from installed_clients.KBaseReportClient import KBaseReport
#END_HEADER
class Con... | 43.49004 | 109 | 0.620282 |
import logging
import os
from pprint import pformat
from Bio import SeqIO
from installed_clients.AssemblyUtilClient import AssemblyUtil
from installed_clients.KBaseReportClient import KBaseReport
class ContigFilter_mlee:
idation is still important.
logging.info('Validating parameters.')
if ... | true | true |
f725bb3c0b460966653fe516ad1697e8a427a136 | 481 | py | Python | shiSock-0.3.0/test/test_one_unsecure/t2.py | AnanyaRamanA/shiSock | 51efb0eba17eb106b9480598d278536ddd7732c3 | [
"MIT"
] | null | null | null | shiSock-0.3.0/test/test_one_unsecure/t2.py | AnanyaRamanA/shiSock | 51efb0eba17eb106b9480598d278536ddd7732c3 | [
"MIT"
] | null | null | null | shiSock-0.3.0/test/test_one_unsecure/t2.py | AnanyaRamanA/shiSock | 51efb0eba17eb106b9480598d278536ddd7732c3 | [
"MIT"
] | 1 | 2021-10-31T13:47:42.000Z | 2021-10-31T13:47:42.000Z | from PySock import client
def abc(data,con):
print(f"Message from {data['sender_name']} : {data['data']}")
con.SEND("test","Hurrah! it's working.")
def client_msg(data):
print(f"Message from : {data['sender_name']} => {data['data']}")
c = client(client_name = "swat", debug = True)
c.CLIENT("localhost",88... | 30.0625 | 68 | 0.64657 | from PySock import client
def abc(data,con):
print(f"Message from {data['sender_name']} : {data['data']}")
con.SEND("test","Hurrah! it's working.")
def client_msg(data):
print(f"Message from : {data['sender_name']} => {data['data']}")
c = client(client_name = "swat", debug = True)
c.CLIENT("localhost",88... | true | true |
f725bb9042591218ea998eef0a3d5cf5dc021084 | 19,126 | py | Python | ultracart/models/order_format.py | UltraCart/rest_api_v2_sdk_python | d734ea13fabc7a57872ff68bac06861edb8fd882 | [
"Apache-2.0"
] | 1 | 2018-03-15T16:56:23.000Z | 2018-03-15T16:56:23.000Z | ultracart/models/order_format.py | UltraCart/rest_api_v2_sdk_python | d734ea13fabc7a57872ff68bac06861edb8fd882 | [
"Apache-2.0"
] | null | null | null | ultracart/models/order_format.py | UltraCart/rest_api_v2_sdk_python | d734ea13fabc7a57872ff68bac06861edb8fd882 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
UltraCart Rest API V2
UltraCart REST API Version 2 # noqa: E501
OpenAPI spec version: 2.0.0
Contact: support@ultracart.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class OrderFormat(object):
... | 35.158088 | 466 | 0.664645 |
import pprint
import re
import six
class OrderFormat(object):
swagger_types = {
'context': 'str',
'dont_link_email_to_search': 'bool',
'email_as_link': 'bool',
'filter_distribution_center_oid': 'int',
'filter_to_items_in_contact_oid': 'int',
'format': 'str',... | true | true |
f725bbab055480c19d9e0e8d0883d64f3353823b | 666 | py | Python | circle_and_dock.py | skullydazed/PyRoombaAdapter | 88824e91b0f0cec008b16cfaa5a62a6546f1226e | [
"MIT"
] | null | null | null | circle_and_dock.py | skullydazed/PyRoombaAdapter | 88824e91b0f0cec008b16cfaa5a62a6546f1226e | [
"MIT"
] | null | null | null | circle_and_dock.py | skullydazed/PyRoombaAdapter | 88824e91b0f0cec008b16cfaa5a62a6546f1226e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
Pull forward a few cm, spin around, dock.
"""
from math import radians
from time import sleep
from pyroombaadapter import PyRoombaAdapter
PORT = "/dev/ttyUSB0"
adapter = PyRoombaAdapter(PORT)
adapter.change_mode_to_safe()
# Warn people we're coming
adapter.send_song_cmd(0, 9,
... | 19.028571 | 59 | 0.660661 |
from math import radians
from time import sleep
from pyroombaadapter import PyRoombaAdapter
PORT = "/dev/ttyUSB0"
adapter = PyRoombaAdapter(PORT)
adapter.change_mode_to_safe()
adapter.send_song_cmd(0, 9,
[69, 69, 69, 65, 72, 69, 65, 72, 69],
[40, 40, 40, 30, 10, 40, 30, ... | true | true |
f725bde4462ccc899cd0ce48915de444be82f7e8 | 21,890 | py | Python | source/graph_3D_surface.py | yux1991/PyRHEED | b39ad03651c92e3649069919ae48b1e5158cd3dd | [
"MIT"
] | 14 | 2019-01-08T14:32:31.000Z | 2021-11-17T21:07:10.000Z | source/graph_3D_surface.py | yux1991/PyRHEED | b39ad03651c92e3649069919ae48b1e5158cd3dd | [
"MIT"
] | 2 | 2019-05-14T08:56:36.000Z | 2020-12-22T16:44:30.000Z | source/graph_3D_surface.py | yux1991/PyRHEED | b39ad03651c92e3649069919ae48b1e5158cd3dd | [
"MIT"
] | 4 | 2019-03-12T20:03:54.000Z | 2022-03-08T14:24:46.000Z | from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT as NavigationToolbar
from PyQt5 import QtCore, QtGui, QtWidgets, QtDataVisualization
import math
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas... | 49.301802 | 142 | 0.685381 | from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT as NavigationToolbar
from PyQt5 import QtCore, QtGui, QtWidgets, QtDataVisualization
import math
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas... | true | true |
f725bee9770f6b2e7f8623f5101b820360ca8b9e | 3,329 | py | Python | src/build_workflow/build_recorder.py | Rishikesh1159/opensearch-build | 9f402afe9c945c9b715a69e94cbf0137bfbcd8b7 | [
"Apache-2.0"
] | null | null | null | src/build_workflow/build_recorder.py | Rishikesh1159/opensearch-build | 9f402afe9c945c9b715a69e94cbf0137bfbcd8b7 | [
"Apache-2.0"
] | null | null | null | src/build_workflow/build_recorder.py | Rishikesh1159/opensearch-build | 9f402afe9c945c9b715a69e94cbf0137bfbcd8b7 | [
"Apache-2.0"
] | null | null | null | # SPDX-License-Identifier: Apache-2.0
#
# The OpenSearch Contributors require contributions made to
# this file be licensed under the Apache-2.0 license or a
# compatible open source license.
import logging
import os
import shutil
from build_workflow.build_artifact_checks import BuildArtifactChecks
from manifests.bui... | 36.184783 | 112 | 0.620907 |
import logging
import os
import shutil
from build_workflow.build_artifact_checks import BuildArtifactChecks
from manifests.build_manifest import BuildManifest
class BuildRecorder:
def __init__(self, target):
self.build_manifest = self.BuildManifestBuilder(target)
self.target = target
... | true | true |
f725bf0dff062fe048d70f6120efa6e9747d1111 | 15,159 | py | Python | StaticAnalysis/dockerfile_info2/Parser/static_parser.py | FaniD/SecureWilly | f929f94c6a778b2527e493edbc7309cf10e616e0 | [
"Apache-2.0"
] | 9 | 2019-03-11T22:57:14.000Z | 2021-12-14T13:04:09.000Z | StaticAnalysis/dockerfile_info2/Parser/static_parser.py | FaniD/Security-on-Docker | f929f94c6a778b2527e493edbc7309cf10e616e0 | [
"Apache-2.0"
] | null | null | null | StaticAnalysis/dockerfile_info2/Parser/static_parser.py | FaniD/Security-on-Docker | f929f94c6a778b2527e493edbc7309cf10e616e0 | [
"Apache-2.0"
] | 1 | 2021-01-30T15:23:01.000Z | 2021-01-30T15:23:01.000Z | #!/usr/bin/env python
import io
import sys
from collections import OrderedDict
current_dir = "dockerfileinfo2"
current_dir = current_dir.lower()
pwd = "/home/ubuntu/SecureWilly/StaticAnalysis/dockerfile_info2/Parser"
pre_pwd = "/home/ubuntu/SecureWilly/StaticAnalysis/dockerfile_info2"
#This will be our preliminery p... | 38.474619 | 468 | 0.605779 |
import io
import sys
from collections import OrderedDict
current_dir = "dockerfileinfo2"
current_dir = current_dir.lower()
pwd = "/home/ubuntu/SecureWilly/StaticAnalysis/dockerfile_info2/Parser"
pre_pwd = "/home/ubuntu/SecureWilly/StaticAnalysis/dockerfile_info2"
static_profile = []
file_rule = '\tfile, #All... | false | true |
f725bf9e067d8091eae026f29cdbe029061aaa52 | 492 | py | Python | leetcode/_27.py | simonzhang0428/LeetCode | 7daee7572d8235a34071aa831452ed5d0e93d947 | [
"Apache-2.0"
] | 2 | 2021-07-09T23:22:25.000Z | 2021-07-27T23:15:52.000Z | leetcode/_27.py | simonzhang0428/LeetCode | 7daee7572d8235a34071aa831452ed5d0e93d947 | [
"Apache-2.0"
] | null | null | null | leetcode/_27.py | simonzhang0428/LeetCode | 7daee7572d8235a34071aa831452ed5d0e93d947 | [
"Apache-2.0"
] | null | null | null | """
idx 0 1 2 3 val = 3 -> ret 2, [2, 2]
elm 2 2 2 3
i
idx
i: all elements to the left hand side of i (including) are the result to return
j: current index to scan whole input array
res = 0
"""
class Solution:
def removeElement(self, nums: List[int], val: int)... | 25.894737 | 79 | 0.481707 | class Solution:
def removeElement(self, nums: List[int], val: int) -> int:
idx = 0
for i in range(len(nums)):
if nums[i] != val:
nums[idx] = nums[i]
idx += 1
return idx
| true | true |
f725c0b724d8f884150602fbe330761c2b73e84f | 576 | py | Python | quiz/migrations/0013_tester.py | Rakesh10021997/UBF_backend | 354942bb708f669211674f5a327ac8eafe1584df | [
"MIT"
] | null | null | null | quiz/migrations/0013_tester.py | Rakesh10021997/UBF_backend | 354942bb708f669211674f5a327ac8eafe1584df | [
"MIT"
] | null | null | null | quiz/migrations/0013_tester.py | Rakesh10021997/UBF_backend | 354942bb708f669211674f5a327ac8eafe1584df | [
"MIT"
] | null | null | null | # Generated by Django 2.2 on 2020-10-07 13:04
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('quiz', '0012_quiz_answerkey'),
]
operations = [
migrations.CreateModel(
name='Tester',
fields=[
('id',... | 26.181818 | 114 | 0.578125 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('quiz', '0012_quiz_answerkey'),
]
operations = [
migrations.CreateModel(
name='Tester',
fields=[
('id', models.AutoField(auto_created=True, primary_... | true | true |
f725c116b568bd7ea26a4fe0e7a8944cb0a5794f | 252 | py | Python | Assignment 2/13.Dictionary.py | poojavaibhavsahu/Pooja_Python | 58122bfa8586883145042b11fe1cc013c803ab4f | [
"bzip2-1.0.6"
] | null | null | null | Assignment 2/13.Dictionary.py | poojavaibhavsahu/Pooja_Python | 58122bfa8586883145042b11fe1cc013c803ab4f | [
"bzip2-1.0.6"
] | null | null | null | Assignment 2/13.Dictionary.py | poojavaibhavsahu/Pooja_Python | 58122bfa8586883145042b11fe1cc013c803ab4f | [
"bzip2-1.0.6"
] | null | null | null | size=int(input("enter size="))
dict1={}
for i in range(1,size+1):
subjects = input("enter subjects=")
marks = int(input("enter marks="))
dict1[subjects]=marks
print(dict1)
for subjects,marks in dict1.items():
print(subjects,"=",marks)
| 25.2 | 39 | 0.65873 | size=int(input("enter size="))
dict1={}
for i in range(1,size+1):
subjects = input("enter subjects=")
marks = int(input("enter marks="))
dict1[subjects]=marks
print(dict1)
for subjects,marks in dict1.items():
print(subjects,"=",marks)
| true | true |
f725c1908ba5d833377d25ff6bb9702e9e24329f | 2,983 | py | Python | python/tvm/runtime/object.py | jheo4/incubator-tvm | c4c61cb766608fb2f0fd8c9facc480a43afed3f5 | [
"Apache-2.0"
] | 4 | 2018-01-09T07:35:33.000Z | 2021-04-20T05:52:50.000Z | python/tvm/runtime/object.py | jheo4/incubator-tvm | c4c61cb766608fb2f0fd8c9facc480a43afed3f5 | [
"Apache-2.0"
] | 1 | 2020-04-17T10:53:14.000Z | 2020-04-17T10:53:14.000Z | python/tvm/runtime/object.py | jheo4/incubator-tvm | c4c61cb766608fb2f0fd8c9facc480a43afed3f5 | [
"Apache-2.0"
] | 3 | 2020-12-10T23:21:18.000Z | 2020-12-11T01:04:50.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... | 33.144444 | 89 | 0.686222 |
import ctypes
from tvm._ffi.base import _FFI_MODE, _RUNTIME_ONLY, check_call, _LIB, c_str
from . import _ffi_api, _ffi_node_api
try:
if _FFI_MODE == "ctypes":
raise ImportError()
from tvm._ffi._cy3.core import _set_class_object, _set_class_object_generic
from tvm._ffi._cy3.co... | true | true |
f725c257cf9a811b1104a4abcf2cefc06d1747df | 1,212 | py | Python | app/views/schemas.py | KaiserBloo/memegen | ee757e916aa37176a6562021cee9bb0ce0bdad0d | [
"MIT"
] | null | null | null | app/views/schemas.py | KaiserBloo/memegen | ee757e916aa37176a6562021cee9bb0ce0bdad0d | [
"MIT"
] | null | null | null | app/views/schemas.py | KaiserBloo/memegen | ee757e916aa37176a6562021cee9bb0ce0bdad0d | [
"MIT"
] | null | null | null | from dataclasses import dataclass
from datetime import datetime
@dataclass
class AuthResponse:
email: str
image_access: bool
search_access: bool
created: datetime
modified: datetime
@dataclass
class FontResponse:
filename: str
id: str
alias: str
_self: str
@dataclass
class Meme... | 13.318681 | 33 | 0.664191 | from dataclasses import dataclass
from datetime import datetime
@dataclass
class AuthResponse:
email: str
image_access: bool
search_access: bool
created: datetime
modified: datetime
@dataclass
class FontResponse:
filename: str
id: str
alias: str
_self: str
@dataclass
class Meme... | true | true |
f725c299e78ae93819633c99b0ca91ef4159c618 | 159 | py | Python | reviewboard/changedescs/evolutions/__init__.py | clach04/reviewboard | 994e5cbcb7709bf2de851d5ecd261d64a4091f26 | [
"MIT"
] | 1 | 2015-09-11T15:50:17.000Z | 2015-09-11T15:50:17.000Z | reviewboard/changedescs/evolutions/__init__.py | clach04/reviewboard | 994e5cbcb7709bf2de851d5ecd261d64a4091f26 | [
"MIT"
] | null | null | null | reviewboard/changedescs/evolutions/__init__.py | clach04/reviewboard | 994e5cbcb7709bf2de851d5ecd261d64a4091f26 | [
"MIT"
] | null | null | null | from django.conf import settings
SEQUENCE = []
if settings.DATABASES['default']['ENGINE'].endswith('mysql'):
SEQUENCE.append('fields_changed_longtext')
| 19.875 | 61 | 0.742138 | from django.conf import settings
SEQUENCE = []
if settings.DATABASES['default']['ENGINE'].endswith('mysql'):
SEQUENCE.append('fields_changed_longtext')
| true | true |
f725c3671a76f70791f2bc04f5876fb34af22787 | 2,075 | py | Python | examples/market_radio.py | mnovikov1/cryptology-ws-client-python | 2ff019637854d5f92c1151065c939bc85df17cda | [
"MIT"
] | null | null | null | examples/market_radio.py | mnovikov1/cryptology-ws-client-python | 2ff019637854d5f92c1151065c939bc85df17cda | [
"MIT"
] | null | null | null | examples/market_radio.py | mnovikov1/cryptology-ws-client-python | 2ff019637854d5f92c1151065c939bc85df17cda | [
"MIT"
] | 4 | 2019-04-29T10:12:00.000Z | 2019-11-18T10:00:43.000Z | import asyncio
import cryptology
import logging
import os
from aiohttp import WSServerHandshakeError
from datetime import datetime
from decimal import Decimal
from pathlib import Path
from typing import Optional
SERVER = os.getenv('SERVER', 'wss://marketdata.cryptology.com')
NAME = Path(__file__).stem
logging.basicC... | 34.583333 | 108 | 0.654458 | import asyncio
import cryptology
import logging
import os
from aiohttp import WSServerHandshakeError
from datetime import datetime
from decimal import Decimal
from pathlib import Path
from typing import Optional
SERVER = os.getenv('SERVER', 'wss://marketdata.cryptology.com')
NAME = Path(__file__).stem
logging.basicC... | true | true |
f725c3bd2b571aa08f3545969b2bc56209e7455d | 93 | py | Python | pyshiki/__init__.py | vadyur/PyShiki | e6a678056d46b15969af64895911ae0a2df4df69 | [
"MIT"
] | null | null | null | pyshiki/__init__.py | vadyur/PyShiki | e6a678056d46b15969af64895911ae0a2df4df69 | [
"MIT"
] | null | null | null | pyshiki/__init__.py | vadyur/PyShiki | e6a678056d46b15969af64895911ae0a2df4df69 | [
"MIT"
] | 1 | 2021-04-12T18:48:38.000Z | 2021-04-12T18:48:38.000Z | #!/usr/bin/env python3
#-*- coding: UTF-8 -*-
from .shikimoriapi import *
__all__ = ['Api'] | 15.5 | 27 | 0.623656 |
from .shikimoriapi import *
__all__ = ['Api'] | true | true |
f725c440dafb3649fab82e15f86d026ee595aa5b | 2,771 | py | Python | src/formattedcode/format_json.py | chetanya-shrimali/scancode-toolkit | a1a22fb225cbeb211bd6f92272a46f1351f57d6b | [
"Apache-2.0",
"CC0-1.0"
] | null | null | null | src/formattedcode/format_json.py | chetanya-shrimali/scancode-toolkit | a1a22fb225cbeb211bd6f92272a46f1351f57d6b | [
"Apache-2.0",
"CC0-1.0"
] | null | null | null | src/formattedcode/format_json.py | chetanya-shrimali/scancode-toolkit | a1a22fb225cbeb211bd6f92272a46f1351f57d6b | [
"Apache-2.0",
"CC0-1.0"
] | null | null | null | #
# Copyright (c) 2017 nexB Inc. and others. All rights reserved.
# http://nexb.com and https://github.com/nexB/scancode-toolkit/
# The ScanCode software is licensed under the Apache License version 2.0.
# Data generated with ScanCode require an acknowledgment.
# ScanCode is a trademark of nexB Inc.
#
# You may not use... | 39.028169 | 114 | 0.74161 |
from __future__ import absolute_import
from __future__ import unicode_literals
from collections import OrderedDict
import simplejson
from plugincode.output import scan_output_writer
@scan_output_writer
def write_json_compact(files_count, version, notice, scanned_files, options, output_file... | true | true |
f725c4a8a7481af6a704ce6b7c4c8af37084a931 | 7,084 | py | Python | clrnet/models/necks/fpn.py | Turoad/CLRNet | 51e082db12973943bddefd76fd0d431fcb3350ff | [
"Apache-2.0"
] | 18 | 2022-03-16T07:29:19.000Z | 2022-03-31T07:05:37.000Z | clrnet/models/necks/fpn.py | Turoad/CLRNet | 51e082db12973943bddefd76fd0d431fcb3350ff | [
"Apache-2.0"
] | 1 | 2022-03-16T11:47:13.000Z | 2022-03-17T10:15:25.000Z | clrnet/models/necks/fpn.py | Turoad/CLRNet | 51e082db12973943bddefd76fd0d431fcb3350ff | [
"Apache-2.0"
] | 1 | 2022-03-25T14:49:58.000Z | 2022-03-25T14:49:58.000Z | import warnings
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import ConvModule
from ..registry import NECKS
@NECKS.register_module
class FPN(nn.Module):
def __init__(self,
in_channels,
out_channels,
num_outs,
... | 42.166667 | 79 | 0.511011 | import warnings
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import ConvModule
from ..registry import NECKS
@NECKS.register_module
class FPN(nn.Module):
def __init__(self,
in_channels,
out_channels,
num_outs,
... | true | true |
f725c51873bca756304f94c52f620a6f9fb9ab38 | 44,255 | py | Python | pdb2sql/StructureSimilarity.py | DarioMarzella/pdb2sql | 64d5d4f27fb67a0ff41221bcd27667237048bb3f | [
"Apache-2.0"
] | null | null | null | pdb2sql/StructureSimilarity.py | DarioMarzella/pdb2sql | 64d5d4f27fb67a0ff41221bcd27667237048bb3f | [
"Apache-2.0"
] | null | null | null | pdb2sql/StructureSimilarity.py | DarioMarzella/pdb2sql | 64d5d4f27fb67a0ff41221bcd27667237048bb3f | [
"Apache-2.0"
] | null | null | null | import warnings
import numpy as np
from .pdb2sqlcore import pdb2sql
from .interface import interface
from .superpose import get_trans_vect, get_rotation_matrix, superpose_selection
from . import transform
import os
import pickle
class StructureSimilarity(object):
def __init__(self, decoy, ref, verbose=False, en... | 34.709804 | 135 | 0.538199 | import warnings
import numpy as np
from .pdb2sqlcore import pdb2sql
from .interface import interface
from .superpose import get_trans_vect, get_rotation_matrix, superpose_selection
from . import transform
import os
import pickle
class StructureSimilarity(object):
def __init__(self, decoy, ref, verbose=False, en... | true | true |
f725c56e6e6be2a0459699cdaa700720c868b2bf | 1,319 | py | Python | yad_uploader/loggers.py | RuzzyRullezz/yad_uploader | 9a37e3b5f50365d6e105519043b71a6014ebef4f | [
"MIT"
] | null | null | null | yad_uploader/loggers.py | RuzzyRullezz/yad_uploader | 9a37e3b5f50365d6e105519043b71a6014ebef4f | [
"MIT"
] | null | null | null | yad_uploader/loggers.py | RuzzyRullezz/yad_uploader | 9a37e3b5f50365d6e105519043b71a6014ebef4f | [
"MIT"
] | null | null | null | import sys
import logging
import socket
from typing import List
import telegram_log.handler
from yad_uploader.arguments import Arguments
def configure_logger(logger: logging.Logger, tg_token: str, tg_chat_ids: List[str]):
logger.setLevel(logging.DEBUG)
host_name = socket.gethostname()
log_format = '%(as... | 32.170732 | 112 | 0.751327 | import sys
import logging
import socket
from typing import List
import telegram_log.handler
from yad_uploader.arguments import Arguments
def configure_logger(logger: logging.Logger, tg_token: str, tg_chat_ids: List[str]):
logger.setLevel(logging.DEBUG)
host_name = socket.gethostname()
log_format = '%(as... | true | true |
f725c5e76c999a9a4e9b18abb24d8c6a364d2b89 | 33 | py | Python | 9-days-of-code/day-5/03 Spaces.py | jaredliw/mcc-python-solutions | f54b1d2a044788b2adc1eb19a490422eb92ffe77 | [
"MIT"
] | 2 | 2021-04-09T04:03:39.000Z | 2021-04-09T04:18:28.000Z | 9-days-of-code/day-5/03 Spaces.py | jaredliw/mcc-python-solutions | f54b1d2a044788b2adc1eb19a490422eb92ffe77 | [
"MIT"
] | null | null | null | 9-days-of-code/day-5/03 Spaces.py | jaredliw/mcc-python-solutions | f54b1d2a044788b2adc1eb19a490422eb92ffe77 | [
"MIT"
] | null | null | null | print("second = hour * 60 * 60")
| 16.5 | 32 | 0.575758 | print("second = hour * 60 * 60")
| true | true |
f725c62d71cda0c7e9a85c8d2794317378633651 | 2,261 | py | Python | tests/test_uploads.py | Irdroid/httpie | ca36f1de04310de644857ebbea9c94984971ab7c | [
"BSD-3-Clause"
] | 2 | 2015-06-27T05:40:27.000Z | 2015-06-27T11:55:23.000Z | tests/test_uploads.py | 915546302/httpie | ca36f1de04310de644857ebbea9c94984971ab7c | [
"BSD-3-Clause"
] | null | null | null | tests/test_uploads.py | 915546302/httpie | ca36f1de04310de644857ebbea9c94984971ab7c | [
"BSD-3-Clause"
] | null | null | null | import os
import pytest
from httpie.input import ParseError
from utils import TestEnvironment, http, HTTP_OK
from fixtures import FILE_PATH_ARG, FILE_PATH, FILE_CONTENT
class TestMultipartFormDataFileUpload:
def test_non_existent_file_raises_parse_error(self, httpbin):
with pytest.raises(ParseError):
... | 35.888889 | 79 | 0.621849 | import os
import pytest
from httpie.input import ParseError
from utils import TestEnvironment, http, HTTP_OK
from fixtures import FILE_PATH_ARG, FILE_PATH, FILE_CONTENT
class TestMultipartFormDataFileUpload:
def test_non_existent_file_raises_parse_error(self, httpbin):
with pytest.raises(ParseError):
... | true | true |
f725c69d3932aaf715b9909a1b07cb3239f9f34f | 62 | py | Python | datasets/__init__.py | revsic/tf-speech-dataset | 93a3ce2574616a3a52d2ac99af9826af680dda8f | [
"MIT"
] | 1 | 2021-07-10T14:21:23.000Z | 2021-07-10T14:21:23.000Z | datasets/__init__.py | revsic/tf-speech-dataset | 93a3ce2574616a3a52d2ac99af9826af680dda8f | [
"MIT"
] | null | null | null | datasets/__init__.py | revsic/tf-speech-dataset | 93a3ce2574616a3a52d2ac99af9826af680dda8f | [
"MIT"
] | null | null | null | from .ljspeech import LJSpeech
from .reader import DataReader
| 20.666667 | 30 | 0.83871 | from .ljspeech import LJSpeech
from .reader import DataReader
| true | true |
f725c72c140425c7fa0f49c67ec4ca25c4dee0ad | 816 | py | Python | cli/polyaxon/proxies/schemas/robots.py | polyaxon/cli | 3543c0220a8a7c06fc9573cd2a740f8ae4930641 | [
"Apache-2.0"
] | null | null | null | cli/polyaxon/proxies/schemas/robots.py | polyaxon/cli | 3543c0220a8a7c06fc9573cd2a740f8ae4930641 | [
"Apache-2.0"
] | 1 | 2022-01-24T11:26:47.000Z | 2022-03-18T23:17:58.000Z | cli/polyaxon/proxies/schemas/robots.py | polyaxon/cli | 3543c0220a8a7c06fc9573cd2a740f8ae4930641 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2018-2022 Polyaxon, 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 ... | 29.142857 | 74 | 0.741422 |
from polyaxon.proxies.schemas.base import get_config
OPTIONS = """
location = /robots.txt {{
rewrite ^ /static/robots.txt;
}}
"""
def get_robots_config():
return get_config(options=OPTIONS, indent=0)
| true | true |
f725c8ca4f1ea80a992f2dcedcd958469830ff26 | 4,170 | py | Python | azure-mgmt-servicebus/azure/mgmt/servicebus/operations/premium_messaging_regions_operations.py | jmalobicky/azure-sdk-for-python | 61234a3d83f8fb481d1dd2386e54e888864878fd | [
"MIT"
] | 1 | 2018-07-23T08:59:24.000Z | 2018-07-23T08:59:24.000Z | azure-mgmt-servicebus/azure/mgmt/servicebus/operations/premium_messaging_regions_operations.py | jmalobicky/azure-sdk-for-python | 61234a3d83f8fb481d1dd2386e54e888864878fd | [
"MIT"
] | null | null | null | azure-mgmt-servicebus/azure/mgmt/servicebus/operations/premium_messaging_regions_operations.py | jmalobicky/azure-sdk-for-python | 61234a3d83f8fb481d1dd2386e54e888864878fd | [
"MIT"
] | 1 | 2018-08-28T14:36:47.000Z | 2018-08-28T14:36:47.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 ... | 40.882353 | 144 | 0.642446 |
import uuid
from msrest.pipeline import ClientRawResponse
from .. import models
class PremiumMessagingRegionsOperations(object):
models = models
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deseria... | true | true |
f725c9059a48acf58bb83c5eced787cdd333b41d | 16,484 | py | Python | python_modules/dagster-graphql/dagster_graphql_tests/graphql/snapshots/snap_test_environment_schema.py | Andrew-Crosby/dagster | e646625a687dc656bdd855d88b868de957b37b62 | [
"Apache-2.0"
] | 1 | 2021-07-03T09:05:58.000Z | 2021-07-03T09:05:58.000Z | python_modules/dagster-graphql/dagster_graphql_tests/graphql/snapshots/snap_test_environment_schema.py | Andrew-Crosby/dagster | e646625a687dc656bdd855d88b868de957b37b62 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster-graphql/dagster_graphql_tests/graphql/snapshots/snap_test_environment_schema.py | Andrew-Crosby/dagster | e646625a687dc656bdd855d88b868de957b37b62 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# snapshottest: v1 - https://goo.gl/zC4yUc
from __future__ import unicode_literals
from snapshottest import Snapshot
snapshots = Snapshot()
snapshots['TestEnvironmentSchema.test_basic_invalid_config_on_run_config_schema[non_launchable_in_memory_instance_lazy_repository] 1'] = {
'runConfig... | 54.582781 | 788 | 0.521354 |
from __future__ import unicode_literals
from snapshottest import Snapshot
snapshots = Snapshot()
snapshots['TestEnvironmentSchema.test_basic_invalid_config_on_run_config_schema[non_launchable_in_memory_instance_lazy_repository] 1'] = {
'runConfigSchemaOrError': {
'isRunConfigValid': {
'__ty... | true | true |
f725c97888414ba89b8b7dc7e429ef5d79ac764f | 2,335 | py | Python | lib/safe_python.py | AjaxVM/hiths-pyweek6 | 6661ddb8b7c75b0788ce41a411838bc28d59d284 | [
"Unlicense"
] | null | null | null | lib/safe_python.py | AjaxVM/hiths-pyweek6 | 6661ddb8b7c75b0788ce41a411838bc28d59d284 | [
"Unlicense"
] | null | null | null | lib/safe_python.py | AjaxVM/hiths-pyweek6 | 6661ddb8b7c75b0788ce41a411838bc28d59d284 | [
"Unlicense"
] | null | null | null | def test_safe(filename, acceptable_functions=[]):
"""tests all the function calls in a file against a set of acceptable ones.
this function also does not allow importing of other modules.
returns True, [] if there are only acceptable function calls,
returns False and a list of bad function ... | 31.133333 | 94 | 0.443683 | def test_safe(filename, acceptable_functions=[]):
text = open(filename, "rU").read()
text.replace("\r", "\n")
while "#" in text:
text = text[0:text.index("#")] +\
text[text.index("\n", text.index("#"))::]
for i in text.split():
if i == "import" or\
i... | true | true |
f725c9a230b27d2955d04d1ff0959892b346bcb4 | 13,044 | py | Python | insights/parsers/tests/test_sctp.py | pombredanne/insights-core | 63d6510ce8b7b96c94fbd568369420ecf38cf2ae | [
"Apache-2.0"
] | 121 | 2017-05-30T20:23:25.000Z | 2022-03-23T12:52:15.000Z | insights/parsers/tests/test_sctp.py | ahitacat/insights-core | 0ba58dbe5edceef0bd4a74c1caf6b826381ccda5 | [
"Apache-2.0"
] | 1,977 | 2017-05-26T14:36:03.000Z | 2022-03-31T10:38:53.000Z | insights/parsers/tests/test_sctp.py | ahitacat/insights-core | 0ba58dbe5edceef0bd4a74c1caf6b826381ccda5 | [
"Apache-2.0"
] | 244 | 2017-05-30T20:22:57.000Z | 2022-03-26T10:09:39.000Z | import doctest
import pytest
from insights.parsers import ParseException, SkipException
from insights.parsers import sctp
from insights.parsers.sctp import SCTPEps
from insights.parsers.sctp import SCTPAsc, SCTPAsc7
from insights.parsers.sctp import SCTPSnmp
from insights.tests import context_wrap
SCTP_EPS_DETAILS = ... | 63.320388 | 613 | 0.627492 | import doctest
import pytest
from insights.parsers import ParseException, SkipException
from insights.parsers import sctp
from insights.parsers.sctp import SCTPEps
from insights.parsers.sctp import SCTPAsc, SCTPAsc7
from insights.parsers.sctp import SCTPSnmp
from insights.tests import context_wrap
SCTP_EPS_DETAILS = ... | true | true |
f725cb42004704deff0df6e504fa3bb2b08c1cc3 | 3,786 | py | Python | tfx/components/schema_gen/executor_test.py | romiosarkar6991/tfx-romio | 0703c1dd037c676e1d438c2e5ce831decfc9eed9 | [
"Apache-2.0"
] | 1 | 2019-10-10T06:06:12.000Z | 2019-10-10T06:06:12.000Z | tfx/components/schema_gen/executor_test.py | romiosarkar6991/tfx-romio | 0703c1dd037c676e1d438c2e5ce831decfc9eed9 | [
"Apache-2.0"
] | null | null | null | tfx/components/schema_gen/executor_test.py | romiosarkar6991/tfx-romio | 0703c1dd037c676e1d438c2e5ce831decfc9eed9 | [
"Apache-2.0"
] | 1 | 2019-10-06T03:39:58.000Z | 2019-10-06T03:39:58.000Z | # Copyright 2019 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 37.485149 | 80 | 0.726889 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import tensorflow as tf
from tfx.components.schema_gen import executor
from tfx.types import standard_artifacts
from tfx.utils import io_utils
class ExecutorTest(tf.test.TestCase):
... | true | true |
f725cc0039395be7b59dace596d9541c0d6016db | 4,406 | py | Python | python_for_web/public/Lib/site-packages/jinja2/meta.py | ServerCetin/hello_python3 | 7cf0807e09c819c690f28ee30758f22355c79115 | [
"MIT"
] | null | null | null | python_for_web/public/Lib/site-packages/jinja2/meta.py | ServerCetin/hello_python3 | 7cf0807e09c819c690f28ee30758f22355c79115 | [
"MIT"
] | null | null | null | python_for_web/public/Lib/site-packages/jinja2/meta.py | ServerCetin/hello_python3 | 7cf0807e09c819c690f28ee30758f22355c79115 | [
"MIT"
] | null | null | null | """Functions that expose information about templates that might be
interesting for introspection.
"""
import typing as t
from . import nodes
from .compiler import CodeGenerator
from .compiler import Frame
if t.TYPE_CHECKING:
from .environment import Environment
class TrackingCodeGenerator(CodeGenerator):
""... | 39.339286 | 82 | 0.648207 | import typing as t
from . import nodes
from .compiler import CodeGenerator
from .compiler import Frame
if t.TYPE_CHECKING:
from .environment import Environment
class TrackingCodeGenerator(CodeGenerator):
def __init__(self, environment: "Environment") -> None:
super().__init__(environment, "<introsp... | true | true |
f725cc62788a18a8035e2f36032fa0d43ceb3487 | 45,696 | py | Python | python/ccxt/coinbasepro.py | springrider/ccxt | 39570694e5cfc9a315a0f05b2d06cf8b1d550c24 | [
"MIT"
] | 1 | 2021-03-31T18:35:43.000Z | 2021-03-31T18:35:43.000Z | python/ccxt/coinbasepro.py | springrider/ccxt | 39570694e5cfc9a315a0f05b2d06cf8b1d550c24 | [
"MIT"
] | null | null | null | python/ccxt/coinbasepro.py | springrider/ccxt | 39570694e5cfc9a315a0f05b2d06cf8b1d550c24 | [
"MIT"
] | 2 | 2021-05-08T04:01:00.000Z | 2022-03-24T04:46:21.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
# -----------------------------------------------------------------------------
try:
basestri... | 40.474756 | 187 | 0.494573 |
ge import Exchange
try:
basestring
except NameError:
basestring = str
import hashlib
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 Ins... | true | true |
f725cc9a4bba65ddba8bae99ff1a3dc410b16b3a | 558 | py | Python | test/functional/test_framework/validaterawtransaction.py | hackverket/bitcoin-abc-bitcore | cc70c0a66b640a1ac59024bac9a314256ed386b2 | [
"MIT"
] | 5 | 2019-07-29T04:12:38.000Z | 2020-07-26T12:02:30.000Z | test/functional/test_framework/validaterawtransaction.py | hackverket/bitcoin-abc-bitcore | cc70c0a66b640a1ac59024bac9a314256ed386b2 | [
"MIT"
] | 5 | 2019-03-04T13:26:23.000Z | 2019-11-15T16:44:19.000Z | test/functional/test_framework/validaterawtransaction.py | hackverket/bitcoin-abc-bitcore | cc70c0a66b640a1ac59024bac9a314256ed386b2 | [
"MIT"
] | 4 | 2019-03-22T04:18:50.000Z | 2019-10-30T20:37:36.000Z | from test_framework.messages import ToHex
from test_framework.util import assert_equal
def check_validaterawtx(node, tx,
has_valid_inputs = True,
is_minable = True,
enough_fee = True, num_errors = 0):
res = node.validaterawtransaction(ToHex(tx))
if enough_fee:
assert(res["txfee"] >= re... | 29.368421 | 63 | 0.689964 | from test_framework.messages import ToHex
from test_framework.util import assert_equal
def check_validaterawtx(node, tx,
has_valid_inputs = True,
is_minable = True,
enough_fee = True, num_errors = 0):
res = node.validaterawtransaction(ToHex(tx))
if enough_fee:
assert(res["txfee"] >= re... | true | true |
f725ccb31e4440e6e4c660392d8237cb3fafb886 | 341 | py | Python | src/box.py | Flantropy/my_pygame_template | ab30f3ac5c11866c0bb7c32dff177d6fb47a6753 | [
"MIT"
] | null | null | null | src/box.py | Flantropy/my_pygame_template | ab30f3ac5c11866c0bb7c32dff177d6fb47a6753 | [
"MIT"
] | null | null | null | src/box.py | Flantropy/my_pygame_template | ab30f3ac5c11866c0bb7c32dff177d6fb47a6753 | [
"MIT"
] | null | null | null | from pygame import Surface
from pygame.sprite import Sprite
class Box(Sprite):
def __init__(self, color, x=0, y=0):
super().__init__()
self.image = Surface((50, 50))
self.rect = self.image.get_rect()
self.rect.x = x
self.rect.y = y
self.color = color
self.im... | 24.357143 | 41 | 0.595308 | from pygame import Surface
from pygame.sprite import Sprite
class Box(Sprite):
def __init__(self, color, x=0, y=0):
super().__init__()
self.image = Surface((50, 50))
self.rect = self.image.get_rect()
self.rect.x = x
self.rect.y = y
self.color = color
self.im... | true | true |
f725cd04c52b8ddabf80aed6a0fab88870068c97 | 507 | py | Python | lamdba_caller.py | Diontsoumas/book-discount-tracker | 19f54a65b388e3d01516b16c6bdbd407bed24327 | [
"MIT"
] | 1 | 2019-04-04T20:48:59.000Z | 2019-04-04T20:48:59.000Z | lamdba_caller.py | Diontsoumas/book-discount-tracker | 19f54a65b388e3d01516b16c6bdbd407bed24327 | [
"MIT"
] | null | null | null | lamdba_caller.py | Diontsoumas/book-discount-tracker | 19f54a65b388e3d01516b16c6bdbd407bed24327 | [
"MIT"
] | null | null | null | import boto3
import json
s3 = boto3.resource('s3')
def lambda_handler(event, context):
bucket = s3.Bucket("diotsoumas-book-tracker-config-files")
sns_client = boto3.client('sns')
arn = "arn:aws:sns:eu-west-1:169367514751:Lamdba-caller"
for obj in bucket.objects.filter():
message = {"s3_key":... | 28.166667 | 65 | 0.635108 | import boto3
import json
s3 = boto3.resource('s3')
def lambda_handler(event, context):
bucket = s3.Bucket("diotsoumas-book-tracker-config-files")
sns_client = boto3.client('sns')
arn = "arn:aws:sns:eu-west-1:169367514751:Lamdba-caller"
for obj in bucket.objects.filter():
message = {"s3_key":... | true | true |
f725ce2222bf3ae065c946c1c55958e57ddb15fb | 405 | py | Python | sra_django_api/sra_django_api/wsgi.py | tflati/ncbi-search | 2f31c57ffb95c2c874b65c03c58edd96eb822dfb | [
"MIT"
] | null | null | null | sra_django_api/sra_django_api/wsgi.py | tflati/ncbi-search | 2f31c57ffb95c2c874b65c03c58edd96eb822dfb | [
"MIT"
] | null | null | null | sra_django_api/sra_django_api/wsgi.py | tflati/ncbi-search | 2f31c57ffb95c2c874b65c03c58edd96eb822dfb | [
"MIT"
] | null | null | null | """
WSGI config for sra_django_api project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANG... | 23.823529 | 78 | 0.792593 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "sra_django_api.settings")
application = get_wsgi_application()
| true | true |
f725cea5e00aa2c09ec45c55521fcde13e1cb507 | 427 | py | Python | healthcareai/__init__.py | vijayphugat/Practice | 7d8560d62a5d6bfa9488526da318973295a25255 | [
"MIT"
] | null | null | null | healthcareai/__init__.py | vijayphugat/Practice | 7d8560d62a5d6bfa9488526da318973295a25255 | [
"MIT"
] | null | null | null | healthcareai/__init__.py | vijayphugat/Practice | 7d8560d62a5d6bfa9488526da318973295a25255 | [
"MIT"
] | null | null | null | from .advanced_supvervised_model_trainer import AdvancedSupervisedModelTrainer
from .supervised_model_trainer import SupervisedModelTrainer
from .datasets import load_diabetes
from .common.csv_loader import load_csv
from .common.file_io_utilities import load_saved_model
__all__ = [
'AdvancedSupervisedModelT... | 30.5 | 79 | 0.796253 | from .advanced_supvervised_model_trainer import AdvancedSupervisedModelTrainer
from .supervised_model_trainer import SupervisedModelTrainer
from .datasets import load_diabetes
from .common.csv_loader import load_csv
from .common.file_io_utilities import load_saved_model
__all__ = [
'AdvancedSupervisedModelT... | true | true |
f725d0c8c26e20e7b4d0e58db66301a09c122ff9 | 1,670 | py | Python | models/model_facebook.py | xyla-io/almacen | 7b7f235dc7939777f971f1b5eadd5621e980c15e | [
"MIT"
] | 2 | 2020-10-15T22:12:17.000Z | 2020-10-26T07:17:17.000Z | models/model_facebook.py | xyla-io/almacen | 7b7f235dc7939777f971f1b5eadd5621e980c15e | [
"MIT"
] | null | null | null | models/model_facebook.py | xyla-io/almacen | 7b7f235dc7939777f971f1b5eadd5621e980c15e | [
"MIT"
] | null | null | null | import sqlalchemy as alchemy
from . import base
from typing import Optional
class FacebookReportTableModel(base.ReportTableModel):
@property
def date_column_name(self) -> str:
return 'date_start'
class FacebookCampaignReportTableModel(FacebookReportTableModel):
@property
def table_name(self) -> str:
... | 30.363636 | 69 | 0.749102 | import sqlalchemy as alchemy
from . import base
from typing import Optional
class FacebookReportTableModel(base.ReportTableModel):
@property
def date_column_name(self) -> str:
return 'date_start'
class FacebookCampaignReportTableModel(FacebookReportTableModel):
@property
def table_name(self) -> str:
... | true | true |
f725d10ada02b65b1f2ceb1eb17fac036e84be42 | 766 | py | Python | auto_auto_archive.py | fairhopeweb/auto-archiver | 67e41b80ceec38b81bd43345a2024a726e1983f0 | [
"MIT"
] | 45 | 2021-02-27T21:52:58.000Z | 2022-03-30T20:13:03.000Z | auto_auto_archive.py | fairhopeweb/auto-archiver | 67e41b80ceec38b81bd43345a2024a726e1983f0 | [
"MIT"
] | 18 | 2021-02-10T15:04:30.000Z | 2022-03-30T09:15:05.000Z | auto_auto_archive.py | fairhopeweb/auto-archiver | 67e41b80ceec38b81bd43345a2024a726e1983f0 | [
"MIT"
] | 15 | 2021-06-12T16:37:46.000Z | 2022-03-29T11:36:03.000Z | import gspread
import subprocess
import argparse
import auto_archive
import datetime
def main():
parser = argparse.ArgumentParser(
description="Automatically use youtube-dl to download media from a Google Sheet")
parser.add_argument("--sheet", action="store", dest="sheet")
args = parser.parse_args... | 23.9375 | 89 | 0.685379 | import gspread
import subprocess
import argparse
import auto_archive
import datetime
def main():
parser = argparse.ArgumentParser(
description="Automatically use youtube-dl to download media from a Google Sheet")
parser.add_argument("--sheet", action="store", dest="sheet")
args = parser.parse_args... | true | true |
f725d191d7ee26a6a4fe4a6ea65ea74b004d9957 | 531 | py | Python | contest/pythonist3/validating-credit-card-number/validating-credit-card-number.py | zeyuanxy/HackerRank | 5194a4af780ece396501c215996685d1be529e73 | [
"MIT"
] | 4 | 2017-01-18T17:51:58.000Z | 2019-10-20T12:14:37.000Z | contest/pythonist3/validating-credit-card-number/validating-credit-card-number.py | zeyuanxy/HackerRank | 5194a4af780ece396501c215996685d1be529e73 | [
"MIT"
] | null | null | null | contest/pythonist3/validating-credit-card-number/validating-credit-card-number.py | zeyuanxy/HackerRank | 5194a4af780ece396501c215996685d1be529e73 | [
"MIT"
] | 8 | 2016-03-14T17:16:59.000Z | 2021-06-26T10:11:33.000Z | # -*- coding: utf-8 -*-
# @Author: Zeyuan Shang
# @Date: 2016-05-13 12:50:43
# @Last Modified by: Zeyuan Shang
# @Last Modified time: 2016-05-13 12:50:54
import re
for i in range(int(raw_input())):
S = raw_input().strip()
pre_match = re.search(r'^[456]\d{3}(-?)\d{4}\1\d{4}\1\d{4}$',S)
if pre_match:
... | 35.4 | 67 | 0.59887 |
import re
for i in range(int(raw_input())):
S = raw_input().strip()
pre_match = re.search(r'^[456]\d{3}(-?)\d{4}\1\d{4}\1\d{4}$',S)
if pre_match:
processed_string = "".join(pre_match.group(0).split('-'))
final_match = re.search(r'(\d)\1{3,}',processed_string)
print 'Invalid' if ... | false | true |
f725d1cbbda0c0bbbabb83ea57b921c1c1a3b239 | 64,981 | py | Python | scripts/category.py | framawiki/pywikibot | 9835260ef5f38ac83d3ce214c7d1abd594bea934 | [
"MIT"
] | null | null | null | scripts/category.py | framawiki/pywikibot | 9835260ef5f38ac83d3ce214c7d1abd594bea934 | [
"MIT"
] | null | null | null | scripts/category.py | framawiki/pywikibot | 9835260ef5f38ac83d3ce214c7d1abd594bea934 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Script to manage categories.
Syntax:
python pwb.py category action [-option]
where action can be one of these
* add - mass-add a category to a list of pages.
* remove - remove category tag from all pages in a category.
* move - move all pag... | 41.815315 | 79 | 0.559256 |
import codecs
import math
import os
import pickle
import re
from operator import methodcaller
from typing import Optional, Set
import pywikibot
from pywikibot import config, pagegenerators
from pywikibot import i18n, textlib
from pywikibot.bot import (
suggest_help,
IntegerOption, StandardOption, Con... | true | true |
f725d27cbdff7297840854931171bd38aad72f40 | 2,668 | py | Python | src/reactive/aodh_handlers.py | javacruft/charm-aodh | bd4d63d7baf1c1af542854ea1acfd936be01e27f | [
"Apache-2.0"
] | 1 | 2016-06-21T16:33:22.000Z | 2016-06-21T16:33:22.000Z | src/reactive/aodh_handlers.py | javacruft/charm-aodh | bd4d63d7baf1c1af542854ea1acfd936be01e27f | [
"Apache-2.0"
] | null | null | null | src/reactive/aodh_handlers.py | javacruft/charm-aodh | bd4d63d7baf1c1af542854ea1acfd936be01e27f | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 Canonical Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 26.156863 | 79 | 0.733883 |
import charms.reactive as reactive
import charmhelpers.core.hookenv as hookenv
# aodh
import charm.openstack.aodh as aodh
# Minimal inferfaces required for operation
MINIMAL_INTERFACES = [
'shared-db.available',
'identity-service.available',
'amqp.available',
]
# use a synthetic state to... | true | true |
f725d3b3f04ef12cb9eabb16862afc6710c21899 | 9,828 | py | Python | userbot/modules/filemanager.py | akihiro69/akihirouserbot | e07da853e0938e40c29366d20ae7e917c215ceb6 | [
"curl"
] | 2 | 2022-03-04T12:25:41.000Z | 2022-03-09T10:06:55.000Z | userbot/modules/filemanager.py | akihiro69/AkihiroProject | 649ac4f8b786a36df25aa3085333940fe7825188 | [
"curl"
] | null | null | null | userbot/modules/filemanager.py | akihiro69/AkihiroProject | 649ac4f8b786a36df25aa3085333940fe7825188 | [
"curl"
] | null | null | null | # Credits to Userge for Remove and Rename
import io
import os
import os.path
import re
import shutil
import time
from datetime import datetime
from os.path import basename, dirname, exists, isdir, isfile, join, relpath
from shutil import rmtree
from tarfile import TarFile, is_tarfile
from zipfile import ZI... | 37.655172 | 88 | 0.50987 |
import io
import os
import os.path
import re
import shutil
import time
from datetime import datetime
from os.path import basename, dirname, exists, isdir, isfile, join, relpath
from shutil import rmtree
from tarfile import TarFile, is_tarfile
from zipfile import ZIP_DEFLATED, BadZipFile, ZipFile, is_zipfil... | true | true |
f725d482affcb8a458620913281844682449d4b0 | 463 | py | Python | virtual/lib/python3.6/site-packages/pylint/test/functional/disable_wrong_import_order.py | drewheathens/The-Moringa-Tribune | 98ee4d63c9df6f1f7497fc6876960a822d914500 | [
"MIT"
] | 69 | 2019-02-18T12:07:35.000Z | 2022-03-12T10:38:32.000Z | virtual/lib/python3.6/site-packages/pylint/test/functional/disable_wrong_import_order.py | drewheathens/The-Moringa-Tribune | 98ee4d63c9df6f1f7497fc6876960a822d914500 | [
"MIT"
] | 32 | 2018-05-01T05:24:43.000Z | 2022-03-11T23:20:39.000Z | virtual/lib/python3.6/site-packages/pylint/test/functional/disable_wrong_import_order.py | drewheathens/The-Moringa-Tribune | 98ee4d63c9df6f1f7497fc6876960a822d914500 | [
"MIT"
] | 28 | 2019-03-22T01:07:13.000Z | 2022-02-21T16:38:27.000Z | """Checks that disabling 'wrong-import-order' on an import prevents subsequent
imports from being considered out-of-order in respect to it but does not prevent
it from being considered for 'ungrouped-imports'."""
# pylint: disable=unused-import,import-error,no-name-in-module
from first_party.foo import bar # pylint: d... | 38.583333 | 80 | 0.803456 |
from first_party.foo import bar
import logging
import os.path
import sys
from astroid import are_exclusive
import first_party
| true | true |
f725d527eca9f1244b658df525134e4894d1750c | 26,199 | py | Python | discord/iterators.py | squaresmile/discord.py | 44d5bafa3d44a0b4de6407727d8d313a55a77662 | [
"MIT"
] | 11,948 | 2015-08-25T00:07:50.000Z | 2022-03-31T23:30:54.000Z | discord/iterators.py | squaresmile/discord.py | 44d5bafa3d44a0b4de6407727d8d313a55a77662 | [
"MIT"
] | 6,163 | 2015-09-03T07:43:30.000Z | 2022-03-31T16:56:47.000Z | discord/iterators.py | squaresmile/discord.py | 44d5bafa3d44a0b4de6407727d8d313a55a77662 | [
"MIT"
] | 6,761 | 2015-08-25T18:44:12.000Z | 2022-03-31T16:45:38.000Z | """
The MIT License (MIT)
Copyright (c) 2015-present Rapptz
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, merg... | 34.746684 | 118 | 0.608802 |
from __future__ import annotations
import asyncio
import datetime
from typing import Awaitable, TYPE_CHECKING, TypeVar, Optional, Any, Callable, Union, List, AsyncIterator
from .errors import NoMoreItems
from .utils import snowflake_time, time_snowflake, maybe_coroutine
from .object import Object
from .audit_logs im... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.