hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f704f458109bda2f6012d3166ddc6ff6686bf0f4 | 12,306 | py | Python | ABLIRC/bin/Basic/Distance2XXX/reads_or_peaks_distribution_relative2xxx.py | ablifedev/ABLIRC | 875278b748a8e22ada2c76c3c76dbf970be4a6a4 | [
"MIT"
] | 1 | 2020-02-25T13:08:20.000Z | 2020-02-25T13:08:20.000Z | ABLIRC/bin/Basic/Distance2XXX/reads_or_peaks_distribution_relative2xxx.py | ablifedev/ABLIRC | 875278b748a8e22ada2c76c3c76dbf970be4a6a4 | [
"MIT"
] | 1 | 2020-02-25T13:16:03.000Z | 2020-02-25T13:16:03.000Z | ABLIRC/bin/Basic/Distance2XXX/reads_or_peaks_distribution_relative2xxx.py | ablifedev/ABLIRC | 875278b748a8e22ada2c76c3c76dbf970be4a6a4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
####################################################################################
### Copyright (C) 2015-2019 by ABLIFE
####################################################################################
#########################################################... | 33.715068 | 232 | 0.42719 | true | true | |
f704f4cd9c7fb1284f93ea1a887f87bdb1ce825e | 408 | py | Python | backend/api/models/__init__.py | Leundai/twanalyze | bfccd9de43fae78e1cbdc0a6695f1cf827a3282b | [
"Apache-2.0"
] | 4 | 2020-10-06T17:15:32.000Z | 2021-06-04T06:07:44.000Z | backend/api/models/__init__.py | Leundai/twanalyze | bfccd9de43fae78e1cbdc0a6695f1cf827a3282b | [
"Apache-2.0"
] | 10 | 2020-10-06T18:23:43.000Z | 2020-10-12T00:26:05.000Z | backend/api/models/__init__.py | Leundai/twanalyze | bfccd9de43fae78e1cbdc0a6695f1cf827a3282b | [
"Apache-2.0"
] | null | null | null | # this file structure follows http://flask.pocoo.org/docs/1.0/patterns/appfactories/
# initializing db in api.models.base instead of in api.__init__.py
# to prevent circular dependencies
from .base import db
from .Email import Email
from .Person import Person
from .VideoInfo import VideoInfo
__all__ = ["db", "Email", ... | 34 | 84 | 0.767157 |
from .base import db
from .Email import Email
from .Person import Person
from .VideoInfo import VideoInfo
__all__ = ["db", "Email", "Person", "VideoInfo"]
| true | true |
f704f52a0332da8f345d14dd4fef2d97a4463857 | 4,181 | py | Python | Scripts/sims4communitylib/classes/interactions/common_interaction_override_name.py | ColonolNutty/Sims4CommunityLibrary | 684f28dc3c7deb4d9fd520e21e63942b65a91d31 | [
"CC-BY-4.0"
] | 118 | 2019-08-31T04:33:18.000Z | 2022-03-28T21:12:14.000Z | Scripts/sims4communitylib/classes/interactions/common_interaction_override_name.py | ColonolNutty/Sims4CommunityLibrary | 684f28dc3c7deb4d9fd520e21e63942b65a91d31 | [
"CC-BY-4.0"
] | 15 | 2019-12-05T01:29:46.000Z | 2022-02-18T17:13:46.000Z | Scripts/sims4communitylib/classes/interactions/common_interaction_override_name.py | ColonolNutty/Sims4CommunityLibrary | 684f28dc3c7deb4d9fd520e21e63942b65a91d31 | [
"CC-BY-4.0"
] | 28 | 2019-09-07T04:11:05.000Z | 2022-02-07T18:31:40.000Z | """
The Sims 4 Community Library is licensed under the Creative Commons Attribution 4.0 International public license (CC BY 4.0).
https://creativecommons.org/licenses/by/4.0/
https://creativecommons.org/licenses/by/4.0/legalcode
Copyright (c) COLONOLNUTTY
"""
from typing import Any, Union
from interactions.base.inter... | 48.057471 | 242 | 0.717771 | from typing import Any, Union
from interactions.base.interaction import Interaction
from interactions.context import InteractionContext
from protocolbuffers.Localization_pb2 import LocalizedString
from sims.sim import Sim
from sims4.utils import flexmethod
from sims4communitylib.logging.has_class_log import HasClassLo... | true | true |
f704f5d9631a52161bb607794d67acaf0b67e1cb | 129,671 | py | Python | tensorflow/contrib/layers/python/layers/layers.py | drothlis/tensorflow | 04c318b69c5b565436cfeeaab1cb7fd5419dde27 | [
"Apache-2.0"
] | 1 | 2017-09-08T04:32:21.000Z | 2017-09-08T04:32:21.000Z | tensorflow/contrib/layers/python/layers/layers.py | drothlis/tensorflow | 04c318b69c5b565436cfeeaab1cb7fd5419dde27 | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/layers/python/layers/layers.py | drothlis/tensorflow | 04c318b69c5b565436cfeeaab1cb7fd5419dde27 | [
"Apache-2.0"
] | 1 | 2017-09-12T19:41:26.000Z | 2017-09-12T19:41:26.000Z | # -*- coding: utf-8 -*-
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Un... | 43.469997 | 95 | 0.672857 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import functools
import os
import six
from tensorflow.contrib.framework.python.ops import add_arg_scope
from tensorflow.contrib.framework.python.ops import variables
from tensorflow.contrib.l... | true | true |
f704f90ac3c9d0634fcdcbb3eca1f502fa10cc71 | 3,596 | py | Python | aa2ua_cube.py | jotelha/smampppp | 729e4733b436e68adfe07bcaa39a47727d0c8dd8 | [
"MIT"
] | 1 | 2022-03-15T17:23:52.000Z | 2022-03-15T17:23:52.000Z | aa2ua_cube.py | jotelha/smampppp | 729e4733b436e68adfe07bcaa39a47727d0c8dd8 | [
"MIT"
] | null | null | null | aa2ua_cube.py | jotelha/smampppp | 729e4733b436e68adfe07bcaa39a47727d0c8dd8 | [
"MIT"
] | 1 | 2018-04-06T11:29:44.000Z | 2018-04-06T11:29:44.000Z | #!/usr/bin/env python
""" Maps point charges obtained by GPAW and HORTON on the original'
' GROMACS topology initially modified by insertHbyList.py """
## jlh 2018/04/02
import ast
import h5py
import ase.io
from ase.io.cube import read_cube_data
import parmed as pmd
from parmed import gromacs
from insertHby... | 44.95 | 87 | 0.682147 |
ort h5py
import ase.io
from ase.io.cube import read_cube_data
import parmed as pmd
from parmed import gromacs
from insertHbyList import insertHbyList
import argparse
def main():
parser = argparse.ArgumentParser(\
description='Converts an all-atom cube file into united-atom'
' representation b... | true | true |
f704fa8cf0c91be4a9dab86662c520f3207e5d08 | 5,352 | py | Python | venv/lib/python3.7/site-packages/colormath/color_diff_matrix.py | rchen2123/ryu | 99400f8c421c1a84b4c7e80dd26224b36ee6d779 | [
"Apache-2.0"
] | null | null | null | venv/lib/python3.7/site-packages/colormath/color_diff_matrix.py | rchen2123/ryu | 99400f8c421c1a84b4c7e80dd26224b36ee6d779 | [
"Apache-2.0"
] | null | null | null | venv/lib/python3.7/site-packages/colormath/color_diff_matrix.py | rchen2123/ryu | 99400f8c421c1a84b4c7e80dd26224b36ee6d779 | [
"Apache-2.0"
] | null | null | null | """
This module contains the formulas for comparing Lab values with matrices
and vectors. The benefit of using NumPy's matrix capabilities is speed. These
calls can be used to efficiently compare large volumes of Lab colors.
"""
import numpy
def delta_e_cie1976(lab_color_vector, lab_color_matrix):
"""
Calcul... | 31.668639 | 116 | 0.604634 |
import numpy
def delta_e_cie1976(lab_color_vector, lab_color_matrix):
return numpy.sqrt(
numpy.sum(numpy.power(lab_color_vector - lab_color_matrix, 2), axis=1))
def delta_e_cie1994(lab_color_vector, lab_color_matrix,
K_L=1, K_C=1, K_H=1, K_1=0.045, K_2=0.015):
C_1 = numpy.sqrt(... | true | true |
f704fab0af522b8019096eec4487783464bda665 | 3,827 | py | Python | IntranetExam.py | capturemathan/Amrita_Intranet_ExamPapers | 8d11b5c9ce8d1641e05d219acfa91b2f5b2b6584 | [
"MIT"
] | null | null | null | IntranetExam.py | capturemathan/Amrita_Intranet_ExamPapers | 8d11b5c9ce8d1641e05d219acfa91b2f5b2b6584 | [
"MIT"
] | null | null | null | IntranetExam.py | capturemathan/Amrita_Intranet_ExamPapers | 8d11b5c9ce8d1641e05d219acfa91b2f5b2b6584 | [
"MIT"
] | null | null | null | import os
import webbrowser
import time
import random
import requests
from bs4 import BeautifulSoup
from prettytable import PrettyTable
from time import sleep
cont = 1
print("Welcome to Qp Bank !")
sleep(1)
print("Crafted with love by Mathan.S")
sleep(1)
print("Ensure your connectivity to Amrita Wifi f... | 29.898438 | 85 | 0.679906 | import os
import webbrowser
import time
import random
import requests
from bs4 import BeautifulSoup
from prettytable import PrettyTable
from time import sleep
cont = 1
print("Welcome to Qp Bank !")
sleep(1)
print("Crafted with love by Mathan.S")
sleep(1)
print("Ensure your connectivity to Amrita Wifi f... | true | true |
f704fb25ca1ed4fdc84a58c5353bd993763a5b53 | 820 | py | Python | amulet/api/history.py | Podshot/Amulet-Core | 678a722daa5e4487d193a7e947ccceacac325fd2 | [
"MIT"
] | null | null | null | amulet/api/history.py | Podshot/Amulet-Core | 678a722daa5e4487d193a7e947ccceacac325fd2 | [
"MIT"
] | null | null | null | amulet/api/history.py | Podshot/Amulet-Core | 678a722daa5e4487d193a7e947ccceacac325fd2 | [
"MIT"
] | null | null | null | from __future__ import annotations
from .data_structures import Stack
from .operation import Operation
class HistoryManager:
def __init__(self):
self.undo_stack: Stack[Operation] = Stack()
self.redo_stack: Stack[Operation] = Stack()
def add_operation(self, operation_instance: Operation):
... | 29.285714 | 59 | 0.702439 | from __future__ import annotations
from .data_structures import Stack
from .operation import Operation
class HistoryManager:
def __init__(self):
self.undo_stack: Stack[Operation] = Stack()
self.redo_stack: Stack[Operation] = Stack()
def add_operation(self, operation_instance: Operation):
... | true | true |
f704fbc9f2528b864b8b22eb0ac9981a1560e438 | 5,522 | py | Python | mainapp/webapp/figures/linechart.py | thomashusebo/inf219-visualize-2d-sensor-data | 87572c46579887fb212fdfb6f413e271edc77bfe | [
"MIT"
] | null | null | null | mainapp/webapp/figures/linechart.py | thomashusebo/inf219-visualize-2d-sensor-data | 87572c46579887fb212fdfb6f413e271edc77bfe | [
"MIT"
] | 43 | 2020-02-14T16:15:15.000Z | 2020-07-14T12:05:09.000Z | mainapp/webapp/figures/linechart.py | thomashusebo/inf219-visualize-2d-sensor-data | 87572c46579887fb212fdfb6f413e271edc77bfe | [
"MIT"
] | null | null | null | import plotly.graph_objects as go
from mainapp.app_settings import cell_length_meter
def getLineChart(
data,
timestamp,
coordinates,
colorScale,
timeline,
color_range,
dragmode=False,
quick_select_range=True,
calibration_time=None,
show_... | 29.216931 | 108 | 0.458892 | import plotly.graph_objects as go
from mainapp.app_settings import cell_length_meter
def getLineChart(
data,
timestamp,
coordinates,
colorScale,
timeline,
color_range,
dragmode=False,
quick_select_range=True,
calibration_time=None,
show_... | true | true |
f704fc4963a514b11f2efd68c503b1d00784b219 | 5,508 | py | Python | tests/sentry/models/test_projectownership.py | AlexWayfer/sentry | ef935cda2b2e960bd602fda590540882d1b0712d | [
"BSD-3-Clause"
] | 1 | 2022-02-09T22:56:49.000Z | 2022-02-09T22:56:49.000Z | tests/sentry/models/test_projectownership.py | AlexWayfer/sentry | ef935cda2b2e960bd602fda590540882d1b0712d | [
"BSD-3-Clause"
] | 6 | 2018-10-19T10:04:23.000Z | 2019-12-09T20:29:12.000Z | tests/sentry/models/test_projectownership.py | AlexWayfer/sentry | ef935cda2b2e960bd602fda590540882d1b0712d | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
from sentry.testutils import TestCase
from sentry.api.fields.actor import Actor
from sentry.models import ProjectOwnership, User, Team
from sentry.models.projectownership import resolve_actors
from sentry.ownership.grammar import Rule, Owner, Matcher, dump_schema
class ProjectO... | 32.210526 | 101 | 0.535766 | from __future__ import absolute_import
from sentry.testutils import TestCase
from sentry.api.fields.actor import Actor
from sentry.models import ProjectOwnership, User, Team
from sentry.models.projectownership import resolve_actors
from sentry.ownership.grammar import Rule, Owner, Matcher, dump_schema
class ProjectO... | true | true |
f704fc910bd0b1ded2564c2c436dd36c7bac1bc0 | 609 | py | Python | Redmi_note9/PUCO_Bob/day_start/show_test_0.py | Lezaza/hotpoor_autoclick_xhs | 52eafad8cce59353a9de5bf6e488e8a2602e5536 | [
"Apache-2.0"
] | 1 | 2021-12-21T10:42:46.000Z | 2021-12-21T10:42:46.000Z | Redmi_note9/PUCO_Bob/day_start/show_test_0.py | 2218084076/hotpoor_autoclick_xhs | a52446ba691ac19e43410a465dc63f940c0e444d | [
"Apache-2.0"
] | 2 | 2021-11-03T11:36:44.000Z | 2021-11-05T07:58:13.000Z | Redmi_note9/PUCO_Bob/day_start/show_test_0.py | 2218084076/hotpoor_autoclick_xhs | a52446ba691ac19e43410a465dc63f940c0e444d | [
"Apache-2.0"
] | 1 | 2021-10-09T10:28:57.000Z | 2021-10-09T10:28:57.000Z | import os
import time
# os.system("adb shell monkey -p com.xingin.xhs -c android.intent.category.LAUNCHER 1")
# os.system("sleep 4")
# os.system("adb shell input tap 1000 150")
# os.system("sleep 2")
# os.system("adb shell input text PUCO")
# os.system("sleep 2")
# os.system("adb shell input tap 1000 150")
# os.system... | 32.052632 | 87 | 0.692939 | import os
import time
for i in range(0,50):
os.system("adb shell input swipe 340 1200 340 400 1000")
os.system("adb shell input swipe 340 600 340 1800 1000")
time.sleep(1)
os.system("adb shell input swipe 340 1400 340 200 1000")
time.sleep(2)
| true | true |
f704ff4f170ca5bfc8ac19a642a71a7b7ae80975 | 4,955 | py | Python | test/test_output.py | keurfonluu/toughio | 1db0600ee5ad1abb5ca858c81c8ac5226c9dbb4f | [
"BSD-3-Clause-LBNL"
] | 21 | 2020-03-05T20:03:58.000Z | 2022-03-14T23:17:42.000Z | test/test_output.py | keurfonluu/toughio | 1db0600ee5ad1abb5ca858c81c8ac5226c9dbb4f | [
"BSD-3-Clause-LBNL"
] | 60 | 2020-02-14T22:53:01.000Z | 2022-03-26T07:24:19.000Z | test/test_output.py | keurfonluu/toughio | 1db0600ee5ad1abb5ca858c81c8ac5226c9dbb4f | [
"BSD-3-Clause-LBNL"
] | 6 | 2020-02-28T08:15:36.000Z | 2022-03-13T23:26:24.000Z | import os
import helpers
import numpy
import pytest
import toughio
write_read = lambda output, writer_kws, reader_kws: helpers.write_read(
"output",
output,
toughio.write_output,
toughio.read_output,
writer_kws=writer_kws,
reader_kws=reader_kws,
)
@pytest.mark.parametrize(
"filename, da... | 28.641618 | 88 | 0.574975 | import os
import helpers
import numpy
import pytest
import toughio
write_read = lambda output, writer_kws, reader_kws: helpers.write_read(
"output",
output,
toughio.write_output,
toughio.read_output,
writer_kws=writer_kws,
reader_kws=reader_kws,
)
@pytest.mark.parametrize(
"filename, da... | true | true |
f70501b6041b222ae4cdc6349c3646848546cf5f | 271 | py | Python | CodeChef_problems/XORAGN/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 165 | 2020-10-03T08:01:11.000Z | 2022-03-31T02:42:08.000Z | CodeChef_problems/XORAGN/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 383 | 2020-10-03T07:39:11.000Z | 2021-11-20T07:06:35.000Z | CodeChef_problems/XORAGN/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 380 | 2020-10-03T08:05:04.000Z | 2022-03-19T06:56:59.000Z | #Question Link
#https://www.codechef.com/problems/XORAGN
t=int(input())
for a0 in range(t):
n=int(input())
a=list(map(int,input().split()))
res=0
for i in a:
res=res^i #xorring all the values present
print(2*res) #doubling the result obtained
| 24.636364 | 49 | 0.645756 |
t=int(input())
for a0 in range(t):
n=int(input())
a=list(map(int,input().split()))
res=0
for i in a:
res=res^i
print(2*res)
| true | true |
f705031b38df3c5a63196a68e3910cb0f10187d4 | 716 | py | Python | control_plotly/utils.py | vincentchoqueuse/python-control-plotly | 5f4f7d354d4de2628ea52a5e544ebeb138d106bc | [
"MIT"
] | 3 | 2021-08-17T19:21:22.000Z | 2021-08-23T17:58:52.000Z | control_plotly/utils.py | vincentchoqueuse/python-control-plotly | 5f4f7d354d4de2628ea52a5e544ebeb138d106bc | [
"MIT"
] | null | null | null | control_plotly/utils.py | vincentchoqueuse/python-control-plotly | 5f4f7d354d4de2628ea52a5e544ebeb138d106bc | [
"MIT"
] | null | null | null | import control as ctl
import numpy as np
def damp(sys,display=False):
pole_list = []
m_list = []
wn_list = []
for pole in sys.pole():
pole = pole.astype(complex) # WTF: the python control "damp" function is buggy due to this missing cast !
if ctl.isctime(sys):
pole_continu... | 24.689655 | 113 | 0.564246 | import control as ctl
import numpy as np
def damp(sys,display=False):
pole_list = []
m_list = []
wn_list = []
for pole in sys.pole():
pole = pole.astype(complex)
if ctl.isctime(sys):
pole_continuous = pole
else:
pole_continuous = np.log(pole)/sys.dt
... | true | true |
f705039b1f57c4a0a916cbfd3c1650721de1f279 | 3,014 | py | Python | airflow/providers/apache/hive/sensors/hive_partition.py | Hartorn/airflow | a79e2d4c4aa105f3fac5ae6a28e29af9cd572407 | [
"Apache-2.0"
] | 3 | 2015-08-25T13:56:44.000Z | 2020-03-21T10:26:58.000Z | airflow/providers/apache/hive/sensors/hive_partition.py | Hartorn/airflow | a79e2d4c4aa105f3fac5ae6a28e29af9cd572407 | [
"Apache-2.0"
] | 37 | 2020-07-21T07:50:02.000Z | 2022-03-29T22:31:28.000Z | airflow/providers/apache/hive/sensors/hive_partition.py | vuppalli/airflow | dfe8337ca2d3ed173d9ecc112938271519792c40 | [
"Apache-2.0"
] | 2 | 2018-07-24T08:54:45.000Z | 2018-08-31T13:41: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... | 40.186667 | 91 | 0.674851 |
from airflow.providers.apache.hive.hooks.hive import HiveMetastoreHook
from airflow.sensors.base_sensor_operator import BaseSensorOperator
from airflow.utils.decorators import apply_defaults
class HivePartitionSensor(BaseSensorOperator):
template_fields = ('schema', 'table', 'partition',)
ui... | true | true |
f7050439ef98c033793027024ec1d306c91c767c | 15,018 | py | Python | metadata-ingestion/src/datahub/ingestion/source/sql_common.py | hmjahle/datahub_upstream | 62d5306a28e0df6b6b67a5f46c01dd508caada60 | [
"Apache-2.0"
] | null | null | null | metadata-ingestion/src/datahub/ingestion/source/sql_common.py | hmjahle/datahub_upstream | 62d5306a28e0df6b6b67a5f46c01dd508caada60 | [
"Apache-2.0"
] | null | null | null | metadata-ingestion/src/datahub/ingestion/source/sql_common.py | hmjahle/datahub_upstream | 62d5306a28e0df6b6b67a5f46c01dd508caada60 | [
"Apache-2.0"
] | null | null | null | import logging
from abc import abstractmethod
from dataclasses import dataclass, field
from typing import Any, Dict, Iterable, List, Optional, Set, Tuple, Type
from urllib.parse import quote_plus
import pydantic
from sqlalchemy import create_engine, inspect
from sqlalchemy.engine.reflection import Inspector
from sqlal... | 35.757143 | 118 | 0.639433 | import logging
from abc import abstractmethod
from dataclasses import dataclass, field
from typing import Any, Dict, Iterable, List, Optional, Set, Tuple, Type
from urllib.parse import quote_plus
import pydantic
from sqlalchemy import create_engine, inspect
from sqlalchemy.engine.reflection import Inspector
from sqlal... | true | true |
f70504c11afdc0157e75d2a01ec110e01f694f06 | 132,215 | py | Python | Lib/test/test_unicode.py | KinkowanWinter/Transcendental-Number-Utilization | 5f6d1d32850ad2cd2d03cc6f796d32ba7876fc39 | [
"PSF-2.0"
] | 7 | 2018-04-12T17:11:04.000Z | 2021-12-02T14:01:47.000Z | Lib/test/test_unicode.py | KinkowanWinter/Transcendental-Number-Utilization | 5f6d1d32850ad2cd2d03cc6f796d32ba7876fc39 | [
"PSF-2.0"
] | 1 | 2021-12-01T08:11:51.000Z | 2021-12-01T08:11:51.000Z | Lib/test/test_unicode.py | KinkowanWinter/Transcendental-Number-Utilization | 5f6d1d32850ad2cd2d03cc6f796d32ba7876fc39 | [
"PSF-2.0"
] | 4 | 2018-04-27T18:03:08.000Z | 2020-04-12T23:14:29.000Z | """ Test script for the Unicode implementation.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import _string
import codecs
import itertools
import operator
import struct
import string
import sys
import unittest
import warnings
from test import support, str... | 45.465956 | 120 | 0.534886 | import _string
import codecs
import itertools
import operator
import struct
import string
import sys
import unittest
import warnings
from test import support, string_tests
def search_function(encoding):
def decode1(input, errors="strict"):
return 42
def encode1(input, errors="strict"):
return... | true | true |
f705051db073657252741e08c08f2ef3c4cd9b70 | 11,317 | py | Python | tools/trove-pylint.py | a4913994/openstack_trove | 3b550048dd1e5841ad0f3295679e0f0b913a5687 | [
"Apache-2.0"
] | 244 | 2015-01-01T12:04:44.000Z | 2022-03-25T23:38:39.000Z | tools/trove-pylint.py | a4913994/openstack_trove | 3b550048dd1e5841ad0f3295679e0f0b913a5687 | [
"Apache-2.0"
] | 6 | 2015-08-18T08:19:10.000Z | 2022-03-05T02:32:36.000Z | tools/trove-pylint.py | a4913994/openstack_trove | 3b550048dd1e5841ad0f3295679e0f0b913a5687 | [
"Apache-2.0"
] | 178 | 2015-01-02T15:16:58.000Z | 2022-03-23T03:30:20.000Z | #!/usr/bin/env python
# Copyright 2016 Tesora, Inc.
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 32.242165 | 85 | 0.567111 |
import fnmatch
import json
from collections import OrderedDict
import io
import os
import re
import sys
from pylint import lint
from pylint.reporters import text
DEFAULT_CONFIG_FILE = "tools/trove-pylint.config"
DEFAULT_IGNORED_FILES = ['trove/tests']
DEFAULT_IGNORED_CODES = []
DEFAULT_IGNORED_MESSAGES ... | true | true |
f7050555bf105b4cac50608f7fef5821912f5697 | 18,791 | py | Python | training_utility/run_pretraining_adapter.py | ai-nikolai/Retrograph-1 | 54bd534d47218ca437c422a1abe5b1e995f55d71 | [
"Apache-2.0"
] | 14 | 2020-06-01T14:22:43.000Z | 2022-02-01T15:46:13.000Z | training_utility/run_pretraining_adapter.py | ai-nikolai/Retrograph-1 | 54bd534d47218ca437c422a1abe5b1e995f55d71 | [
"Apache-2.0"
] | 8 | 2020-12-17T08:23:46.000Z | 2021-11-10T14:59:06.000Z | training_utility/run_pretraining_adapter.py | ai-nikolai/Retrograph-1 | 54bd534d47218ca437c422a1abe5b1e995f55d71 | [
"Apache-2.0"
] | 5 | 2020-06-01T14:21:17.000Z | 2021-10-01T09:47:38.000Z | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 37.961616 | 82 | 0.699164 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from retrograph.modeling import modeling_adapter as modeling
from retrograph.modeling import optimization_adapter as optimization
import tensorflow as tf
flags = tf.flags
FLAGS = flag... | true | true |
f70505938a0336b31ecf199133d778d0e94de7ec | 514 | py | Python | set3/p3_4.py | Felpezs/IPL_2021 | eaef2baec96f16c1486f4ec5af6eff097f81fcd2 | [
"MIT"
] | 1 | 2021-07-08T19:28:06.000Z | 2021-07-08T19:28:06.000Z | set3/p3_4.py | Felpezs/IPL_2021 | eaef2baec96f16c1486f4ec5af6eff097f81fcd2 | [
"MIT"
] | null | null | null | set3/p3_4.py | Felpezs/IPL_2021 | eaef2baec96f16c1486f4ec5af6eff097f81fcd2 | [
"MIT"
] | null | null | null | def lend_money(debts, person, amount):
value = debts.get(person, 0)
quantity = [amount]
if value != 0:
debts[person] = value + quantity
else:
debts[person] = quantity
print(debts)
def amount_owed_by(debts, person):
value = debts.get(person, [0])
out = sum(va... | 21.416667 | 41 | 0.583658 | def lend_money(debts, person, amount):
value = debts.get(person, 0)
quantity = [amount]
if value != 0:
debts[person] = value + quantity
else:
debts[person] = quantity
print(debts)
def amount_owed_by(debts, person):
value = debts.get(person, [0])
out = sum(va... | true | true |
f705065a635806e4fe8266665d0d44bcb7dfdec4 | 914 | py | Python | scratchML/examples/linear_discriminant_analysis.py | TimS-ml/Scratch-ML | 0ea010e2b7ead5f98ba9a0db621cc7d7471e97af | [
"MIT"
] | 4 | 2021-09-18T23:52:10.000Z | 2021-09-25T04:04:10.000Z | scratchML/examples/linear_discriminant_analysis.py | TimS-ml/My-ML-From-Scratch | 0ea010e2b7ead5f98ba9a0db621cc7d7471e97af | [
"MIT"
] | null | null | null | scratchML/examples/linear_discriminant_analysis.py | TimS-ml/My-ML-From-Scratch | 0ea010e2b7ead5f98ba9a0db621cc7d7471e97af | [
"MIT"
] | null | null | null | from __future__ import print_function
from sklearn import datasets
import matplotlib.pyplot as plt
import numpy as np
from scratchML.supervised_learning import LDA
from scratchML.utils import calculate_covariance_matrix, accuracy_score
from scratchML.utils import normalize, standardize, train_test_split, Plot
from scr... | 24.052632 | 77 | 0.712254 | from __future__ import print_function
from sklearn import datasets
import matplotlib.pyplot as plt
import numpy as np
from scratchML.supervised_learning import LDA
from scratchML.utils import calculate_covariance_matrix, accuracy_score
from scratchML.utils import normalize, standardize, train_test_split, Plot
from scr... | true | true |
f70506c4e20561258cf4dc497d8803a8bee3c74e | 1,046 | py | Python | python_modules/libraries/dagster-papertrail/setup.py | bitdotioinc/dagster | 4fe395a37b206b1a48b956fa5dd72bf698104cca | [
"Apache-2.0"
] | 2 | 2021-06-21T17:50:26.000Z | 2021-06-21T19:14:23.000Z | python_modules/libraries/dagster-papertrail/setup.py | bitdotioinc/dagster | 4fe395a37b206b1a48b956fa5dd72bf698104cca | [
"Apache-2.0"
] | 7 | 2022-03-16T06:55:04.000Z | 2022-03-18T07:03:25.000Z | python_modules/libraries/dagster-papertrail/setup.py | bitdotioinc/dagster | 4fe395a37b206b1a48b956fa5dd72bf698104cca | [
"Apache-2.0"
] | 1 | 2021-08-18T17:21:57.000Z | 2021-08-18T17:21:57.000Z | from setuptools import find_packages, setup
def get_version():
version = {}
with open("dagster_papertrail/version.py") as fp:
exec(fp.read(), version) # pylint: disable=W0122
return version["__version__"]
if __name__ == "__main__":
setup(
name="dagster-papertrail",
version=... | 32.6875 | 108 | 0.614723 | from setuptools import find_packages, setup
def get_version():
version = {}
with open("dagster_papertrail/version.py") as fp:
exec(fp.read(), version)
return version["__version__"]
if __name__ == "__main__":
setup(
name="dagster-papertrail",
version=get_version(),
... | true | true |
f70507b2d08d3c940b4529557fed1acefff47752 | 7,835 | py | Python | docs/conf.py | lcd1232/django-ratelimit2 | 417c677bea537304e48a0015d07902209a2e905a | [
"Apache-2.0"
] | null | null | null | docs/conf.py | lcd1232/django-ratelimit2 | 417c677bea537304e48a0015d07902209a2e905a | [
"Apache-2.0"
] | null | null | null | docs/conf.py | lcd1232/django-ratelimit2 | 417c677bea537304e48a0015d07902209a2e905a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Django Ratelimit documentation build configuration file, created by
# sphinx-quickstart on Fri Jan 4 15:55:31 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file... | 32.110656 | 80 | 0.716273 |
import sys, os
extensions = []
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'Django Ratelimit'
copyright = u'2014, James Socol'
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.... | true | true |
f705081a5da8e010e9ba2f98abb883270d65219a | 2,122 | py | Python | setup.py | powderflask/django_assess | cff25c0544a57ed9d7ddb3db3543268e51394875 | [
"MIT"
] | null | null | null | setup.py | powderflask/django_assess | cff25c0544a57ed9d7ddb3db3543268e51394875 | [
"MIT"
] | null | null | null | setup.py | powderflask/django_assess | cff25c0544a57ed9d7ddb3db3543268e51394875 | [
"MIT"
] | null | null | null | import sys, os, re
from setuptools import setup, Command, find_packages
from setuptools.command.test import test
class CleanCommand(Command):
"""Custom clean command to tidy up the project root."""
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
... | 29.472222 | 99 | 0.655985 | import sys, os, re
from setuptools import setup, Command, find_packages
from setuptools.command.test import test
class CleanCommand(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
os.system('rm -vrf ./*.pyc ./*.egg-... | true | true |
f705083b28a464c87e5ea58fd371f06a46d09124 | 16,794 | py | Python | tests/platform_tests/api/test_chassis.py | vdahiya12/sonic-mgmt | f785cd0bd07f8d2deb0b4bab16feb64f2eeba054 | [
"Apache-2.0"
] | null | null | null | tests/platform_tests/api/test_chassis.py | vdahiya12/sonic-mgmt | f785cd0bd07f8d2deb0b4bab16feb64f2eeba054 | [
"Apache-2.0"
] | null | null | null | tests/platform_tests/api/test_chassis.py | vdahiya12/sonic-mgmt | f785cd0bd07f8d2deb0b4bab16feb64f2eeba054 | [
"Apache-2.0"
] | null | null | null | import logging
import re
import pytest
import yaml
from tests.common.helpers.assertions import pytest_assert
from tests.common.helpers.platform_api import chassis
from platform_api_test_base import PlatformApiTestBase
logger = logging.getLogger(__name__)
pytestmark = [
pytest.mark.disable_loganalyzer, # disab... | 52.317757 | 146 | 0.711742 | import logging
import re
import pytest
import yaml
from tests.common.helpers.assertions import pytest_assert
from tests.common.helpers.platform_api import chassis
from platform_api_test_base import PlatformApiTestBase
logger = logging.getLogger(__name__)
pytestmark = [
pytest.mark.disable_loganalyzer,
py... | true | true |
f705088ca6ef0bf0d1e239d32b41a163dbc29fd3 | 5,189 | py | Python | api/src/opentrons/protocols/api_support/instrument.py | mrakitin/opentrons | d9c7ed23d13cdb62bd1bc397dc2871d4bd5b77e9 | [
"Apache-2.0"
] | null | null | null | api/src/opentrons/protocols/api_support/instrument.py | mrakitin/opentrons | d9c7ed23d13cdb62bd1bc397dc2871d4bd5b77e9 | [
"Apache-2.0"
] | null | null | null | api/src/opentrons/protocols/api_support/instrument.py | mrakitin/opentrons | d9c7ed23d13cdb62bd1bc397dc2871d4bd5b77e9 | [
"Apache-2.0"
] | null | null | null | import logging
from typing import Optional, Any
from opentrons import types
from opentrons.calibration_storage import get
from opentrons.calibration_storage.types import TipLengthCalNotFound
from opentrons.hardware_control.dev_types import PipetteDict
from opentrons.protocol_api.labware import Labware, Well
from opent... | 36.034722 | 77 | 0.671035 | import logging
from typing import Optional, Any
from opentrons import types
from opentrons.calibration_storage import get
from opentrons.calibration_storage.types import TipLengthCalNotFound
from opentrons.hardware_control.dev_types import PipetteDict
from opentrons.protocol_api.labware import Labware, Well
from opent... | true | true |
f70508c8381da2991bd613dc3eb8473318c12f5a | 436 | py | Python | cookies/admin.py | ADpDinamo/site | d7313cd6c151a381ccc803b81768673587cb8d45 | [
"Apache-2.0"
] | null | null | null | cookies/admin.py | ADpDinamo/site | d7313cd6c151a381ccc803b81768673587cb8d45 | [
"Apache-2.0"
] | 8 | 2021-03-19T10:14:39.000Z | 2022-03-12T00:24:41.000Z | cookies/admin.py | ADpDinamo/site | d7313cd6c151a381ccc803b81768673587cb8d45 | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
from .models import CookiePageText, TOSPageText, StatutPageText
# Register your models here.
class CookieAdmin(admin.ModelAdmin):
pass
class TOSPageTextAdmin(admin.ModelAdmin):
pass
class StatutPageTextAdmin(admin.ModelAdmin):
pass
admin.site.register(CookiePageText, Cooki... | 29.066667 | 63 | 0.823394 | from django.contrib import admin
from .models import CookiePageText, TOSPageText, StatutPageText
class CookieAdmin(admin.ModelAdmin):
pass
class TOSPageTextAdmin(admin.ModelAdmin):
pass
class StatutPageTextAdmin(admin.ModelAdmin):
pass
admin.site.register(CookiePageText, CookieAdmin)
admin.site.register(... | true | true |
f7050908f1d5cb294790a504bf31adbcb7c5b54b | 41,157 | py | Python | src/pyg_base/_pandas.py | nclarey/pyg-base | a7b90ea2ad4d740d8e7f8c4a7c9d341d36373862 | [
"MIT"
] | null | null | null | src/pyg_base/_pandas.py | nclarey/pyg-base | a7b90ea2ad4d740d8e7f8c4a7c9d341d36373862 | [
"MIT"
] | null | null | null | src/pyg_base/_pandas.py | nclarey/pyg-base | a7b90ea2ad4d740d8e7f8c4a7c9d341d36373862 | [
"MIT"
] | null | null | null | """
We want to simplify the operations for pandas dataframes assuming we are using timeseries as the main objects.
When we have multiple timeseries, we will:
1) calculate joint index using df_index()
2) reindex each timeseries to the joint index
We then need to worry about multiple columns if there a... | 36.134328 | 247 | 0.551449 | from pyg_base._types import is_df, is_str, is_num, is_tss, is_int, is_arr, is_ts, is_arrs, is_tuples, is_pd
from pyg_base._dictable import dictable
from pyg_base._as_list import as_list
from pyg_base._zip import zipper
from pyg_base._reducer import reducing, reducer
from pyg_base._decorators import wrapper
from pyg_ba... | true | true |
f70509cbebb9afd7e84c6f7a0db27094fc3c5d62 | 1,155 | py | Python | bis/apps/gepiandashboard/views/reports.py | AgustinMachiavello/business-incubation-system | 983e1308697771570891568f99d1b8ba74441d32 | [
"MIT"
] | 2 | 2021-03-03T16:16:42.000Z | 2021-03-08T22:43:10.000Z | bis/apps/gepiandashboard/views/reports.py | AgustinMachiavello/business-incubation-system | 983e1308697771570891568f99d1b8ba74441d32 | [
"MIT"
] | null | null | null | bis/apps/gepiandashboard/views/reports.py | AgustinMachiavello/business-incubation-system | 983e1308697771570891568f99d1b8ba74441d32 | [
"MIT"
] | null | null | null | """Reports views"""
# Django
from django.views.generic import TemplateView
# Shortcuts
from django.shortcuts import render
from django.shortcuts import redirect, reverse, get_object_or_404
from django.contrib.auth import authenticate
from django.http import (
HttpResponse,
HttpResponseNotFound,
HttpRespons... | 29.615385 | 97 | 0.772294 |
from django.views.generic import TemplateView
from django.shortcuts import render
from django.shortcuts import redirect, reverse, get_object_or_404
from django.contrib.auth import authenticate
from django.http import (
HttpResponse,
HttpResponseNotFound,
HttpResponseServerError,
HttpResponseRedirect,... | true | true |
f7050b4939e82b1488b36ea71d1c8a68281e80ae | 1,683 | py | Python | test/TestThreadAffinityLibrary.py | srgrr/thread_affinity | 56c8a50ea3fed276143a3794b8698d25816ca4a9 | [
"Apache-2.0"
] | 3 | 2018-11-30T11:11:34.000Z | 2020-08-12T16:48:36.000Z | test/TestThreadAffinityLibrary.py | srgrr/thread_affinity | 56c8a50ea3fed276143a3794b8698d25816ca4a9 | [
"Apache-2.0"
] | 1 | 2019-09-28T23:08:21.000Z | 2019-09-28T23:08:21.000Z | test/TestThreadAffinityLibrary.py | bsc-wdc/thread_affinity | 56c8a50ea3fed276143a3794b8698d25816ca4a9 | [
"Apache-2.0"
] | null | null | null | import unittest
import random
import subprocess
import signal
import sys
import os
import thread_affinity
# Test results may vary if executed in different systems
# with different amount of CPUUs
def get_random_mask():
"""Return a random, valid affinity mask
Which is a subset of {0, 1, ..., 2 ** num_procs - 1}
""... | 30.6 | 79 | 0.758764 | import unittest
import random
import subprocess
import signal
import sys
import os
import thread_affinity
def get_random_mask():
num_procs = thread_affinity.get_nprocs()
r = random.randint(1, 2 ** num_procs)
return [i for i in range(num_procs) if (r & (1 << i))]
class TestThreadAffinityLibrary(unittest.TestCas... | true | true |
f7050b93fb88c44b9196e0bbbdaf73e49e3cfa6c | 8,633 | py | Python | lib/sqlalchemy/log.py | sqlalchemy-bot/sqlalchemy | c0736e0b2a3bf8c0952db84f5b9943df9ebf18f7 | [
"MIT"
] | null | null | null | lib/sqlalchemy/log.py | sqlalchemy-bot/sqlalchemy | c0736e0b2a3bf8c0952db84f5b9943df9ebf18f7 | [
"MIT"
] | null | null | null | lib/sqlalchemy/log.py | sqlalchemy-bot/sqlalchemy | c0736e0b2a3bf8c0952db84f5b9943df9ebf18f7 | [
"MIT"
] | null | null | null | # sqlalchemy/log.py
# Copyright (C) 2006-2022 the SQLAlchemy authors and contributors
# <see AUTHORS file>
# Includes alterations by Vinay Sajip vinay_sajip@yahoo.co.uk
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Logging control ... | 29.565068 | 103 | 0.654697 |
from __future__ import annotations
import logging
import sys
from typing import Any
from typing import Optional
from typing import overload
from typing import Set
from typing import Type
from typing import TypeVar
from typing import Union
from .util import py311
from .util import py38
from .util.typing import... | true | true |
f7050bd0c8ce3ae371a054a6377ad40107a35adf | 602 | py | Python | repl/InterposedIO.py | freeman-lab/pyrepl | d7312778e1f6d5afddbe51d1ae6f604fcf9fc73f | [
"MIT"
] | 9 | 2018-03-17T01:59:08.000Z | 2021-07-30T13:36:46.000Z | repl/InterposedIO.py | chanzuckerberg/pyrepl | c3c366a0c7178a0c00a839b489bfcd0929e220d7 | [
"MIT"
] | null | null | null | repl/InterposedIO.py | chanzuckerberg/pyrepl | c3c366a0c7178a0c00a839b489bfcd0929e220d7 | [
"MIT"
] | null | null | null | """
Stream IO interposition
"""
import io
class InterposedStringIO(io.StringIO):
def __init__(self, newline="\n", line_buffering = False, onflush=None):
super().__init__(newline=newline)
self._line_buffering = line_buffering
self._onflush = onflush
def flush(self):
... | 25.083333 | 76 | 0.571429 |
import io
class InterposedStringIO(io.StringIO):
def __init__(self, newline="\n", line_buffering = False, onflush=None):
super().__init__(newline=newline)
self._line_buffering = line_buffering
self._onflush = onflush
def flush(self):
s = self.getvalue()
self... | true | true |
f7050c7044587c7a03a7e83f1453f954e296f2ad | 49,770 | py | Python | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_vms_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2021-09-07T18:39:05.000Z | 2021-09-07T18:39:05.000Z | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_vms_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_vms_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 47.445186 | 361 | 0.678802 |
import functools
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_... | true | true |
f7050d4c1a884b3f7c432e8139d4cdcd936b354a | 7,730 | py | Python | airflow/contrib/example_dags/example_twitter_dag.py | suensummit/airflow | 37a342d0e96a91ce2d34085e225a4e86f54c4e21 | [
"Apache-2.0"
] | 1 | 2021-11-04T20:11:58.000Z | 2021-11-04T20:11:58.000Z | airflow/contrib/example_dags/example_twitter_dag.py | suensummit/airflow | 37a342d0e96a91ce2d34085e225a4e86f54c4e21 | [
"Apache-2.0"
] | 20 | 2017-04-18T19:47:46.000Z | 2020-01-13T04:19:24.000Z | airflow/contrib/example_dags/example_twitter_dag.py | suensummit/airflow | 37a342d0e96a91ce2d34085e225a4e86f54c4e21 | [
"Apache-2.0"
] | 2 | 2018-09-15T07:13:01.000Z | 2021-03-26T07:27:38.000Z | # -*- coding: utf-8 -*-
#
# 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
#... | 37.892157 | 91 | 0.527167 |
from datetime import date, timedelta
import airflow
from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from airflow.operators.hive_operator import HiveOperator
from airflow.operators.python_operator import PythonOperator
def fetchtweets():
def cleantwe... | true | true |
f7050dd5698de7872ec97699e5e318cacda83a76 | 4,510 | py | Python | scripts/preprocessing/06-ptp_reject.py | crsegerie/mne-bids-pipeline | 897d36eb9e7f626215ad6ac4f645ac18f9477c80 | [
"BSD-3-Clause"
] | 31 | 2019-01-30T11:33:23.000Z | 2021-02-19T19:30:50.000Z | scripts/preprocessing/06-ptp_reject.py | crsegerie/mne-bids-pipeline | 897d36eb9e7f626215ad6ac4f645ac18f9477c80 | [
"BSD-3-Clause"
] | 207 | 2019-01-29T16:31:26.000Z | 2021-03-26T13:28:26.000Z | scripts/preprocessing/06-ptp_reject.py | crsegerie/mne-bids-pipeline | 897d36eb9e7f626215ad6ac4f645ac18f9477c80 | [
"BSD-3-Clause"
] | 26 | 2019-01-29T18:05:11.000Z | 2021-03-17T08:46:52.000Z | """
========================================================
06. Remove epochs based on peak-to-peak (PTP) amplitudes
========================================================
Epochs containing peak-to-peak above the thresholds defined
in the 'reject' parameter are removed from the data.
This step will drop epochs con... | 34.692308 | 79 | 0.601774 |
import itertools
import logging
from typing import Optional
import mne
from mne.utils import BunchConst
from mne.parallel import parallel_func
from mne_bids import BIDSPath
import config
from config import gen_log_kwargs, on_error, failsafe_run
logger = logging.getLogger('mne-bids-pipeline')
@failsafe_run(on_erro... | true | true |
f7050e55af4a52ddeec20cfc5c797671967bb328 | 19,712 | py | Python | opencell/imaging/images.py | czbiohub/opencell-portal-pub | 2b056924e4f55490b16349ff0dcf3e719ab516c7 | [
"Unlicense"
] | 2 | 2022-02-17T16:24:49.000Z | 2022-03-02T22:26:48.000Z | opencell/imaging/images.py | czbiohub/opencell-portal-pub | 2b056924e4f55490b16349ff0dcf3e719ab516c7 | [
"Unlicense"
] | null | null | null | opencell/imaging/images.py | czbiohub/opencell-portal-pub | 2b056924e4f55490b16349ff0dcf3e719ab516c7 | [
"Unlicense"
] | null | null | null | import datetime
import hashlib
import json
import numpy as np
import pandas as pd
import tifffile
def timestamp():
return datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
class MicroManagerTIFF:
def __init__(self, src_filepath, verbose=True):
'''
'''
self.verbose = verbose
... | 38.20155 | 98 | 0.605976 | import datetime
import hashlib
import json
import numpy as np
import pandas as pd
import tifffile
def timestamp():
return datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
class MicroManagerTIFF:
def __init__(self, src_filepath, verbose=True):
self.verbose = verbose
self.src_filepath =... | true | true |
f7050ebecfade791d4ef5451036aca5787d01b52 | 3,395 | py | Python | venv/venv/Scripts/Mewtify4Windows.py | FullstackAcademy/Mewtify | f6b23a6cf3da3f57bd27256e88786cc8c87e851d | [
"MIT"
] | null | null | null | venv/venv/Scripts/Mewtify4Windows.py | FullstackAcademy/Mewtify | f6b23a6cf3da3f57bd27256e88786cc8c87e851d | [
"MIT"
] | null | null | null | venv/venv/Scripts/Mewtify4Windows.py | FullstackAcademy/Mewtify | f6b23a6cf3da3f57bd27256e88786cc8c87e851d | [
"MIT"
] | 1 | 2021-12-17T01:06:42.000Z | 2021-12-17T01:06:42.000Z | #!/usr/bin/env python3
import tkinter as tk
import binascii, pyaes, sys, base64, os.path, os
from tkinter import *
from pathlib import Path
from tkinter.font import Font
from tkinter.filedialog import askopenfilename
import secrets
import string
def main():
global entry3
input2 = entry3.get()
# Open file
... | 33.613861 | 147 | 0.68218 |
import tkinter as tk
import binascii, pyaes, sys, base64, os.path, os
from tkinter import *
from pathlib import Path
from tkinter.font import Font
from tkinter.filedialog import askopenfilename
import secrets
import string
def main():
global entry3
input2 = entry3.get()
file_name = malwarename
... | true | true |
f7050ec21fb698ea4268b24c71bc79f1318a524a | 436,547 | py | Python | cisco-ios-xr/ydk/models/cisco_ios_xr/_meta/_Cisco_IOS_XR_l2vpn_cfg.py | tkamata-test/ydk-py | b637e7853a8edbbd31fbc05afa3aa4110b31c5f9 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | cisco-ios-xr/ydk/models/cisco_ios_xr/_meta/_Cisco_IOS_XR_l2vpn_cfg.py | tkamata-test/ydk-py | b637e7853a8edbbd31fbc05afa3aa4110b31c5f9 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | cisco-ios-xr/ydk/models/cisco_ios_xr/_meta/_Cisco_IOS_XR_l2vpn_cfg.py | tkamata-test/ydk-py | b637e7853a8edbbd31fbc05afa3aa4110b31c5f9 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null |
import re
import collections
from enum import Enum
from ydk._core._dm_meta_info import _MetaInfoClassMember, _MetaInfoClass, _MetaInfoEnum
from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict
from ydk._core._dm_meta_info import ATTRIBUTE, REFERENCE_CLASS, REFERENCE_LIST, REFERENCE_LEAFLI... | 59.957011 | 406 | 0.594403 |
import re
import collections
from enum import Enum
from ydk._core._dm_meta_info import _MetaInfoClassMember, _MetaInfoClass, _MetaInfoEnum
from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict
from ydk._core._dm_meta_info import ATTRIBUTE, REFERENCE_CLASS, REFERENCE_LIST, REFERENCE_LEAFLI... | true | true |
f705108a187baf052d5db4933fed18471b99b3db | 11,826 | py | Python | utils/crud.py | DaQueenJodi/Kurisu | 2a4e9010c862c2dcffb406d3596ed9a115533154 | [
"Apache-2.0"
] | null | null | null | utils/crud.py | DaQueenJodi/Kurisu | 2a4e9010c862c2dcffb406d3596ed9a115533154 | [
"Apache-2.0"
] | null | null | null | utils/crud.py | DaQueenJodi/Kurisu | 2a4e9010c862c2dcffb406d3596ed9a115533154 | [
"Apache-2.0"
] | null | null | null | from . import models
import datetime
from discord import utils, TextChannel
def generate_id():
return utils.time_snowflake(datetime.datetime.now())
async def add_permanent_role(user_id: int, role_id: int):
await add_dbmember_if_not_exist(user_id)
if not await models.PermanentRole.query.where((models.Per... | 31.876011 | 154 | 0.726958 | from . import models
import datetime
from discord import utils, TextChannel
def generate_id():
return utils.time_snowflake(datetime.datetime.now())
async def add_permanent_role(user_id: int, role_id: int):
await add_dbmember_if_not_exist(user_id)
if not await models.PermanentRole.query.where((models.Per... | true | true |
f70510cecaf633bc140f5d0280b6040db7788e73 | 9,585 | py | Python | bdd_mtl/mmdet/models/detectors/two_stage.py | XDong18/bdd-mtl | 90459c090a2bc4a89a929740e5cf5d37c1b34a4b | [
"BSD-3-Clause"
] | 79 | 2020-04-23T04:39:00.000Z | 2022-03-08T09:50:09.000Z | mmdet/models/detectors/two_stage_ori.py | xyldmc/siamese-mask-rcnn_mmdetection | 999e5bfcbd3c493bf69b8556c40eb26c9feeb459 | [
"Apache-2.0"
] | 3 | 2021-11-04T20:39:52.000Z | 2022-03-10T20:29:47.000Z | mmdet/models/detectors/two_stage_ori.py | ducminhkhoi/FAPIS | c89703006a2a5250f4d1c71e0aad958d72526885 | [
"Apache-2.0"
] | 29 | 2020-04-23T07:49:15.000Z | 2022-03-26T11:48:53.000Z | import torch
import torch.nn as nn
from .base import BaseDetector
from .test_mixins import RPNTestMixin, BBoxTestMixin, MaskTestMixin
from .. import builder
from ..registry import DETECTORS
from mmdet.core import bbox2roi, bbox2result, build_assigner, build_sampler
@DETECTORS.register_module
class TwoStageDetector(B... | 39.282787 | 79 | 0.549609 | import torch
import torch.nn as nn
from .base import BaseDetector
from .test_mixins import RPNTestMixin, BBoxTestMixin, MaskTestMixin
from .. import builder
from ..registry import DETECTORS
from mmdet.core import bbox2roi, bbox2result, build_assigner, build_sampler
@DETECTORS.register_module
class TwoStageDetector(B... | true | true |
f705116959898fd81eae2168f0c9e139ab6337b3 | 7,603 | py | Python | cogs/calculator.py | MerciDvor/modbot | f1a11eaa8e88d297ee19ca37aacc41489c0d0350 | [
"MIT"
] | 11 | 2019-01-10T22:09:31.000Z | 2021-12-14T05:26:10.000Z | cogs/calculator.py | MerciDvor/modbot | f1a11eaa8e88d297ee19ca37aacc41489c0d0350 | [
"MIT"
] | 5 | 2019-01-10T07:20:19.000Z | 2021-04-22T00:57:34.000Z | cogs/calculator.py | MerciDvor/modbot | f1a11eaa8e88d297ee19ca37aacc41489c0d0350 | [
"MIT"
] | 34 | 2019-01-10T05:49:29.000Z | 2022-02-11T14:04:54.000Z | from __future__ import division
import discord, math, operator
from discord.ext import commands
from pyparsing import (Literal,CaselessLiteral,Word,Combine,Group,Optional,
ZeroOrMore,Forward,nums,alphas,oneOf)
__author__='Paul McGuire'
__version__ = '$Revision: 0.0 $'
__date__ = '$Date: 2009-03-20... | 41.320652 | 123 | 0.544916 | from __future__ import division
import discord, math, operator
from discord.ext import commands
from pyparsing import (Literal,CaselessLiteral,Word,Combine,Group,Optional,
ZeroOrMore,Forward,nums,alphas,oneOf)
__author__='Paul McGuire'
__version__ = '$Revision: 0.0 $'
__date__ = '$Date: 2009-03-20... | true | true |
f7051188a962d569b2fe5523b4fb6cc5f81e0849 | 1,304 | py | Python | tests/test_live_photos.py | onfido/onfido-python | e779347f04dd7891987c2c915047fd039f6d7742 | [
"MIT"
] | 16 | 2020-06-30T15:35:42.000Z | 2022-02-12T09:26:41.000Z | tests/test_live_photos.py | onfido/onfido-python | e779347f04dd7891987c2c915047fd039f6d7742 | [
"MIT"
] | 6 | 2020-07-06T08:56:33.000Z | 2021-07-12T18:09:07.000Z | tests/test_live_photos.py | onfido/onfido-python | e779347f04dd7891987c2c915047fd039f6d7742 | [
"MIT"
] | 5 | 2020-08-18T08:12:19.000Z | 2021-05-26T11:43:53.000Z | import onfido
from onfido.regions import Region
import io
api = onfido.Api("<AN_API_TOKEN>", region=Region.EU)
fake_uuid = "58a9c6d2-8661-4dbd-96dc-b9b9d344a7ce"
def test_upload_photo(requests_mock):
mock_upload = requests_mock.post("https://api.eu.onfido.com/v3.2/live_photos/", json=[])
sample_file = open... | 37.257143 | 170 | 0.751534 | import onfido
from onfido.regions import Region
import io
api = onfido.Api("<AN_API_TOKEN>", region=Region.EU)
fake_uuid = "58a9c6d2-8661-4dbd-96dc-b9b9d344a7ce"
def test_upload_photo(requests_mock):
mock_upload = requests_mock.post("https://api.eu.onfido.com/v3.2/live_photos/", json=[])
sample_file = open... | true | true |
f705121c1bad013c291364ae04075091589dbba5 | 1,042 | py | Python | _/chapter5-OpenStack/BlockStoreService/VolumeOperations.py | paullewallencom/hybrid-cloud-978-1-7888-3087-4 | d101553fd342f420b581b87c58c7219f2b04a7c6 | [
"Apache-2.0"
] | 3 | 2018-03-27T14:34:48.000Z | 2021-10-04T16:28:19.000Z | _/chapter5-OpenStack/BlockStoreService/VolumeOperations.py | paullewallencom/hybrid-cloud-978-1-7888-3087-4 | d101553fd342f420b581b87c58c7219f2b04a7c6 | [
"Apache-2.0"
] | null | null | null | _/chapter5-OpenStack/BlockStoreService/VolumeOperations.py | paullewallencom/hybrid-cloud-978-1-7888-3087-4 | d101553fd342f420b581b87c58c7219f2b04a7c6 | [
"Apache-2.0"
] | 1 | 2021-08-27T23:51:28.000Z | 2021-08-27T23:51:28.000Z | #import OpenStack connection class from the SDK
from openstack import connection
# Create a connection object by calling the constructor and pass the security information
conn = connection.Connection(auth_url="http://192.168.0.106/identity",
project_name="demo",
username="admin",
password="manoj",
user_domain_id="defa... | 29.771429 | 89 | 0.779271 |
from openstack import connection
conn = connection.Connection(auth_url="http://192.168.0.106/identity",
project_name="demo",
username="admin",
password="manoj",
user_domain_id="default",
project_domain_id="default")
def create_volume(conn):
volume_properties = {'size':'2', 'name':'packtpub-volume-2'}
volum... | true | true |
f70513caa49442a4e72d71bac1f20f80278b0b7c | 107 | py | Python | {{cookiecutter.project_slug}}/src/{{cookiecutter.project_slug}}/__init__.py | JDongian/cookiecutter-pypackage | 2e7c0d3a623755373560ee68fcb6a162085638c0 | [
"Apache-2.0"
] | 2 | 2019-06-12T23:29:41.000Z | 2019-06-25T20:35:47.000Z | {{cookiecutter.project_slug}}/src/{{cookiecutter.project_slug}}/__init__.py | JDongian/cookiecutter-pypackage | 2e7c0d3a623755373560ee68fcb6a162085638c0 | [
"Apache-2.0"
] | 4 | 2018-02-09T06:24:59.000Z | 2019-01-23T06:46:11.000Z | {{cookiecutter.project_slug}}/src/{{cookiecutter.project_slug}}/__init__.py | JDongian/cookiecutter-pypackage | 2e7c0d3a623755373560ee68fcb6a162085638c0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""Top-level package for {{ cookiecutter.project_name }}"""
__version__ = '0.0.1'
| 21.4 | 59 | 0.616822 |
__version__ = '0.0.1'
| true | true |
f70513f071c9fec7e830d9232516ac75706443c6 | 10 | py | Python | example_snippets/multimenus_snippets/Snippets/NumPy/Vectorized (universal) functions/Trigonometric and hyperbolic functions/tanh Compute hyperbolic tangent element-wise.py | kuanpern/jupyterlab-snippets-multimenus | 477f51cfdbad7409eab45abe53cf774cd70f380c | [
"BSD-3-Clause"
] | null | null | null | example_snippets/multimenus_snippets/Snippets/NumPy/Vectorized (universal) functions/Trigonometric and hyperbolic functions/tanh Compute hyperbolic tangent element-wise.py | kuanpern/jupyterlab-snippets-multimenus | 477f51cfdbad7409eab45abe53cf774cd70f380c | [
"BSD-3-Clause"
] | null | null | null | example_snippets/multimenus_snippets/Snippets/NumPy/Vectorized (universal) functions/Trigonometric and hyperbolic functions/tanh Compute hyperbolic tangent element-wise.py | kuanpern/jupyterlab-snippets-multimenus | 477f51cfdbad7409eab45abe53cf774cd70f380c | [
"BSD-3-Clause"
] | 1 | 2021-02-04T04:51:48.000Z | 2021-02-04T04:51:48.000Z | np.tanh(x) | 10 | 10 | 0.7 | np.tanh(x) | true | true |
f705141e5f48b22c12903c1fa1a907b58b1375d4 | 366 | py | Python | examples/getting_started/06_sentinel.py | emorozov/aioredis | bad0bd2d1435e56688d189cf3209beec3d239557 | [
"MIT"
] | null | null | null | examples/getting_started/06_sentinel.py | emorozov/aioredis | bad0bd2d1435e56688d189cf3209beec3d239557 | [
"MIT"
] | 75 | 2020-12-09T06:53:47.000Z | 2022-03-25T01:05:24.000Z | examples/getting_started/06_sentinel.py | emorozov/aioredis | bad0bd2d1435e56688d189cf3209beec3d239557 | [
"MIT"
] | null | null | null | import asyncio
import aioredis
async def main():
sentinel = await aioredis.create_sentinel(
["redis://localhost:26379", "redis://sentinel2:26379"]
)
redis = sentinel.master_for("mymaster")
ok = await redis.set("key", "value")
assert ok
val = await redis.get("key", encoding="utf-8")
... | 20.333333 | 62 | 0.639344 | import asyncio
import aioredis
async def main():
sentinel = await aioredis.create_sentinel(
["redis://localhost:26379", "redis://sentinel2:26379"]
)
redis = sentinel.master_for("mymaster")
ok = await redis.set("key", "value")
assert ok
val = await redis.get("key", encoding="utf-8")
... | true | true |
f705170d03d2dd066c58fc27f04b0e6e4b224eb2 | 1,573 | py | Python | app/Resource/ImageResource.py | ansabkhaliq/backend | 14bad9b44bfec6ea4ba27d1571ddcf614ff762c6 | [
"MIT"
] | null | null | null | app/Resource/ImageResource.py | ansabkhaliq/backend | 14bad9b44bfec6ea4ba27d1571ddcf614ff762c6 | [
"MIT"
] | 11 | 2020-09-22T11:15:09.000Z | 2020-11-03T21:45:18.000Z | app/Resource/ImageResource.py | ansabkhaliq/backend | 14bad9b44bfec6ea4ba27d1571ddcf614ff762c6 | [
"MIT"
] | 2 | 2020-09-21T19:20:44.000Z | 2021-03-21T04:46:19.000Z | import logging
from .DatabaseBase import DatabaseBase
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.DEBUG)
class ImageResource(DatabaseBase):
def __init__(self):
super().__init__()
def get_product_images_by_id(self, id):
search_image_query = """Select * From images w... | 34.195652 | 117 | 0.633185 | import logging
from .DatabaseBase import DatabaseBase
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.DEBUG)
class ImageResource(DatabaseBase):
def __init__(self):
super().__init__()
def get_product_images_by_id(self, id):
search_image_query = """Select * From images w... | true | true |
f705181e0f045be38f7e9fa0b37412575523e61a | 915 | py | Python | weather_api/weather_api/urls.py | brian-duffy/yoyo-test | 65700a0061022e326a0048695c122ea2cfb5d5fe | [
"OML"
] | null | null | null | weather_api/weather_api/urls.py | brian-duffy/yoyo-test | 65700a0061022e326a0048695c122ea2cfb5d5fe | [
"OML"
] | 12 | 2019-12-26T16:40:09.000Z | 2022-03-11T23:17:44.000Z | weather_api/weather_api/urls.py | brian-duffy/yoyo-test | 65700a0061022e326a0048695c122ea2cfb5d5fe | [
"OML"
] | null | null | null | """weather_api URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class... | 38.125 | 107 | 0.711475 | from django.conf.urls import url, include
from django.views.generic import RedirectView
urlpatterns = [
url(r'^$', RedirectView.as_view(url='https://github.com/brian-duffy/yoyo-test/blob/master/README.md')),
url(r'weather_app/', include('weather_app.urls')),
]
| true | true |
f705183f4fbd0db80b7cc60b42c57b39c75bdeac | 2,196 | py | Python | curry.py | christianscott/curry.py | 2a8ef4b40853dff6b239f794fcc0e3f9a157d7ab | [
"MIT"
] | 2 | 2020-10-02T19:04:38.000Z | 2021-10-01T10:51:14.000Z | curry.py | christianscott/curry.py | 2a8ef4b40853dff6b239f794fcc0e3f9a157d7ab | [
"MIT"
] | 3 | 2019-09-09T09:41:10.000Z | 2019-09-09T09:41:33.000Z | curry.py | christianscott/curry.py | 2a8ef4b40853dff6b239f794fcc0e3f9a157d7ab | [
"MIT"
] | 1 | 2021-10-01T10:51:15.000Z | 2021-10-01T10:51:15.000Z | """Utility for currying functions."""
from functools import wraps
from inspect import signature, isbuiltin, isclass
def curry(func, args=None, kwargs=None, n=None, use_defaults=False):
if use_defaults:
return CurriedDefault(func, args, kwargs, n)
return Curried(func, args, kwargs, n)
class Curried... | 28.519481 | 109 | 0.676685 |
from functools import wraps
from inspect import signature, isbuiltin, isclass
def curry(func, args=None, kwargs=None, n=None, use_defaults=False):
if use_defaults:
return CurriedDefault(func, args, kwargs, n)
return Curried(func, args, kwargs, n)
class Curried:
def __init__(self, func, args=No... | true | true |
f7051948f84339215d44128dbd1290fdb16a154f | 786 | py | Python | datalad/interface/download_url.py | AKSoo/datalad | dbc34478980c808a86b5531316c986abac953e37 | [
"MIT"
] | null | null | null | datalad/interface/download_url.py | AKSoo/datalad | dbc34478980c808a86b5531316c986abac953e37 | [
"MIT"
] | 1 | 2020-12-01T20:13:51.000Z | 2020-12-01T20:13:51.000Z | datalad/interface/download_url.py | jwodder/datalad | 2b92a764fdc64b750dad68eb51c817218a1ec153 | [
"MIT"
] | null | null | null | # emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*-
# ex: set sts=4 ts=4 sw=4 et:
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the datalad package for the
# copyright and license terms.
#
# ## ### ### ... | 37.428571 | 87 | 0.57888 | true | true | |
f7051a146cd3b773029e9815898f0cb11b731acd | 30,749 | py | Python | venv/lib/python2.7/site-packages/flask_login.py | jessekl/twiliochallenge | 2bba8bc2e0928880f1e2abe6b53b96dbc67ef34f | [
"MIT"
] | 2 | 2015-11-05T09:43:45.000Z | 2017-05-31T14:22:02.000Z | flask/lib/site-packages/flask_login.py | CodingForChange/praquemdoar | 575d67d211473f352adcd9d7c405c7a5cf18fc6e | [
"Apache-2.0"
] | null | null | null | flask/lib/site-packages/flask_login.py | CodingForChange/praquemdoar | 575d67d211473f352adcd9d7c405c7a5cf18fc6e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
flask.ext.login
---------------
This module provides user session management for Flask. It lets you log
your users in and out in a database-independent manner.
:copyright: (c) 2011 by Matthew Frazier.
:license: MIT/X11, see LICENSE for more details.
'''
__version_i... | 34.902384 | 79 | 0.652769 |
__version_info__ = ('0', '2', '10')
__version__ = '.'.join(__version_info__)
__author__ = 'Matthew Frazier'
__license__ = 'MIT/X11'
__copyright__ = '(c) 2011 by Matthew Frazier'
__all__ = ['LoginManager']
from flask import (_request_ctx_stack, abort, current_app, flash, redirect,
request, session,... | true | true |
f7051d918dd37949e61a5f9a742e216e26e774b9 | 12,368 | py | Python | python/ccxt/lykke.py | mikepsinn/ccxt | 04c73735f53a7f28f5f4bd7f6846503047297138 | [
"MIT"
] | 1 | 2019-03-12T09:30:24.000Z | 2019-03-12T09:30:24.000Z | python/ccxt/lykke.py | mikepsinn/ccxt | 04c73735f53a7f28f5f4bd7f6846503047297138 | [
"MIT"
] | null | null | null | python/ccxt/lykke.py | mikepsinn/ccxt | 04c73735f53a7f28f5f4bd7f6846503047297138 | [
"MIT"
] | null | null | null | # -*- 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
import math
class lykke (Exchange):
def describe(self):
return self.deep_extend(supe... | 35.849275 | 126 | 0.467416 |
ge import Exchange
import math
class lykke (Exchange):
def describe(self):
return self.deep_extend(super(lykke, self).describe(), {
'id': 'lykke',
'name': 'Lykke',
'countries': 'CH',
'version': 'v1',
'rateLimit': 200,
'has': {
... | true | true |
f7051dc01ebdfbe27bb258f790b4db971830c134 | 17,851 | py | Python | unittests/ray_tracer/test_kdtree.py | nasa/giant | 1e939272d9a0ca533b4da400d132f854520f3adc | [
"NASA-1.3"
] | 5 | 2021-09-10T14:29:19.000Z | 2022-01-13T20:15:01.000Z | unittests/ray_tracer/test_kdtree.py | nasa/giant | 1e939272d9a0ca533b4da400d132f854520f3adc | [
"NASA-1.3"
] | null | null | null | unittests/ray_tracer/test_kdtree.py | nasa/giant | 1e939272d9a0ca533b4da400d132f854520f3adc | [
"NASA-1.3"
] | 2 | 2021-10-01T18:39:13.000Z | 2021-12-30T08:53:08.000Z | from unittest import TestCase, skip
import copy
import numpy as np
from giant import rotations as at
from giant.ray_tracer import kdtree, shapes, rays
class TestKDTree(TestCase):
def setUp(self):
self.max_depth = 4
tri1 = np.array([[-5, -4, -4.5],
[0, 0, 1],
... | 35.702 | 142 | 0.493866 | from unittest import TestCase, skip
import copy
import numpy as np
from giant import rotations as at
from giant.ray_tracer import kdtree, shapes, rays
class TestKDTree(TestCase):
def setUp(self):
self.max_depth = 4
tri1 = np.array([[-5, -4, -4.5],
[0, 0, 1],
... | true | true |
f7051dc56c585ff1a625d6db41e7759458136b36 | 446 | py | Python | scripts/debian/usr/lib/dipicar/scripts/installation/ssl_keys_gen.py | TeaFlex/DiPiCar | e56f74ac55f5cfff22fd82807b06dc367c42cac0 | [
"0BSD"
] | 1 | 2021-07-10T13:41:00.000Z | 2021-07-10T13:41:00.000Z | scripts/debian/usr/lib/dipicar/scripts/installation/ssl_keys_gen.py | TeaFlex/DiPiCar | e56f74ac55f5cfff22fd82807b06dc367c42cac0 | [
"0BSD"
] | null | null | null | scripts/debian/usr/lib/dipicar/scripts/installation/ssl_keys_gen.py | TeaFlex/DiPiCar | e56f74ac55f5cfff22fd82807b06dc367c42cac0 | [
"0BSD"
] | null | null | null | #!/usr/bin/python3
from subprocess import call;
from sys import argv
from os import path
outPath = argv[1] if(len(argv)>1) else "/etc/dipicar/creds"
duration = 365
rsaLength = 4096
#Generate ssl keys
call([
"openssl",
"req",
"-x509",
"-newkey",
"rsa:"+str(rsaLength),
"-keyout", path.join... | 19.391304 | 59 | 0.596413 |
from subprocess import call;
from sys import argv
from os import path
outPath = argv[1] if(len(argv)>1) else "/etc/dipicar/creds"
duration = 365
rsaLength = 4096
call([
"openssl",
"req",
"-x509",
"-newkey",
"rsa:"+str(rsaLength),
"-keyout", path.join(outPath,"key.pem"),
"-out", pa... | true | true |
f705210f06709ba3f43e67e92c0421ff78f57d45 | 649 | py | Python | chalicelib/api/taxiAvailability.py | yeukfei02/singapore-taxi-api | 25749c3a8c07849d4a2a13410da712ca64d102ca | [
"MIT"
] | null | null | null | chalicelib/api/taxiAvailability.py | yeukfei02/singapore-taxi-api | 25749c3a8c07849d4a2a13410da712ca64d102ca | [
"MIT"
] | 1 | 2021-05-04T03:30:01.000Z | 2021-05-05T13:38:41.000Z | chalicelib/api/taxiAvailability.py | yeukfei02/singapore-taxi-api | 25749c3a8c07849d4a2a13410da712ca64d102ca | [
"MIT"
] | null | null | null | import requests
import os
ROOT_URL = 'http://datamall2.mytransport.sg/ltaodataservice'
def get_taxi_availability_request():
result = None
try:
url = '{}/Taxi-Availability'.format(ROOT_URL)
headers = {
'AccountKey': os.getenv('ACCOUNT_KEY'),
'Accept': 'application/json... | 24.037037 | 60 | 0.604006 | import requests
import os
ROOT_URL = 'http://datamall2.mytransport.sg/ltaodataservice'
def get_taxi_availability_request():
result = None
try:
url = '{}/Taxi-Availability'.format(ROOT_URL)
headers = {
'AccountKey': os.getenv('ACCOUNT_KEY'),
'Accept': 'application/json... | true | true |
f7052138819216e6f5c48540636b581bd627c13e | 1,164 | py | Python | ocdb/ws/handlers/__init__.py | eocdb/ocdb-server | 0e28d092e8ecf5f4813878aab43de990cc5fb4ee | [
"MIT"
] | null | null | null | ocdb/ws/handlers/__init__.py | eocdb/ocdb-server | 0e28d092e8ecf5f4813878aab43de990cc5fb4ee | [
"MIT"
] | 1 | 2019-06-21T09:43:01.000Z | 2019-06-21T09:43:01.000Z | eocdb/ws/handlers/__init__.py | bcdev/ocdb-server | 027078f2b022a06b3a417d76d273514a72f8cac7 | [
"MIT"
] | null | null | null | # The MIT License (MIT)
# Copyright (c) 2018 by EUMETSAT
#
# 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,... | 48.5 | 81 | 0.77921 |
from ._mappings import MAPPINGS, API_URL_PREFIX
| true | true |
f705217d4ccc8cc742ed3dae28f533f8474e2433 | 1,752 | py | Python | tests/adapters/model/elasticsearch_model/elements.py | mpsiva89/protean | 315fa56da3f64178bbbf0edf1995af46d5eb3da7 | [
"BSD-3-Clause"
] | null | null | null | tests/adapters/model/elasticsearch_model/elements.py | mpsiva89/protean | 315fa56da3f64178bbbf0edf1995af46d5eb3da7 | [
"BSD-3-Clause"
] | null | null | null | tests/adapters/model/elasticsearch_model/elements.py | mpsiva89/protean | 315fa56da3f64178bbbf0edf1995af46d5eb3da7 | [
"BSD-3-Clause"
] | null | null | null | import re
from collections import defaultdict
from datetime import datetime
from elasticsearch_dsl import Keyword, Text
from protean import BaseAggregate, BaseValueObject
from protean.core.model import BaseModel
from protean.fields import DateTime, Integer, String
from protean.fields import Text as ProteanText
from ... | 24.676056 | 62 | 0.703196 | import re
from collections import defaultdict
from datetime import datetime
from elasticsearch_dsl import Keyword, Text
from protean import BaseAggregate, BaseValueObject
from protean.core.model import BaseModel
from protean.fields import DateTime, Integer, String
from protean.fields import Text as ProteanText
from ... | true | true |
f70521986d834f98db5a48207bb5f18312adac09 | 3,207 | py | Python | 355.Design-Twitter.py | mickey0524/leetcode | 6bedeb6ff29b02a97178cca464c5fd639951801f | [
"MIT"
] | 18 | 2018-07-14T12:45:37.000Z | 2022-03-26T14:51:04.000Z | 355.Design-Twitter.py | mickey0524/leetcode | 6bedeb6ff29b02a97178cca464c5fd639951801f | [
"MIT"
] | null | null | null | 355.Design-Twitter.py | mickey0524/leetcode | 6bedeb6ff29b02a97178cca464c5fd639951801f | [
"MIT"
] | 3 | 2019-05-29T04:09:22.000Z | 2021-06-07T23:37:46.000Z | # https://leetcode.com/problems/design-twitter/
#
# algorithms
# Medium (27.98%)
# Total Accepted: 37,655
# Total Submissions: 134,594
from collections import defaultdict
from bisect import insort
class Twitter(object):
def __init__(self):
"""
Initialize your data structure here.
"""... | 29.971963 | 224 | 0.617711 |
from collections import defaultdict
from bisect import insort
class Twitter(object):
def __init__(self):
self.follow_map = defaultdict(set)
self.followed_map = defaultdict(set)
self.tweet_map = defaultdict(list)
self.post_map = defaultdict(list)
self.tweet_... | true | true |
f705220d566871e203d73d64093d17551fc09aa8 | 4,506 | py | Python | tactics.py | knuekim98/titfortat-simulator | 96e1c92058d43b6e4641ea323772a7fdd22a4ccd | [
"MIT"
] | null | null | null | tactics.py | knuekim98/titfortat-simulator | 96e1c92058d43b6e4641ea323772a7fdd22a4ccd | [
"MIT"
] | null | null | null | tactics.py | knuekim98/titfortat-simulator | 96e1c92058d43b6e4641ea323772a7fdd22a4ccd | [
"MIT"
] | null | null | null | from const import result
import random
C, D = True, False
def opponent(r):
if r == result.COOP or r == result.DEFECT:
return True
return False
# tit for tat
class Tft:
def __init__(self) -> None:
self.score = 0
self.last_reaction = C
def run(self):
return self.last_... | 20.669725 | 63 | 0.545717 | from const import result
import random
C, D = True, False
def opponent(r):
if r == result.COOP or r == result.DEFECT:
return True
return False
class Tft:
def __init__(self) -> None:
self.score = 0
self.last_reaction = C
def run(self):
return self.last_reaction
... | true | true |
f705226f63166954703af3428c9ff9c96723765d | 8,341 | py | Python | autotest/test_gwf_uzf_surfdep.py | mkennard-aquaveo/modflow6 | 73a0553636362c90f7d134318e1f5d902dbdc4d3 | [
"CC0-1.0"
] | null | null | null | autotest/test_gwf_uzf_surfdep.py | mkennard-aquaveo/modflow6 | 73a0553636362c90f7d134318e1f5d902dbdc4d3 | [
"CC0-1.0"
] | null | null | null | autotest/test_gwf_uzf_surfdep.py | mkennard-aquaveo/modflow6 | 73a0553636362c90f7d134318e1f5d902dbdc4d3 | [
"CC0-1.0"
] | null | null | null | import os
import pytest
import sys
import numpy as np
import shutil
import subprocess
try:
import pymake
except:
msg = "Error. Pymake package is not available.\n"
msg += "Try installing using the following command:\n"
msg += " pip install https://github.com/modflowpy/pymake/zipball/master"
raise Ex... | 30.665441 | 79 | 0.531111 | import os
import pytest
import sys
import numpy as np
import shutil
import subprocess
try:
import pymake
except:
msg = "Error. Pymake package is not available.\n"
msg += "Try installing using the following command:\n"
msg += " pip install https://github.com/modflowpy/pymake/zipball/master"
raise Ex... | true | true |
f70522e7e78a3344ab563ab228f5eece99510bcf | 584 | py | Python | tpv29/generate_mytopo_tpv29.py | sebwolf-de/Examples | 329db390d540e6f5fe1dff35372528f723882271 | [
"BSD-3-Clause"
] | 3 | 2021-08-16T12:57:52.000Z | 2021-11-02T23:39:36.000Z | tpv29/generate_mytopo_tpv29.py | sebwolf-de/Examples | 329db390d540e6f5fe1dff35372528f723882271 | [
"BSD-3-Clause"
] | 22 | 2020-09-25T12:52:04.000Z | 2022-02-09T14:51:20.000Z | tpv29/generate_mytopo_tpv29.py | sebwolf-de/Examples | 329db390d540e6f5fe1dff35372528f723882271 | [
"BSD-3-Clause"
] | 11 | 2018-10-11T09:04:42.000Z | 2021-12-06T17:17:39.000Z | import numpy as np
# Read scec input file
fid = open("tpv29_tpv30_geometry_25m_data.txt")
line = fid.readline()
line = fid.readline()
header = [float(a) for a in line.split()]
nx, ny, lx, ly = header
roughness = np.loadtxt(fid)
roughness = roughness[:, 4]
fid.close()
# create x and y vectors
x = np.linspace(-lx / 2, ... | 24.333333 | 47 | 0.64726 | import numpy as np
fid = open("tpv29_tpv30_geometry_25m_data.txt")
line = fid.readline()
line = fid.readline()
header = [float(a) for a in line.split()]
nx, ny, lx, ly = header
roughness = np.loadtxt(fid)
roughness = roughness[:, 4]
fid.close()
x = np.linspace(-lx / 2, lx / 2, int(nx) + 1)
y = np.linspace(0, ly, in... | true | true |
f70523fc884ca9381af67d78c3f7c35fb8498822 | 284 | py | Python | tests/client/test_inmemory/conftest.py | zyfra/ebonite | b01b662c43709d152940f488574d78ff25f89ecf | [
"Apache-2.0"
] | 270 | 2019-11-14T15:46:08.000Z | 2021-09-17T16:43:03.000Z | tests/client/test_inmemory/conftest.py | leepand/ebonite | b01b662c43709d152940f488574d78ff25f89ecf | [
"Apache-2.0"
] | 14 | 2019-11-29T11:49:39.000Z | 2022-02-10T00:23:59.000Z | tests/client/test_inmemory/conftest.py | leepand/ebonite | b01b662c43709d152940f488574d78ff25f89ecf | [
"Apache-2.0"
] | 18 | 2019-11-22T13:15:14.000Z | 2021-09-01T13:36:12.000Z | import pytest
from ebonite.client import Ebonite
from tests.client.conftest import create_client_hooks
@pytest.fixture
def inmemory_ebnt():
ebnt = Ebonite.inmemory()
yield ebnt
pytest_runtest_protocol, pytest_collect_file = create_client_hooks(inmemory_ebnt, 'inmemory')
| 20.285714 | 93 | 0.806338 | import pytest
from ebonite.client import Ebonite
from tests.client.conftest import create_client_hooks
@pytest.fixture
def inmemory_ebnt():
ebnt = Ebonite.inmemory()
yield ebnt
pytest_runtest_protocol, pytest_collect_file = create_client_hooks(inmemory_ebnt, 'inmemory')
| true | true |
f70524256bdfc9b0876254c7efcadd8c12f51182 | 3,165 | py | Python | example1.py | srujan71/CubeSat-Mission-Planner | 34030254109def0b13e82116ed5122ecf79a82f7 | [
"MIT"
] | 1 | 2021-07-26T16:17:30.000Z | 2021-07-26T16:17:30.000Z | example1.py | leizhang2020/CubeSat-Mission-Planner | 62d1ad33c2dcb1a2f8fb3ff615cc5cc0e6716969 | [
"MIT"
] | null | null | null | example1.py | leizhang2020/CubeSat-Mission-Planner | 62d1ad33c2dcb1a2f8fb3ff615cc5cc0e6716969 | [
"MIT"
] | 2 | 2021-09-18T08:50:44.000Z | 2022-01-20T02:41:38.000Z | """
example1.py
"A simple example how to use the CubeSat-Power-Estimation tool."
@author: Johan Monster (https://github.com/Hans-Bananendans/)
"""
# Import packages
import numpy as np
import pandas as pd
from mission import Mission
# Defining the config
config = {
"years_passed" : 0, # How many [years] the sat... | 29.858491 | 78 | 0.594945 |
import numpy as np
import pandas as pd
from mission import Mission
config = {
"years_passed" : 0,
"battery_capacity" : 81000,
"battery_degradation_factor" : 0.04,
"battery_init" : 0.5,
"panel_degradation_factor" : 0.02,
"blip_period" : 30,
"blip_duration" : 1,
"n... | true | true |
f7052438c8473f910759ed0cf1b17b8320d04873 | 653 | py | Python | coredis/response/callbacks/acl.py | alisaifee/aredis | c5764a5a2a29c4ed25278548aa54eece94974440 | [
"MIT"
] | null | null | null | coredis/response/callbacks/acl.py | alisaifee/aredis | c5764a5a2a29c4ed25278548aa54eece94974440 | [
"MIT"
] | null | null | null | coredis/response/callbacks/acl.py | alisaifee/aredis | c5764a5a2a29c4ed25278548aa54eece94974440 | [
"MIT"
] | null | null | null | from __future__ import annotations
from coredis.response.callbacks import (
DictCallback,
ResponseCallback,
SimpleStringCallback,
)
from coredis.response.utils import flat_pairs_to_dict
from coredis.typing import Any, AnyStr, Mapping, Tuple, Union
class ACLLogCallback(ResponseCallback):
def transform... | 29.681818 | 88 | 0.679939 | from __future__ import annotations
from coredis.response.callbacks import (
DictCallback,
ResponseCallback,
SimpleStringCallback,
)
from coredis.response.utils import flat_pairs_to_dict
from coredis.typing import Any, AnyStr, Mapping, Tuple, Union
class ACLLogCallback(ResponseCallback):
def transform... | true | true |
f705245746d0ebe045665a381e0da85b1675e0cb | 297 | py | Python | tensornetwork/component_factory.py | gazay/TensorNetwork | 1564a24d6fef6d6ecd90dc01b55a5aa3f5d71b8e | [
"Apache-2.0"
] | 2 | 2019-11-22T20:03:47.000Z | 2020-09-03T20:25:51.000Z | tensornetwork/component_factory.py | gazay/TensorNetwork | 1564a24d6fef6d6ecd90dc01b55a5aa3f5d71b8e | [
"Apache-2.0"
] | null | null | null | tensornetwork/component_factory.py | gazay/TensorNetwork | 1564a24d6fef6d6ecd90dc01b55a5aa3f5d71b8e | [
"Apache-2.0"
] | 3 | 2020-04-27T10:28:21.000Z | 2021-03-02T10:02:14.000Z | from tensornetwork.network_components import Node, CopyNode, Edge
_COMPONENTS = {
"Node": Node,
"CopyNode": CopyNode,
"Edge": Edge,
}
def get_component(name):
if name not in _COMPONENTS:
raise ValueError("Component {} does not exist".format(name))
return _COMPONENTS[name]
| 19.8 | 65 | 0.703704 | from tensornetwork.network_components import Node, CopyNode, Edge
_COMPONENTS = {
"Node": Node,
"CopyNode": CopyNode,
"Edge": Edge,
}
def get_component(name):
if name not in _COMPONENTS:
raise ValueError("Component {} does not exist".format(name))
return _COMPONENTS[name]
| true | true |
f7052482790afe437f8491bcd68bb6a5d319ef0d | 3,563 | py | Python | chapter10/image.py | atac-bham/pychapter10 | 292f15162d4a637144ab0e64ed7215a4ab4f37df | [
"BSD-3-Clause"
] | 7 | 2021-04-27T12:14:42.000Z | 2021-11-17T08:31:19.000Z | chapter10/image.py | atac-bham/pychapter10 | 292f15162d4a637144ab0e64ed7215a4ab4f37df | [
"BSD-3-Clause"
] | 26 | 2020-07-20T21:28:57.000Z | 2022-02-17T13:36:03.000Z | chapter10/image.py | atac-bham/pychapter10 | 292f15162d4a637144ab0e64ed7215a4ab4f37df | [
"BSD-3-Clause"
] | null | null | null |
from .util import BitFormat
from . import packet
__all__ = ('ImageF0', 'ImageF1', 'ImageF2')
class ImageMessage:
def __repr__(self):
return '<Image Segment>'
class ImageF0(packet.Packet):
"""Image data
.. py:attribute:: segment_length
.. py:attribute:: iph
.. py:attribute:: sum
... | 23.912752 | 78 | 0.572551 |
from .util import BitFormat
from . import packet
__all__ = ('ImageF0', 'ImageF1', 'ImageF2')
class ImageMessage:
def __repr__(self):
return '<Image Segment>'
class ImageF0(packet.Packet):
csdw_format = BitFormat('''
u27 length
u1 iph
u3 sum
u3 parts''')
clas... | true | true |
f70524fefa5302b732e4c8435ba2d80c5c960673 | 3,066 | py | Python | SDWLE/cards_copy/heroes.py | jomyhuang/sdwle | 9b6e916567e09c7cba4a171fe0adf0f47009a8c3 | [
"MIT"
] | null | null | null | SDWLE/cards_copy/heroes.py | jomyhuang/sdwle | 9b6e916567e09c7cba4a171fe0adf0f47009a8c3 | [
"MIT"
] | null | null | null | SDWLE/cards_copy/heroes.py | jomyhuang/sdwle | 9b6e916567e09c7cba4a171fe0adf0f47009a8c3 | [
"MIT"
] | null | null | null | from SDWLE.cards.base import HeroCard
from SDWLE.constants import CHARACTER_CLASS, MINION_TYPE
from SDWLE.powers import MagePower, DruidPower, HunterPower, PaladinPower, PriestPower, RoguePower,\
ShamanPower, WarlockPower, WarriorPower, JaraxxusPower, DieInsect
class Malfurion(HeroCard):
def __init__(self):
... | 30.356436 | 104 | 0.660144 | from SDWLE.cards.base import HeroCard
from SDWLE.constants import CHARACTER_CLASS, MINION_TYPE
from SDWLE.powers import MagePower, DruidPower, HunterPower, PaladinPower, PriestPower, RoguePower,\
ShamanPower, WarlockPower, WarriorPower, JaraxxusPower, DieInsect
class Malfurion(HeroCard):
def __init__(self):
... | true | true |
f705257c65c84a3ef53edac3abe051b1978185f8 | 2,667 | py | Python | glove/corpus.py | thibaultprouteau/glove-python | 749494290fdfd24379dcc2e244c583ee61808634 | [
"Apache-2.0"
] | 1,148 | 2015-01-01T02:27:31.000Z | 2022-03-31T17:16:05.000Z | glove/corpus.py | thibaultprouteau/glove-python | 749494290fdfd24379dcc2e244c583ee61808634 | [
"Apache-2.0"
] | 78 | 2015-01-01T10:18:54.000Z | 2021-08-06T06:53:24.000Z | glove/corpus.py | thibaultprouteau/glove-python | 749494290fdfd24379dcc2e244c583ee61808634 | [
"Apache-2.0"
] | 352 | 2015-01-02T06:01:17.000Z | 2022-03-22T12:21:51.000Z | # Cooccurrence matrix construction tools
# for fitting the GloVe model.
import numpy as np
try:
# Python 2 compat
import cPickle as pickle
except ImportError:
import pickle
from .corpus_cython import construct_cooccurrence_matrix
class Corpus(object):
"""
Class for constructing a cooccurrence mat... | 32.52439 | 82 | 0.558305 |
import numpy as np
try:
import cPickle as pickle
except ImportError:
import pickle
from .corpus_cython import construct_cooccurrence_matrix
class Corpus(object):
def __init__(self, dictionary=None):
self.dictionary = {}
self.dictionary_supplied = False
self.matrix = None
... | true | true |
f7052ac37e1c8ecd7b7eb4f960efd1bcda7a3958 | 8,320 | py | Python | action-baseline/evaluation/get_ava_performance.py | leaderj1001/Action-Localization | 04d972e6dc3c07d347c70893723d91487c1c8cbd | [
"MIT"
] | 24 | 2019-07-10T15:13:27.000Z | 2021-07-08T12:12:40.000Z | action-baseline/evaluation/get_ava_performance.py | leaderj1001/Action-Localization | 04d972e6dc3c07d347c70893723d91487c1c8cbd | [
"MIT"
] | 7 | 2019-10-06T12:22:04.000Z | 2020-04-15T13:14:10.000Z | action-baseline/evaluation/get_ava_performance.py | leaderj1001/Action-Localization | 04d972e6dc3c07d347c70893723d91487c1c8cbd | [
"MIT"
] | 4 | 2019-10-31T09:01:15.000Z | 2021-03-26T04:20:21.000Z | r"""Compute action detection performance for the AVA dataset.
Please send any questions about this code to the Google Group ava-dataset-users:
https://groups.google.com/forum/#!forum/ava-dataset-users
Example usage:
python -O get_ava_performance.py \
-l ava/ava_action_list_v2.1_for_activitynet_2018.pbtxt.txt \
-g... | 33.548387 | 98 | 0.679688 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
from collections import defaultdict
import csv
import heapq
import logging
import pprint
import sys
import time
import numpy as np
from evaluation.ava import object_detection_evaluation
from e... | true | true |
f7052b09a9ff46196bd8601792bc9ccca71459ca | 192 | py | Python | IdentityAccessManager/__init__.py | silop4all/iam | 691316ca9ea7d3d10a3197b4d028e44e333c7060 | [
"Apache-2.0"
] | 2 | 2018-02-27T20:51:08.000Z | 2019-11-25T10:11:59.000Z | IdentityAccessManager/__init__.py | silop4all/iam | 691316ca9ea7d3d10a3197b4d028e44e333c7060 | [
"Apache-2.0"
] | null | null | null | IdentityAccessManager/__init__.py | silop4all/iam | 691316ca9ea7d3d10a3197b4d028e44e333c7060 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
# This will make sure the app is always imported when
# Django starts so that shared_task will use this app.
from .celery import app as celery_app
| 32 | 55 | 0.786458 | from __future__ import absolute_import
from .celery import app as celery_app
| true | true |
f7052baf507e53e8f68e20a709510cb920844c03 | 11,928 | py | Python | aiopynoon/noon.py | alistairg/aiopynoon | f1340bd6a56de661e09f9f90fb28c331df2d5653 | [
"MIT"
] | 1 | 2020-06-18T06:29:40.000Z | 2020-06-18T06:29:40.000Z | aiopynoon/noon.py | alistairg/aiopynoon | f1340bd6a56de661e09f9f90fb28c331df2d5653 | [
"MIT"
] | null | null | null | aiopynoon/noon.py | alistairg/aiopynoon | f1340bd6a56de661e09f9f90fb28c331df2d5653 | [
"MIT"
] | null | null | null | import logging
import asyncio
from asyncio import CancelledError
from aiohttp import ClientSession, WSMsgType, ClientTimeout, WSServerHandshakeError
import json
import datetime
import traceback
import typing
from .const import (
LOGIN_URL,
DEX_URL,
Guid
)
from .space import NoonSpace
from .line import NoonL... | 38.980392 | 165 | 0.597082 | import logging
import asyncio
from asyncio import CancelledError
from aiohttp import ClientSession, WSMsgType, ClientTimeout, WSServerHandshakeError
import json
import datetime
import traceback
import typing
from .const import (
LOGIN_URL,
DEX_URL,
Guid
)
from .space import NoonSpace
from .line import NoonL... | true | true |
f7052c1b310c4f6ff723bac7bb1d25d4a354f20d | 6,206 | py | Python | tools/train_net.py | lxtGH/cvpods-1 | fb61b6a63dfa65b21a782a4fc7e15a88ce018c51 | [
"Apache-2.0"
] | 1 | 2021-04-24T17:01:29.000Z | 2021-04-24T17:01:29.000Z | tools/train_net.py | wondervictor/cvpods | 614a975e5425bbaeb66bbd1ffca552d633ba89ca | [
"Apache-2.0"
] | null | null | null | tools/train_net.py | wondervictor/cvpods | 614a975e5425bbaeb66bbd1ffca552d633ba89ca | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
# Modified by BaseDetection, Inc. and its affiliates. All Rights Reserved
"""
Detection Training Script.
This scripts reads a given config file and runs the training or evaluation.
It is an entry point that is made to train standard models in cvpod... | 36.505882 | 100 | 0.679987 |
import logging
import os
import pickle as pkl
import sys
from collections import OrderedDict
from colorama import Fore, Style
import torch
from cvpods.checkpoint import DetectionCheckpointer
from cvpods.engine import DefaultTrainer, default_argument_parser, default_setup, hooks, launch
from cvpods.evaluation import... | true | true |
f7052ff86a7ae193a4261efa32bdb7d04b30b4c6 | 362 | py | Python | core/migrations/0073_rename_name_lt_product_name.py | Nephrolog-lt/nephrolog-api | ccd2162aff02b2abfab0f285779e5d8457be1788 | [
"Apache-2.0"
] | 2 | 2020-12-17T13:50:42.000Z | 2021-01-09T07:01:07.000Z | core/migrations/0073_rename_name_lt_product_name.py | Nephrolog-lt/nephrolog-api | ccd2162aff02b2abfab0f285779e5d8457be1788 | [
"Apache-2.0"
] | 2 | 2021-08-25T05:02:56.000Z | 2022-01-16T18:29:49.000Z | core/migrations/0073_rename_name_lt_product_name.py | Nephrolog-lt/nephrolog-api | ccd2162aff02b2abfab0f285779e5d8457be1788 | [
"Apache-2.0"
] | 1 | 2020-11-16T01:40:15.000Z | 2020-11-16T01:40:15.000Z | # Generated by Django 3.2.3 on 2021-05-17 16:22
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0072_alter_product_region'),
]
operations = [
migrations.RenameField(
model_name='product',
old_name='name_lt',
... | 19.052632 | 47 | 0.582873 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0072_alter_product_region'),
]
operations = [
migrations.RenameField(
model_name='product',
old_name='name_lt',
new_name='name',
),
]
| true | true |
f705308018a1ffa77d87e188b5c43d4d6f2d194a | 18,888 | py | Python | wplay/utils/target_search.py | payal-98/whatsapp-play | 3d667ee26c2ef6c29a12a5338e22ec9f8458a55c | [
"MIT"
] | 1 | 2020-03-25T12:25:40.000Z | 2020-03-25T12:25:40.000Z | wplay/utils/target_search.py | payal-98/whatsapp-play | 3d667ee26c2ef6c29a12a5338e22ec9f8458a55c | [
"MIT"
] | null | null | null | wplay/utils/target_search.py | payal-98/whatsapp-play | 3d667ee26c2ef6c29a12a5338e22ec9f8458a55c | [
"MIT"
] | null | null | null | __author__ = 'Alexandre Calil Martins Fonseca, github: xandao6'
# region TUTORIAL
'''
Go to region 'FOR SCRIPTING' and use the methods in your script!
EXAMPLE OF USAGE:
from wplay.pyppeteerUtils import pyppeteerConfig as pypConfig
from wplay.pyppeteerUtils import pyppeteerSearch as pypSearch
async def my_script(tar... | 38.94433 | 189 | 0.72194 | __author__ = 'Alexandre Calil Martins Fonseca, github: xandao6'
from wplay.utils.helpers import whatsapp_selectors_dict
from wplay.utils import Logger
from wplay.utils.helpers import logs_path
from pyppeteer.errors import ElementHandleError
async def search_and_select_target(page, target, hide_groups=False):... | true | true |
f7053131cfb854f87cef18f6a13009e7cb2dedd0 | 349 | py | Python | 21 Others/BEG.py | XuuRee/python-data-structures | a3972f5781d666d15d61c0d474877880d1b7c483 | [
"MIT"
] | null | null | null | 21 Others/BEG.py | XuuRee/python-data-structures | a3972f5781d666d15d61c0d474877880d1b7c483 | [
"MIT"
] | null | null | null | 21 Others/BEG.py | XuuRee/python-data-structures | a3972f5781d666d15d61c0d474877880d1b7c483 | [
"MIT"
] | null | null | null | def beg(arr):
a = []
b = []
c = []
for i in arr:
if i == 0:
a.append(i)
if i == 1:
b.append(i)
if i == 2:
c.append(i)
return a+b+c
a = []
b = [0,0,0]
c = [1,2,1,1,2,1,2]
d = [0,2,1,0,1,0,2,2,2,1,0,2,1,0,1,2,0]
print(beg(a))
print(beg(b)... | 14.541667 | 39 | 0.381089 | def beg(arr):
a = []
b = []
c = []
for i in arr:
if i == 0:
a.append(i)
if i == 1:
b.append(i)
if i == 2:
c.append(i)
return a+b+c
a = []
b = [0,0,0]
c = [1,2,1,1,2,1,2]
d = [0,2,1,0,1,0,2,2,2,1,0,2,1,0,1,2,0]
print(beg(a))
print(beg(b)... | true | true |
f7053142d8894d29c2b779e200a2ae10343b6829 | 138 | py | Python | modules/msa/msa/contrib/master/apps.py | haoyutan/MSA-Framework | 7c5553b244347f26029729161e15e60b0cc805f5 | [
"MIT"
] | 2 | 2016-11-22T11:44:52.000Z | 2017-08-29T02:38:01.000Z | modules/msa/msa/contrib/master/apps.py | haoyutan/MSA-Framework | 7c5553b244347f26029729161e15e60b0cc805f5 | [
"MIT"
] | null | null | null | modules/msa/msa/contrib/master/apps.py | haoyutan/MSA-Framework | 7c5553b244347f26029729161e15e60b0cc805f5 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class MasterAppConfig(AppConfig):
name = 'msa.contrib.master'
verbose_name = 'Master Service'
| 19.714286 | 35 | 0.746377 | from django.apps import AppConfig
class MasterAppConfig(AppConfig):
name = 'msa.contrib.master'
verbose_name = 'Master Service'
| true | true |
f70531491a4fe1bfff0ca5ec957d7f9cd2f74762 | 8,381 | py | Python | quetz_frontend/cli.py | hbcarlos/quetz-frontend | 86a41de3a3e05c4c324bf2c5f2d4dda76a4fa3ce | [
"BSD-3-Clause"
] | null | null | null | quetz_frontend/cli.py | hbcarlos/quetz-frontend | 86a41de3a3e05c4c324bf2c5f2d4dda76a4fa3ce | [
"BSD-3-Clause"
] | null | null | null | quetz_frontend/cli.py | hbcarlos/quetz-frontend | 86a41de3a3e05c4c324bf2c5f2d4dda76a4fa3ce | [
"BSD-3-Clause"
] | null | null | null | import importlib
import json
import os
import shutil
import subprocess
from pathlib import Path
from shutil import which
from typing import List, Optional, Tuple
from setuptools import find_packages
from typer import Argument, Option, Typer
from .paths import (
GLOBAL_APP_DIR,
GLOBAL_EXTENSIONS_DIR,
GLOBA... | 26.862179 | 88 | 0.65386 | import importlib
import json
import os
import shutil
import subprocess
from pathlib import Path
from shutil import which
from typing import List, Optional, Tuple
from setuptools import find_packages
from typer import Argument, Option, Typer
from .paths import (
GLOBAL_APP_DIR,
GLOBAL_EXTENSIONS_DIR,
GLOBA... | true | true |
f70531e2ad32c627bf6d2ee9773984e911b06c5b | 192 | py | Python | socorepo/locators/__init__.py | LoadingByte/socorepo | c0880d3ad55c9d8f8aab53f5cc16600661c10c2b | [
"MIT"
] | null | null | null | socorepo/locators/__init__.py | LoadingByte/socorepo | c0880d3ad55c9d8f8aab53f5cc16600661c10c2b | [
"MIT"
] | null | null | null | socorepo/locators/__init__.py | LoadingByte/socorepo | c0880d3ad55c9d8f8aab53f5cc16600661c10c2b | [
"MIT"
] | null | null | null | from socorepo.locators import github_tags, nexus3, pypi
LOCATOR_PARSERS = {
"github_tags": github_tags.parse_locator,
"nexus3": nexus3.parse_locator,
"pypi": pypi.parse_locator
}
| 24 | 55 | 0.744792 | from socorepo.locators import github_tags, nexus3, pypi
LOCATOR_PARSERS = {
"github_tags": github_tags.parse_locator,
"nexus3": nexus3.parse_locator,
"pypi": pypi.parse_locator
}
| true | true |
f705329421c3a54d538ba279a1d4c9007a13943a | 3,953 | py | Python | stopWords.py | AninditaBasu/mattermost-hackathon-stopWords | 11781ee3f89bf66ebd9c2b11162a588a98b237b6 | [
"MIT"
] | 2 | 2019-11-25T19:22:24.000Z | 2020-07-07T04:54:50.000Z | stopWords.py | AninditaBasu/mattermost-hackathon-stopWords | 11781ee3f89bf66ebd9c2b11162a588a98b237b6 | [
"MIT"
] | null | null | null | stopWords.py | AninditaBasu/mattermost-hackathon-stopWords | 11781ee3f89bf66ebd9c2b11162a588a98b237b6 | [
"MIT"
] | null | null | null | from flask import Flask, render_template, request
import json
import requests
app = Flask(__name__)
@app.route('/')
def stop_words():
URL_prefix = 'https://api.github.com/search/code?q='
URL_suffix = '+repo:spotify/mkdocs-monorepo-plugin/docs'
reportfile = open('./templates/stopWordsSearch.html', 'w')
... | 47.059524 | 203 | 0.589679 | from flask import Flask, render_template, request
import json
import requests
app = Flask(__name__)
@app.route('/')
def stop_words():
URL_prefix = 'https://api.github.com/search/code?q='
URL_suffix = '+repo:spotify/mkdocs-monorepo-plugin/docs'
reportfile = open('./templates/stopWordsSearch.html', 'w')
... | true | true |
f705330137e0d77aaa9e47ecb94b760f7a854733 | 2,916 | py | Python | django/contrib/contenttypes/management.py | KingWapo/django | 115c307184d441fbc27a8f43a99af5d992cfcc13 | [
"BSD-3-Clause"
] | 2 | 2015-01-21T15:45:07.000Z | 2015-02-21T02:38:13.000Z | env/lib/python2.7/site-packages/django/contrib/contenttypes/management.py | luiscarlosgph/nas | e5acee61e8bbf12c34785fe971ce7df8dee775d4 | [
"MIT"
] | 10 | 2019-12-26T17:31:31.000Z | 2022-03-21T22:17:33.000Z | env/lib/python2.7/site-packages/django/contrib/contenttypes/management.py | luiscarlosgph/nas | e5acee61e8bbf12c34785fe971ce7df8dee775d4 | [
"MIT"
] | 1 | 2021-03-06T14:22:00.000Z | 2021-03-06T14:22:00.000Z | from django.apps import apps
from django.db import DEFAULT_DB_ALIAS, router
from django.db.models import signals
from django.utils.encoding import smart_text
from django.utils import six
from django.utils.six.moves import input
def update_contenttypes(app_config, verbosity=2, interactive=True, using=DEFAULT_DB_ALIAS,... | 29.16 | 101 | 0.63546 | from django.apps import apps
from django.db import DEFAULT_DB_ALIAS, router
from django.db.models import signals
from django.utils.encoding import smart_text
from django.utils import six
from django.utils.six.moves import input
def update_contenttypes(app_config, verbosity=2, interactive=True, using=DEFAULT_DB_ALIAS,... | true | true |
f705330f398c68077399fd500653c9cafa921704 | 4,870 | py | Python | parlai/mturk/tasks/personachat/personachat_chat/run.py | khaimaitien/Mai_convai2 | 83bf99ba09d678455aad49239f3daefc5a7b8fc9 | [
"BSD-3-Clause"
] | 1 | 2018-09-28T05:47:45.000Z | 2018-09-28T05:47:45.000Z | parlai/mturk/tasks/personachat/personachat_chat/run.py | crazyrex/ParlAI | fbfda4f4aadd357dfdb7b4baf230c45c039a1338 | [
"BSD-3-Clause"
] | 1 | 2018-09-27T17:11:24.000Z | 2018-09-27T17:11:24.000Z | parlai/mturk/tasks/personachat/personachat_chat/run.py | khaimaitien/Mai_convai2 | 83bf99ba09d678455aad49239f3daefc5a7b8fc9 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
fro... | 38.650794 | 150 | 0.626489 |
from parlai.core.params import ParlaiParser
from parlai.mturk.core.mturk_manager import MTurkManager
from worlds import \
PersonaChatWorld, PersonaProfileWorld, PersonasGenerator
from task_config import task_config
import os
def main():
argparser = ParlaiParser(False, False)
argparser.add_parlai_d... | true | true |
f705343bf3fc1ba799d2ebee62971a89002e3bcf | 2,523 | py | Python | Ch_03/LogisticRegression.py | RafaelSouza94/Python_Machine_Learning | 5b150613410ddc64a61690f232ec61751744fa41 | [
"MIT"
] | null | null | null | Ch_03/LogisticRegression.py | RafaelSouza94/Python_Machine_Learning | 5b150613410ddc64a61690f232ec61751744fa41 | [
"MIT"
] | null | null | null | Ch_03/LogisticRegression.py | RafaelSouza94/Python_Machine_Learning | 5b150613410ddc64a61690f232ec61751744fa41 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Logistic Regression Gradient Descent
"""
import numpy as np
class LogisticRegressionGD(object):
"""Logistic Regression Classifier using gradient descent.
Parameters
------------
eta : float
Learning rate (between 0.0 and 1.0)
n_iter :... | 30.035714 | 63 | 0.52279 |
import numpy as np
class LogisticRegressionGD(object):
def __init__(self, eta=0.05, n_iter=100, random_state=1):
self.eta = eta
self.n_iter = n_iter
self.random_state = random_state
def fit(self, X, y):
rgen = np.random.RandomState(self.random_state)
self.w_ = rg... | true | true |
f705365fe4791c97b8b3d6bace419ef73911d813 | 1,149 | py | Python | airflow/hooks/mysql_hook.py | dorranh/airflow | 1a9a2cadcf8606cfcb729d1323dd33dfacc64633 | [
"Apache-2.0"
] | 5 | 2020-07-17T07:33:58.000Z | 2022-03-02T06:23:47.000Z | airflow/hooks/mysql_hook.py | dorranh/airflow | 1a9a2cadcf8606cfcb729d1323dd33dfacc64633 | [
"Apache-2.0"
] | 7 | 2020-06-03T14:55:17.000Z | 2021-12-30T00:01:50.000Z | airflow/hooks/mysql_hook.py | dorranh/airflow | 1a9a2cadcf8606cfcb729d1323dd33dfacc64633 | [
"Apache-2.0"
] | 12 | 2020-01-09T14:02:39.000Z | 2022-01-24T07:18:51.000Z | # -*- coding: utf-8 -*-
#
# 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
#... | 38.3 | 83 | 0.761532 |
import warnings
from airflow.providers.mysql.hooks.mysql import MySqlHook
warnings.warn(
"This module is deprecated. Please use `airflow.providers.mysql.hooks.mysql`.",
DeprecationWarning, stacklevel=2
)
| true | true |
f705371ad450409a7a5a8779c94a8bb544f9b844 | 114,476 | py | Python | pyInstaller/plotly/graph_objs/treemap/__init__.py | rianawillers/dash-lineplot | b72c3e4799d39bdc33bbcae2202fdefd6f4af00e | [
"MIT"
] | 2 | 2019-11-08T07:01:11.000Z | 2019-11-17T10:10:49.000Z | pyInstaller/plotly/graph_objs/treemap/__init__.py | rianawillers/dash-lineplot | b72c3e4799d39bdc33bbcae2202fdefd6f4af00e | [
"MIT"
] | 12 | 2020-06-06T01:22:26.000Z | 2022-03-12T00:13:42.000Z | pyInstaller/plotly/graph_objs/treemap/__init__.py | rianawillers/dash-lineplot | b72c3e4799d39bdc33bbcae2202fdefd6f4af00e | [
"MIT"
] | 17 | 2019-11-21T14:11:29.000Z | 2019-11-21T15:26:23.000Z | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Tiling(_BaseTraceHierarchyType):
# flip
# ----
@property
def flip(self):
"""
Determines if the positions obtained from solver are flipped on
each axis.
Th... | 35.408599 | 87 | 0.556737 | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Tiling(_BaseTraceHierarchyType):
@property
def flip(self):
return self["flip"]
@flip.setter
def flip(self, val):
self["flip"] = val
@property
def... | true | true |
f705372d8ae86131f8816526842556b71e7b9ae5 | 337 | py | Python | insta/urls.py | osman2491/Insta | f941f2b20f814e1c13fe0f9c02a1a60be3cd2c87 | [
"MIT"
] | null | null | null | insta/urls.py | osman2491/Insta | f941f2b20f814e1c13fe0f9c02a1a60be3cd2c87 | [
"MIT"
] | 2 | 2021-06-10T22:33:39.000Z | 2021-09-08T01:39:21.000Z | insta/urls.py | osman2491/Insta | f941f2b20f814e1c13fe0f9c02a1a60be3cd2c87 | [
"MIT"
] | null | null | null | from django.conf.urls import url,include
from django.contrib import admin
from django.contrib.auth import views
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'',include('instagram.urls')),
url(r'^accounts/', include('registration.backends.simple.urls')),
url(r'^logout/$', views.logout, {"next... | 33.7 | 69 | 0.682493 | from django.conf.urls import url,include
from django.contrib import admin
from django.contrib.auth import views
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'',include('instagram.urls')),
url(r'^accounts/', include('registration.backends.simple.urls')),
url(r'^logout/$', views.logout, {"next... | true | true |
f705378db8f82576f4e65044784728515b32f0c3 | 10,546 | py | Python | vfm.py | jilljenn/vfm | 4cb2f5157ee7301321bb4babedb62223a720d231 | [
"MIT"
] | null | null | null | vfm.py | jilljenn/vfm | 4cb2f5157ee7301321bb4babedb62223a720d231 | [
"MIT"
] | null | null | null | vfm.py | jilljenn/vfm | 4cb2f5157ee7301321bb4babedb62223a720d231 | [
"MIT"
] | 1 | 2020-01-15T07:06:52.000Z | 2020-01-15T07:06:52.000Z | import chainer
from chainer import training
from chainer.training import extensions
from chainer.datasets import TupleDataset
from chainer import Chain
from chainer import links as L
from chainer import functions as F
from chainer import reporter
from chainer import cuda
import numpy as np
def dot(a, b):
""" Sim... | 39.94697 | 79 | 0.592737 | import chainer
from chainer import training
from chainer.training import extensions
from chainer.datasets import TupleDataset
from chainer import Chain
from chainer import links as L
from chainer import functions as F
from chainer import reporter
from chainer import cuda
import numpy as np
def dot(a, b):
return ... | true | true |
f70537ece98c2114c69c2bae94f8b653352137eb | 1,406 | py | Python | cruft/_commands/check.py | lkubb/cruft | 0c6de85d974197969c0e65913857eaa36b788e5e | [
"MIT"
] | 293 | 2020-08-18T05:52:45.000Z | 2022-03-31T20:39:43.000Z | cruft/_commands/check.py | lkubb/cruft | 0c6de85d974197969c0e65913857eaa36b788e5e | [
"MIT"
] | 102 | 2020-08-28T16:38:34.000Z | 2022-03-31T11:01:41.000Z | cruft/_commands/check.py | lkubb/cruft | 0c6de85d974197969c0e65913857eaa36b788e5e | [
"MIT"
] | 36 | 2020-08-28T16:34:10.000Z | 2022-03-31T21:55:53.000Z | import json
from pathlib import Path
from typing import Optional
import typer
from . import utils
from .utils import example
from .utils.iohelper import AltTemporaryDirectory
@example()
def check(
project_dir: Path = Path("."), checkout: Optional[str] = None, strict: bool = True
) -> bool:
"""Checks to see ... | 32.697674 | 97 | 0.619488 | import json
from pathlib import Path
from typing import Optional
import typer
from . import utils
from .utils import example
from .utils.iohelper import AltTemporaryDirectory
@example()
def check(
project_dir: Path = Path("."), checkout: Optional[str] = None, strict: bool = True
) -> bool:
cruft_file = util... | true | true |
f70538f65e8861717efd58fa60cfc24ef08b2d0d | 3,288 | py | Python | tests/components/zha/test_switch.py | Squixx/home-assistant | 152997e7589d3bad63181ca78cc296f54ae25aa2 | [
"Apache-2.0"
] | null | null | null | tests/components/zha/test_switch.py | Squixx/home-assistant | 152997e7589d3bad63181ca78cc296f54ae25aa2 | [
"Apache-2.0"
] | null | null | null | tests/components/zha/test_switch.py | Squixx/home-assistant | 152997e7589d3bad63181ca78cc296f54ae25aa2 | [
"Apache-2.0"
] | null | null | null | """Test zha switch."""
from unittest.mock import call, patch
import pytest
import zigpy.zcl.clusters.general as general
import zigpy.zcl.foundation as zcl_f
from homeassistant.components.switch import DOMAIN
from homeassistant.const import STATE_OFF, STATE_ON, STATE_UNAVAILABLE
from .common import (
async_enable... | 31.615385 | 83 | 0.687956 | from unittest.mock import call, patch
import pytest
import zigpy.zcl.clusters.general as general
import zigpy.zcl.foundation as zcl_f
from homeassistant.components.switch import DOMAIN
from homeassistant.const import STATE_OFF, STATE_ON, STATE_UNAVAILABLE
from .common import (
async_enable_traffic,
find_enti... | true | true |
f7053ab01509c24ced03b369dae6ac255d9ca094 | 4,288 | py | Python | dp_conceptual_search/api/search/routes.py | flaxandteal/dp-conceptual-search | 16c6383a61ba5b7069337c2626a0dc243bfe9d35 | [
"MIT"
] | null | null | null | dp_conceptual_search/api/search/routes.py | flaxandteal/dp-conceptual-search | 16c6383a61ba5b7069337c2626a0dc243bfe9d35 | [
"MIT"
] | null | null | null | dp_conceptual_search/api/search/routes.py | flaxandteal/dp-conceptual-search | 16c6383a61ba5b7069337c2626a0dc243bfe9d35 | [
"MIT"
] | null | null | null | """
This file contains all routes for the /search API
"""
from sanic import Blueprint
from sanic.response import HTTPResponse
from dp4py_sanic.api.response.json_response import json
from dp_conceptual_search.config import CONFIG
from dp_conceptual_search.api.request import ONSRequest
from dp_conceptual_search.ons.sea... | 34.304 | 90 | 0.752332 | from sanic import Blueprint
from sanic.response import HTTPResponse
from dp4py_sanic.api.response.json_response import json
from dp_conceptual_search.config import CONFIG
from dp_conceptual_search.api.request import ONSRequest
from dp_conceptual_search.ons.search.index import Index
from dp_conceptual_search.ons.searc... | true | true |
f7053bc53f930cd972b3fb116080db388c2bf1b4 | 562 | py | Python | common_utils/log_decorator.py | beansKingdom/CommonUtils | 85f658671ddc6d52dc65e8d8c8bec5474a97a19f | [
"MIT"
] | null | null | null | common_utils/log_decorator.py | beansKingdom/CommonUtils | 85f658671ddc6d52dc65e8d8c8bec5474a97a19f | [
"MIT"
] | 4 | 2020-03-24T17:40:50.000Z | 2021-06-02T00:25:27.000Z | common_utils/log_decorator.py | beansKingdom/CommonUtils | 85f658671ddc6d52dc65e8d8c8bec5474a97a19f | [
"MIT"
] | null | null | null | # -*- coding: UTF-8 -*-
from common_utils.new_log import NewLog
class LogDecorator:
log = NewLog(__name__)
logger = log.get_log()
def __call__(self, func):
def wrapper(*args, **kw):
self.logger.debug("call method %s ===============" % func.__name__)
self.logger.debug("me... | 29.578947 | 100 | 0.553381 |
from common_utils.new_log import NewLog
class LogDecorator:
log = NewLog(__name__)
logger = log.get_log()
def __call__(self, func):
def wrapper(*args, **kw):
self.logger.debug("call method %s ===============" % func.__name__)
self.logger.debug("method [%s] input args: [... | true | true |
f7053c939c0ae2e74aeebb8a418132b816d2cc31 | 6,017 | py | Python | lib/lambdascrapers/sources_incursion/en_incursion-1.20(final)/ultrahd.py | proxium/script.module.lambdascrapers | f96ad4c7c44c011c9d0007a83edde8c4797e0e2f | [
"Beerware"
] | 11 | 2018-12-21T22:52:37.000Z | 2021-09-02T02:13:50.000Z | lib/lambdascrapers/sources_incursion/en_incursion-1.20(final)/ultrahd.py | proxium/script.module.lambdascrapers | f96ad4c7c44c011c9d0007a83edde8c4797e0e2f | [
"Beerware"
] | null | null | null | lib/lambdascrapers/sources_incursion/en_incursion-1.20(final)/ultrahd.py | proxium/script.module.lambdascrapers | f96ad4c7c44c011c9d0007a83edde8c4797e0e2f | [
"Beerware"
] | 1 | 2020-02-01T19:52:36.000Z | 2020-02-01T19:52:36.000Z | # -*- coding: utf-8 -*-
'''
Covenant Add-on
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
... | 41.784722 | 127 | 0.442081 |
import re,urllib,urlparse
from resources.lib.modules import cleantitle
from resources.lib.modules import client
from resources.lib.modules import debrid
from resources.lib.modules import source_utils
from resources.lib.modules import dom_parser2
class source:
def __init__(self):
self.priori... | true | true |
f7053cb96e078cbb641803774c57e3d6c47395cc | 5,903 | py | Python | src/_repobee/disthelpers.py | tohanss/repobee | cf5eb1e83e62c20bbca00c8ad9f798a612e1664f | [
"MIT"
] | null | null | null | src/_repobee/disthelpers.py | tohanss/repobee | cf5eb1e83e62c20bbca00c8ad9f798a612e1664f | [
"MIT"
] | null | null | null | src/_repobee/disthelpers.py | tohanss/repobee | cf5eb1e83e62c20bbca00c8ad9f798a612e1664f | [
"MIT"
] | null | null | null | """Helper functions for the distribution."""
import importlib
import json
import pathlib
import subprocess
import sys
import types
import os
from typing import Optional, List
import requests
import repobee_plug as plug
import _repobee.ext
from _repobee import distinfo
from _repobee import plugin
class DependencyRe... | 32.256831 | 79 | 0.671015 | import importlib
import json
import pathlib
import subprocess
import sys
import types
import os
from typing import Optional, List
import requests
import repobee_plug as plug
import _repobee.ext
from _repobee import distinfo
from _repobee import plugin
class DependencyResolutionError(plug.PlugError):
def get_inst... | true | true |
f7053dfef19a421a63c39a67f749f72d485326f3 | 440 | py | Python | ratings-counter.py | csagar131/pyspark-scripts | 7357baa1dc5499149e4e1041768827eee6209804 | [
"Apache-2.0"
] | null | null | null | ratings-counter.py | csagar131/pyspark-scripts | 7357baa1dc5499149e4e1041768827eee6209804 | [
"Apache-2.0"
] | null | null | null | ratings-counter.py | csagar131/pyspark-scripts | 7357baa1dc5499149e4e1041768827eee6209804 | [
"Apache-2.0"
] | null | null | null | from pyspark import SparkConf, SparkContext
import collections
conf = SparkConf().setMaster("local").setAppName("RatingsHistogram")
sc = SparkContext(conf = conf)
lines = sc.textFile("D:/celebal/resources/ml-100k/u.data")
ratings = lines.map(lambda x: x.split()[2])
result = ratings.countByValue()
sortedResults = col... | 31.428571 | 68 | 0.738636 | from pyspark import SparkConf, SparkContext
import collections
conf = SparkConf().setMaster("local").setAppName("RatingsHistogram")
sc = SparkContext(conf = conf)
lines = sc.textFile("D:/celebal/resources/ml-100k/u.data")
ratings = lines.map(lambda x: x.split()[2])
result = ratings.countByValue()
sortedResults = col... | true | true |
f705402b1b08aa6730ba341cc50c68502d1b99d6 | 17,851 | py | Python | tests/test_scheduler.py | atlas555/pyspider | 8f71e0e8d67f03a728cd5ea48fa931f6415e1e10 | [
"Apache-2.0"
] | 5 | 2015-03-31T13:25:25.000Z | 2016-03-14T11:17:02.000Z | tests/test_scheduler.py | e-dorigatti/pyspider | 8f71e0e8d67f03a728cd5ea48fa931f6415e1e10 | [
"Apache-2.0"
] | null | null | null | tests/test_scheduler.py | e-dorigatti/pyspider | 8f71e0e8d67f03a728cd5ea48fa931f6415e1e10 | [
"Apache-2.0"
] | 1 | 2016-02-17T23:12:47.000Z | 2016-02-17T23:12:47.000Z | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<i@binux.me>
# http://binux.me
# Created on 2014-02-08 22:37:13
import os
import time
import shutil
import unittest2 as unittest
import logging
import logging.config
logging.config.fileConfig("pyspid... | 30.671821 | 99 | 0.503893 |
import os
import time
import shutil
import unittest2 as unittest
import logging
import logging.config
logging.config.fileConfig("pyspider/logging.conf")
from pyspider.scheduler.task_queue import TaskQueue
class TestTaskQueue(unittest.TestCase):
@classmethod
def setUpClass(self):
self.task_que... | true | true |
f7054098e4be98d0e7ded502ff3e25b7159a4400 | 2,065 | py | Python | profiles_api/models.py | tanveerahmaddar/profiles-rest-api | 1fd5060677bbefd6bb2d02179587a1d8005f3bc1 | [
"MIT"
] | null | null | null | profiles_api/models.py | tanveerahmaddar/profiles-rest-api | 1fd5060677bbefd6bb2d02179587a1d8005f3bc1 | [
"MIT"
] | 5 | 2021-03-19T12:00:14.000Z | 2022-02-10T09:29:53.000Z | profiles_api/models.py | tanveerahmaddar/profiles-rest-api | 1fd5060677bbefd6bb2d02179587a1d8005f3bc1 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import AbstractBaseUser
from django.contrib.auth.models import PermissionsMixin
from django.contrib.auth.models import BaseUserManager
from django.conf import settings
class UserProfileManager(BaseUserManager):
"""Manager for user profiles"""
def c... | 28.287671 | 64 | 0.680872 | from django.db import models
from django.contrib.auth.models import AbstractBaseUser
from django.contrib.auth.models import PermissionsMixin
from django.contrib.auth.models import BaseUserManager
from django.conf import settings
class UserProfileManager(BaseUserManager):
def create_user(self, email, name, passwo... | true | true |
f70541311d2804278f3802c1efeec5ac64b356ca | 41,783 | py | Python | zipline/pipeline/factors/factor.py | degiere/zipline | bc0b117dc94b8e93081818964e3b1bdbf9b33abb | [
"Apache-2.0"
] | null | null | null | zipline/pipeline/factors/factor.py | degiere/zipline | bc0b117dc94b8e93081818964e3b1bdbf9b33abb | [
"Apache-2.0"
] | null | null | null | zipline/pipeline/factors/factor.py | degiere/zipline | bc0b117dc94b8e93081818964e3b1bdbf9b33abb | [
"Apache-2.0"
] | 1 | 2019-09-20T01:08:33.000Z | 2019-09-20T01:08:33.000Z | """
factor.py
"""
from functools import wraps
from operator import attrgetter
from numbers import Number
from numpy import inf, where
from toolz import curry
from zipline.errors import UnknownRankMethod
from zipline.lib.normalize import naive_grouped_rowwise_apply
from zipline.lib.rank import masked_rankdata_2d
from ... | 33.506816 | 79 | 0.604026 | from functools import wraps
from operator import attrgetter
from numbers import Number
from numpy import inf, where
from toolz import curry
from zipline.errors import UnknownRankMethod
from zipline.lib.normalize import naive_grouped_rowwise_apply
from zipline.lib.rank import masked_rankdata_2d
from zipline.pipeline.c... | true | true |
f705417d19cb9869018feb9f86bc6330c83dbbeb | 1,953 | py | Python | secretmanager/api-client/destroy_secret_version.py | m-abba/python-docs-samples | b00f00d734b89edae8ae6876d6261e19dc82cd34 | [
"Apache-2.0"
] | 1 | 2020-03-05T18:24:45.000Z | 2020-03-05T18:24:45.000Z | secretmanager/api-client/destroy_secret_version.py | m-abba/python-docs-samples | b00f00d734b89edae8ae6876d6261e19dc82cd34 | [
"Apache-2.0"
] | 1 | 2022-01-14T23:28:27.000Z | 2022-01-14T23:28:27.000Z | secretmanager/api-client/destroy_secret_version.py | m-abba/python-docs-samples | b00f00d734b89edae8ae6876d6261e19dc82cd34 | [
"Apache-2.0"
] | 2 | 2020-06-07T07:03:00.000Z | 2021-04-10T18:22:25.000Z | #!/usr/bin/env python
# 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 ... | 34.263158 | 79 | 0.752176 |
import argparse
def destroy_secret_version(project_id, secret_id, version_id):
from google.cloud import secretmanager_v1beta1 as secretmanager
client = secretmanager.SecretManagerServiceClient()
name = client.secret_version_path(project_id, secret_id, version_id)
... | true | true |
f70541cbb5540d0c4d4bcc2d81b9b62daf4c08a3 | 13,756 | py | Python | shapely/geometry/polygon.py | tsauerwein/shapely | d0bdd5f99cc8be9ce6a1022ff971fbd5deff2dad | [
"BSD-3-Clause"
] | null | null | null | shapely/geometry/polygon.py | tsauerwein/shapely | d0bdd5f99cc8be9ce6a1022ff971fbd5deff2dad | [
"BSD-3-Clause"
] | null | null | null | shapely/geometry/polygon.py | tsauerwein/shapely | d0bdd5f99cc8be9ce6a1022ff971fbd5deff2dad | [
"BSD-3-Clause"
] | null | null | null | """Polygons and their linear ring components
"""
from ctypes import c_double, c_void_p, cast, POINTER
from ctypes import ArgumentError
import weakref
from shapely.algorithms.cga import signed_area
from shapely.coords import required
from shapely.geos import lgeos
from shapely.geometry.base import BaseGeometry
from sh... | 29.268085 | 81 | 0.557793 |
from ctypes import c_double, c_void_p, cast, POINTER
from ctypes import ArgumentError
import weakref
from shapely.algorithms.cga import signed_area
from shapely.coords import required
from shapely.geos import lgeos
from shapely.geometry.base import BaseGeometry
from shapely.geometry.linestring import LineString, Line... | true | true |
f70541d9d771fb542f9dab03839544e3d44ed928 | 658 | py | Python | TryAPP1.0/condition.py | deepankur797/random | fc7a1ac60d9de08c79bc5f5676705e45531ce6d9 | [
"MIT"
] | null | null | null | TryAPP1.0/condition.py | deepankur797/random | fc7a1ac60d9de08c79bc5f5676705e45531ce6d9 | [
"MIT"
] | null | null | null | TryAPP1.0/condition.py | deepankur797/random | fc7a1ac60d9de08c79bc5f5676705e45531ce6d9 | [
"MIT"
] | null | null | null | x=2
print(x == 2)
print(x == 3)
print(x<3)
#Boolean operators
name = "John"
age = 23
if name == "John" and age == 23:
print("Your name is John, and you are also 23 years old.")
if name == "John" or name == "Rick":
print("Your name is either John or Rick.")
# in operator
#The "in" operator co... | 20.5625 | 124 | 0.612462 | x=2
print(x == 2)
print(x == 3)
print(x<3)
name = "John"
age = 23
if name == "John" and age == 23:
print("Your name is John, and you are also 23 years old.")
if name == "John" or name == "Rick":
print("Your name is either John or Rick.")
mylist=["John","Rick"]
if name in mylist:
pri... | true | true |
f7054235a1553c55fbb86f3ddd8de322b7a8e454 | 1,157 | py | Python | mangaloid_instance/storage/models/chapter.py | compscifag/instance | 449217abcab48cf3bbbb99ed2be9fcfacf2fa92f | [
"MIT"
] | null | null | null | mangaloid_instance/storage/models/chapter.py | compscifag/instance | 449217abcab48cf3bbbb99ed2be9fcfacf2fa92f | [
"MIT"
] | null | null | null | mangaloid_instance/storage/models/chapter.py | compscifag/instance | 449217abcab48cf3bbbb99ed2be9fcfacf2fa92f | [
"MIT"
] | null | null | null | from . import Base
from sqlalchemy import Column, Integer, Text, DateTime, ForeignKey
from datetime import datetime
class Chapter(Base):
__tablename__ = "chapters"
id = Column(Integer, primary_key=True, autoincrement=True)
manga_id = Column(Integer, ForeignKey("manga.id"))
chapter_no = Column(Integer)... | 33.057143 | 66 | 0.615385 | from . import Base
from sqlalchemy import Column, Integer, Text, DateTime, ForeignKey
from datetime import datetime
class Chapter(Base):
__tablename__ = "chapters"
id = Column(Integer, primary_key=True, autoincrement=True)
manga_id = Column(Integer, ForeignKey("manga.id"))
chapter_no = Column(Integer)... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.