hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c240202dc9b987bc5d909de4fbcfbb16804949b | 1,137 | py | Python | office_test_interface/hede_interface_test/testcores/http_create_system.py | yag8009/office_test_team | edf06f3c0818b08ec39541bdcd04bcc537fc9ed1 | [
"MIT"
] | null | null | null | office_test_interface/hede_interface_test/testcores/http_create_system.py | yag8009/office_test_team | edf06f3c0818b08ec39541bdcd04bcc537fc9ed1 | [
"MIT"
] | null | null | null | office_test_interface/hede_interface_test/testcores/http_create_system.py | yag8009/office_test_team | edf06f3c0818b08ec39541bdcd04bcc537fc9ed1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author : yag8009
# @FileName : http_create_system
# @Time : 2020/4/21
import sys
import requests
from public.log import logger
def http_create_system(login_url, login_data, identity, base_url, base_data):
s = requests.session()
# 登录请求
login_url = lo... | 29.153846 | 88 | 0.656992 |
import sys
import requests
from public.log import logger
def http_create_system(login_url, login_data, identity, base_url, base_data):
s = requests.session()
login_url = login_url
header = {"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"}
login_data = dict(login_data)
... | true | true |
1c24023a295cee149df7963c926210db7d905ac8 | 21,830 | py | Python | test/integration/test_kraken_market.py | mehmeta/hummingbot | 0ab56228c87194a64eab0f409e93e6bb74425f4c | [
"Apache-2.0"
] | 2 | 2020-08-30T21:53:59.000Z | 2021-05-17T17:04:44.000Z | test/integration/test_kraken_market.py | mehmeta/hummingbot | 0ab56228c87194a64eab0f409e93e6bb74425f4c | [
"Apache-2.0"
] | null | null | null | test/integration/test_kraken_market.py | mehmeta/hummingbot | 0ab56228c87194a64eab0f409e93e6bb74425f4c | [
"Apache-2.0"
] | 3 | 2020-08-18T16:06:53.000Z | 2020-08-19T08:53:39.000Z | #!/usr/bin/env python
import time
from os import unlink
from os.path import join, realpath
import sys; sys.path.insert(0, realpath(join(__file__, "../../../")))
from hummingbot.market.kraken.kraken_market import KrakenMarket
from hummingbot.market.markets_recorder import MarketsRecorder
from hummingbot.model.sql_conne... | 43.486056 | 124 | 0.6694 |
import time
from os import unlink
from os.path import join, realpath
import sys; sys.path.insert(0, realpath(join(__file__, "../../../")))
from hummingbot.market.kraken.kraken_market import KrakenMarket
from hummingbot.market.markets_recorder import MarketsRecorder
from hummingbot.model.sql_connection_manager import ... | true | true |
1c2402f8c745d325f44ae63aba2e019011db826f | 9,381 | py | Python | bag/mdao/core.py | felixonmars/BAG_framework | 993e7c82418443cf32e4b802d825671b78ec56fe | [
"BSD-3-Clause"
] | 123 | 2017-09-13T08:47:12.000Z | 2022-03-23T20:14:19.000Z | bag/mdao/core.py | felixonmars/BAG_framework | 993e7c82418443cf32e4b802d825671b78ec56fe | [
"BSD-3-Clause"
] | 40 | 2017-11-24T15:10:23.000Z | 2021-07-28T05:37:30.000Z | bag/mdao/core.py | felixonmars/BAG_framework | 993e7c82418443cf32e4b802d825671b78ec56fe | [
"BSD-3-Clause"
] | 73 | 2017-10-09T22:05:32.000Z | 2022-03-01T09:53:11.000Z | # -*- coding: utf-8 -*-
"""This module defines core BAG openmdao classes."""
import numpy as np
import networkx as nx
import openmdao.api as omdao
import bag.util.parse
from .components import VecFunComponent
class GroupBuilder(object):
"""A class that builds new OpenMDAO groups.
This class provides a si... | 34.362637 | 101 | 0.550155 |
import numpy as np
import networkx as nx
import openmdao.api as omdao
import bag.util.parse
from .components import VecFunComponent
class GroupBuilder(object):
def __init__(self):
self._g = nx.DiGraph()
self._input_vars = set()
def _add_node(self, name, ndim, **kwargs):
self._g.... | true | true |
1c240309fa28b6045292b279e2c04418449ba8ae | 1,550 | py | Python | config/urls.py | Newton-Labs/IOT-Service | 038b68f7699c65e88229fe5888ac9fba17c85799 | [
"MIT"
] | null | null | null | config/urls.py | Newton-Labs/IOT-Service | 038b68f7699c65e88229fe5888ac9fba17c85799 | [
"MIT"
] | null | null | null | config/urls.py | Newton-Labs/IOT-Service | 038b68f7699c65e88229fe5888ac9fba17c85799 | [
"MIT"
] | null | null | null | from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.views.generic import TemplateView
from django.views import defaults as default_views
urlpatterns = [
url(r'^$', TemplateView.as_view(template_name='page... | 40.789474 | 110 | 0.695484 | from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.views.generic import TemplateView
from django.views import defaults as default_views
urlpatterns = [
url(r'^$', TemplateView.as_view(template_name='page... | true | true |
1c2404a108ce67d347a54af0755f53f011f6c992 | 1,533 | py | Python | libraries/base/signalClasses/UnstructuredDict.py | PiRSquared17/r-orange | 6bc383f1db3c10c59e16b39daffc44df904ce031 | [
"Apache-2.0"
] | 1 | 2019-04-15T13:50:30.000Z | 2019-04-15T13:50:30.000Z | libraries/base/signalClasses/UnstructuredDict.py | PiRSquared17/r-orange | 6bc383f1db3c10c59e16b39daffc44df904ce031 | [
"Apache-2.0"
] | null | null | null | libraries/base/signalClasses/UnstructuredDict.py | PiRSquared17/r-orange | 6bc383f1db3c10c59e16b39daffc44df904ce031 | [
"Apache-2.0"
] | 1 | 2016-01-21T23:00:21.000Z | 2016-01-21T23:00:21.000Z | ### Python Dictionary Class. Contains python dictionary objects and can be the parent class of other classes, even R classes.
from signals import BaseRedRVariable
"""
.. convertTo:: ``
.. convertFrom:: ``
"""
class UnstructuredDict(BaseRedRVariable):
convertToList = [BaseRedRVariable]
convertFromList... | 37.390244 | 127 | 0.557078 | keys = None, checkVal = True, **kwargs):
BaseRedRVariable.__init__(self, widget = widget, data = data, parent = parent, checkVal = False, **kwargs)
if checkVal:
if type(data) not in [dict]:
raise Exception, 'Data not of dictionary class'
if keys:
... | false | true |
1c240529fbf53f860c2682a891eb9fb338cd2b40 | 808 | py | Python | ooobuild/dyn/drawing/point_sequence.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/dyn/drawing/point_sequence.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/dyn/drawing/point_sequence.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http: // www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 33.666667 | 74 | 0.759901 |
from ...lo.drawing.point_sequence import PointSequence as PointSequence
| true | true |
1c2406caa9c56a8ed1d7df796daf7efb07d2ea77 | 3,146 | py | Python | BIAS/Create_RF.py | Basvanstein/BIAS | 5eed56d01803e455ef53afb278f630d5f3c85dc4 | [
"BSD-3-Clause"
] | 1 | 2021-08-16T15:12:39.000Z | 2021-08-16T15:12:39.000Z | BIAS/Create_RF.py | Basvanstein/BIAS | 5eed56d01803e455ef53afb278f630d5f3c85dc4 | [
"BSD-3-Clause"
] | null | null | null | BIAS/Create_RF.py | Basvanstein/BIAS | 5eed56d01803e455ef53afb278f630d5f3c85dc4 | [
"BSD-3-Clause"
] | 1 | 2021-09-15T17:28:24.000Z | 2021-09-15T17:28:24.000Z | import numpy as np
import pandas as pd
import pickle
import glob
import matplotlib.pyplot as plt
import seaborn as sbs
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import confusion_matrix, f1_score
from sklearn.model_selection import train_test_split
test_names = ['1-spacing', '2-spacing',... | 38.365854 | 138 | 0.598538 | import numpy as np
import pandas as pd
import pickle
import glob
import matplotlib.pyplot as plt
import seaborn as sbs
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import confusion_matrix, f1_score
from sklearn.model_selection import train_test_split
test_names = ['1-spacing', '2-spacing',... | true | true |
1c240724f4d44f30df1a084090ad7d3c224a5ebe | 631 | py | Python | classes/udes_gro501/mass-spring-dampers/two_mass_with_pid.py | SherbyRobotics/PyRobotics | 86eb1189258f6f41642a149c813dd2fd6853bcc1 | [
"MIT"
] | 9 | 2016-05-10T22:23:03.000Z | 2020-10-12T20:53:54.000Z | classes/udes_gro501/mass-spring-dampers/two_mass_with_pid.py | SherbyRobotics/PyRobotics | 86eb1189258f6f41642a149c813dd2fd6853bcc1 | [
"MIT"
] | 3 | 2016-08-05T15:19:21.000Z | 2019-04-08T15:12:49.000Z | classes/udes_gro501/mass-spring-dampers/two_mass_with_pid.py | SherbyRobotics/PyRobotics | 86eb1189258f6f41642a149c813dd2fd6853bcc1 | [
"MIT"
] | 5 | 2018-10-15T15:45:10.000Z | 2021-11-16T01:55:47.000Z | # -*- coding: utf-8 -*-
"""
Created on Jun 2 2021
@author: Alex
"""
import numpy as np
from pyro.dynamic import massspringdamper
from pyro.control.linear import PIDController
# Plant
sys = massspringdamper.TwoMass( output_mass = 1 )
sys.m1 = 1
sys.m2 = 1
sys.k1 = 1
sys.k2 = 1
sys.b1 = 0.5
sys.... | 631 | 631 | 0.673534 | true | true | |
1c24079d5ef74d1715d464d1d378f8952c55a223 | 1,946 | py | Python | pytvmaze/endpoints.py | sirmarksalot/pytvmaze | 16ed096d464adcd3d12a610e413996918715930e | [
"MIT"
] | 23 | 2015-10-12T08:03:06.000Z | 2021-05-22T09:14:57.000Z | pytvmaze/endpoints.py | sirmarksalot/pytvmaze | 16ed096d464adcd3d12a610e413996918715930e | [
"MIT"
] | 34 | 2015-10-16T18:59:00.000Z | 2022-01-02T18:20:16.000Z | pytvmaze/endpoints.py | sirmarksalot/pytvmaze | 16ed096d464adcd3d12a610e413996918715930e | [
"MIT"
] | 21 | 2015-10-13T07:34:13.000Z | 2022-01-02T20:14:49.000Z | #!/usr/bin/python
# TVMaze Free endpoints
show_search = 'http://api.tvmaze.com/search/shows?q={0}'
show_single_search = 'http://api.tvmaze.com/singlesearch/shows?q={0}'
lookup_tvrage = 'http://api.tvmaze.com/lookup/shows?tvrage={0}'
lookup_tvdb = 'http://api.tvmaze.com/lookup/shows?thetvdb={0}'
lookup_imdb = 'http://a... | 54.055556 | 91 | 0.733813 |
show_search = 'http://api.tvmaze.com/search/shows?q={0}'
show_single_search = 'http://api.tvmaze.com/singlesearch/shows?q={0}'
lookup_tvrage = 'http://api.tvmaze.com/lookup/shows?tvrage={0}'
lookup_tvdb = 'http://api.tvmaze.com/lookup/shows?thetvdb={0}'
lookup_imdb = 'http://api.tvmaze.com/lookup/shows?imdb={0}'
get... | true | true |
1c2407d69ee972fb03bb118fc0e1d245f87e101a | 1,795 | py | Python | crawlers/make_assignments.py | fostroll/ru_corner | defb681aa9311c2dd6ed98d1b934453c29e9a750 | [
"Apache-2.0"
] | null | null | null | crawlers/make_assignments.py | fostroll/ru_corner | defb681aa9311c2dd6ed98d1b934453c29e9a750 | [
"Apache-2.0"
] | null | null | null | crawlers/make_assignments.py | fostroll/ru_corner | defb681aa9311c2dd6ed98d1b934453c29e9a750 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python -u
#-*- encoding: utf-8 -*-
import glob
import os
import shutil
import sys
from _utils_add import _path, _sub_idx, DATA_DIR_NAME
domain, opers = None, sys.argv[1:]
if opers:
if opers[0] == '-d':
opers = opers[1:]
if opers:
domain = opers[0]
opers = opers... | 33.240741 | 75 | 0.583287 |
import glob
import os
import shutil
import sys
from _utils_add import _path, _sub_idx, DATA_DIR_NAME
domain, opers = None, sys.argv[1:]
if opers:
if opers[0] == '-d':
opers = opers[1:]
if opers:
domain = opers[0]
opers = opers[1:]
assert opers, \
'ERROR: Usage: {... | true | true |
1c240834d080cb260050872b05babfcae0744924 | 3,807 | py | Python | src/optimizer/structures.py | 5Dev24/PyBytesFast | d15686ff43a83703ed83fc85ccd2a9ccac4dd8b1 | [
"BSD-3-Clause"
] | null | null | null | src/optimizer/structures.py | 5Dev24/PyBytesFast | d15686ff43a83703ed83fc85ccd2a9ccac4dd8b1 | [
"BSD-3-Clause"
] | null | null | null | src/optimizer/structures.py | 5Dev24/PyBytesFast | d15686ff43a83703ed83fc85ccd2a9ccac4dd8b1 | [
"BSD-3-Clause"
] | null | null | null | from dataclasses import dataclass
from typing import List, Any
from types import CodeType
from opcode import opname
@dataclass(eq = False)
class Instruction:
opcode: int
oparg: int
id: int = -1
def __repr__(self):
if self.id == -1:
return f"{self.opcode:<3} {self.oparg:>2} {opname[self.opcode]}"
return f"... | 26.4375 | 102 | 0.65327 | from dataclasses import dataclass
from typing import List, Any
from types import CodeType
from opcode import opname
@dataclass(eq = False)
class Instruction:
opcode: int
oparg: int
id: int = -1
def __repr__(self):
if self.id == -1:
return f"{self.opcode:<3} {self.oparg:>2} {opname[self.opcode]}"
return f"... | true | true |
1c240851e3d64829b60e6d9a8020fea86763d443 | 100,413 | py | Python | bitmessage_icons_rc.py | sharpbitmessage/PyBitmessage | 875144ceff4f83ba50502f0cd91f4753b281b8f4 | [
"MIT"
] | 1 | 2015-06-09T14:01:29.000Z | 2015-06-09T14:01:29.000Z | bitmessage_icons_rc.py | sharpbitmessage/PyBitmessage | 875144ceff4f83ba50502f0cd91f4753b281b8f4 | [
"MIT"
] | null | null | null | bitmessage_icons_rc.py | sharpbitmessage/PyBitmessage | 875144ceff4f83ba50502f0cd91f4753b281b8f4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Resource object code
#
# Created: Sun Nov 25 19:28:49 2012
# by: The Resource Compiler for PyQt (Qt v4.8.3)
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore
qt_resource_data = "\
\x00\x00\x02\x24\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x... | 62.562617 | 129 | 0.72639 |
from PyQt4 import QtCore
qt_resource_data = "\
\x00\x00\x02\x24\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x10\x00\x00\x00\x10\x08\x06\x00\x00\x00\x1f\xf3\xff\x61\
\x00\x00\x00\x19\x74\x45\x58\x74\x53\x6f\x66\x74\x77\x61\x72\x65\
\x00\x41\x64\x6f\x62\x65\x20\x49\x6d\x61\... | true | true |
1c24085bf2df26716974326e4f1019066d82139d | 17,756 | py | Python | tensorForm/aux.py | jb803/tensorForm | 4d227caa88365d9b20cf65539c83c22560785f6d | [
"MIT"
] | 2 | 2021-08-03T09:29:29.000Z | 2021-08-03T18:32:35.000Z | tensorForm/aux.py | jb803/tensorForm | 4d227caa88365d9b20cf65539c83c22560785f6d | [
"MIT"
] | null | null | null | tensorForm/aux.py | jb803/tensorForm | 4d227caa88365d9b20cf65539c83c22560785f6d | [
"MIT"
] | null | null | null | """Module for eigenvalue problems.
We have an abstract base-class representing an eigensolver. This has a number of functions which must be overloaded"""
from abc import ABC,abstractmethod
from petsc4py import PETSc
from slepc4py import SLEPc
import dolfin as dolf
import time
import numpy as np
import os
impor... | 34.410853 | 191 | 0.597882 |
from abc import ABC,abstractmethod
from petsc4py import PETSc
from slepc4py import SLEPc
import dolfin as dolf
import time
import numpy as np
import os
import gc
class EigenError(Exception):
def __init__(self,message):
self.message=message
class Eigensolver(ABC):
def __init__(self):
s... | true | true |
1c2408cd7825ba6a47889223dcead2d34e3fdd67 | 2,452 | py | Python | rave_python/rave_bills.py | hugovk/rave-python | 8ee37d523525a5ddc20cba4a1951c84aeb53bece | [
"MIT"
] | null | null | null | rave_python/rave_bills.py | hugovk/rave-python | 8ee37d523525a5ddc20cba4a1951c84aeb53bece | [
"MIT"
] | null | null | null | rave_python/rave_bills.py | hugovk/rave-python | 8ee37d523525a5ddc20cba4a1951c84aeb53bece | [
"MIT"
] | null | null | null | import json, requests, copy
from rave_python.rave_base import RaveBase
from rave_python.rave_misc import checkIfParametersAreComplete
from rave_python.rave_exceptions import ServerError, IncompleteCardDetailsError, BillCreationError, BillStatusError
class Bills(RaveBase):
def __init__(self, publicKey, secret... | 45.407407 | 125 | 0.66925 | import json, requests, copy
from rave_python.rave_base import RaveBase
from rave_python.rave_misc import checkIfParametersAreComplete
from rave_python.rave_exceptions import ServerError, IncompleteCardDetailsError, BillCreationError, BillStatusError
class Bills(RaveBase):
def __init__(self, publicKey, secret... | true | true |
1c2408ee1f5d0023e7ec7c126cd014c3556de21b | 5,447 | py | Python | tools/testing/selftests/bpf/test_bpftool.py | jainsakshi2395/linux | 7ccb860232bb83fb60cd6bcf5aaf0c008d903acb | [
"Linux-OpenIB"
] | 44 | 2022-03-16T08:32:31.000Z | 2022-03-31T16:02:35.000Z | tools/testing/selftests/bpf/test_bpftool.py | jainsakshi2395/linux | 7ccb860232bb83fb60cd6bcf5aaf0c008d903acb | [
"Linux-OpenIB"
] | 1 | 2022-03-29T02:30:28.000Z | 2022-03-30T03:40:46.000Z | tools/testing/selftests/bpf/test_bpftool.py | jainsakshi2395/linux | 7ccb860232bb83fb60cd6bcf5aaf0c008d903acb | [
"Linux-OpenIB"
] | 18 | 2022-03-19T04:41:04.000Z | 2022-03-31T03:32:12.000Z | # SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2020 SUSE LLC.
import collections
import functools
import json
import os
import socket
import subprocess
import unittest
# Add the source tree of bpftool and /usr/local/sbin to PATH
cur_dir = os.path.dirname(os.path.realpath(__file__))
bpftool_dir = os.path.abspath(... | 31.125714 | 79 | 0.581788 |
import collections
import functools
import json
import os
import socket
import subprocess
import unittest
cur_dir = os.path.dirname(os.path.realpath(__file__))
bpftool_dir = os.path.abspath(os.path.join(cur_dir, "..", "..", "..", "..",
"tools", "bpf", "bpftool"))
os.envi... | true | true |
1c240994c59cf2b8d9030425ee385cf6b2388546 | 18,176 | py | Python | worldengine/drawing_functions.py | ctittel/worldengine | a91ae436f6298be6a0bf7b68c43415f10b6e751f | [
"MIT"
] | 946 | 2015-02-17T17:09:35.000Z | 2022-03-31T04:41:37.000Z | worldengine/drawing_functions.py | ctittel/worldengine | a91ae436f6298be6a0bf7b68c43415f10b6e751f | [
"MIT"
] | 225 | 2015-02-17T17:09:03.000Z | 2022-03-28T10:33:49.000Z | worldengine/drawing_functions.py | ctittel/worldengine | a91ae436f6298be6a0bf7b68c43415f10b6e751f | [
"MIT"
] | 120 | 2015-02-18T16:46:04.000Z | 2022-03-27T19:51:55.000Z | """
This file should contain only functions that operates on pixels, not on images,
so no references to PIL are necessary and the module can be used also through
Jython
"""
import numpy
import sys
import time
from worldengine.common import get_verbose, count_neighbours
from worldengine.common import anti_alias as anti... | 33.784387 | 108 | 0.545775 |
import numpy
import sys
import time
from worldengine.common import get_verbose, count_neighbours
from worldengine.common import anti_alias as anti_alias_channel
from worldengine.biome import BiomeGroup, _un_camelize
def gradient(value, low, high, low_color, high_color):
lr, lg, lb = low_color
if high ==... | true | true |
1c2409e074c11727a4616228f44f000ebf2607ee | 1,554 | py | Python | setup.py | aaronddavies/PyUnitReport | 4753588e2aa55d245a7a39dcebab96b30b2b5a43 | [
"MIT"
] | 44 | 2017-11-09T05:41:10.000Z | 2019-06-28T15:54:39.000Z | setup.py | aaronddavies/PyUnitReport | 4753588e2aa55d245a7a39dcebab96b30b2b5a43 | [
"MIT"
] | 4 | 2018-01-25T13:10:10.000Z | 2018-12-24T14:56:16.000Z | setup.py | aaronddavies/PyUnitReport | 4753588e2aa55d245a7a39dcebab96b30b2b5a43 | [
"MIT"
] | 9 | 2017-11-08T08:01:14.000Z | 2019-07-02T11:56:26.000Z | import io
import os
import re
from setuptools import find_packages, setup
with open(os.path.join(os.path.dirname(__file__), 'pyunitreport', '__init__.py')) as f:
version = re.compile(r"__version__\s+=\s+'(.*)'", re.I).match(f.read()).group(1)
requirements = [
# Package requirements here
"jinja2"
]
test_... | 29.320755 | 87 | 0.653797 | import io
import os
import re
from setuptools import find_packages, setup
with open(os.path.join(os.path.dirname(__file__), 'pyunitreport', '__init__.py')) as f:
version = re.compile(r"__version__\s+=\s+'(.*)'", re.I).match(f.read()).group(1)
requirements = [
"jinja2"
]
test_requirements = [
]
wi... | true | true |
1c240addcf297417e35f1028c2a999891536518d | 594 | py | Python | preprocess/deck.py | ericschmar/hs-clock | bc192d25a7945cfdafb9a04732baecb2c0ed341d | [
"MIT"
] | null | null | null | preprocess/deck.py | ericschmar/hs-clock | bc192d25a7945cfdafb9a04732baecb2c0ed341d | [
"MIT"
] | null | null | null | preprocess/deck.py | ericschmar/hs-clock | bc192d25a7945cfdafb9a04732baecb2c0ed341d | [
"MIT"
] | null | null | null | import sys
import json
from pprint import pprint
class deck:
def __init__(self, id=None, game_length=None, turns=None, deck_id=None, deck_list=None, digest=None, win_rate=None, player_class=None):
self.id = id
self.game_length = game_length
self.turns = turns
self.deck_id = deck_id
... | 33 | 139 | 0.658249 | import sys
import json
from pprint import pprint
class deck:
def __init__(self, id=None, game_length=None, turns=None, deck_id=None, deck_list=None, digest=None, win_rate=None, player_class=None):
self.id = id
self.game_length = game_length
self.turns = turns
self.deck_id = deck_id
... | true | true |
1c240c0223b9ea6ada6744bae724e5bd5cfcc781 | 3,987 | py | Python | pypureclient/flasharray/FA_2_6/models/directory_service_management.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 14 | 2018-12-07T18:30:27.000Z | 2022-02-22T09:12:33.000Z | pypureclient/flasharray/FA_2_6/models/directory_service_management.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 28 | 2019-09-17T21:03:52.000Z | 2022-03-29T22:07:35.000Z | pypureclient/flasharray/FA_2_6/models/directory_service_management.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 15 | 2020-06-11T15:50:08.000Z | 2022-03-21T09:27:25.000Z | # coding: utf-8
"""
FlashArray REST API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 2.6
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re
import six
import typing
from .... | 33.788136 | 282 | 0.596188 |
import pprint
import re
import six
import typing
from ....properties import Property
if typing.TYPE_CHECKING:
from pypureclient.flasharray.FA_2_6 import models
class DirectoryServiceManagement(object):
swagger_types = {
'user_login_attribute': 'str',
'user_object_class': 'str'
}
... | true | true |
1c240c1c945acabc5968fc8ec4758138b92739fb | 1,013 | py | Python | app/forms.py | ViniciussAlencarr/Projeto_Integrador | 3ce876ddc2be7d2617efe63e392ccc139c5bc0e6 | [
"MIT"
] | null | null | null | app/forms.py | ViniciussAlencarr/Projeto_Integrador | 3ce876ddc2be7d2617efe63e392ccc139c5bc0e6 | [
"MIT"
] | null | null | null | app/forms.py | ViniciussAlencarr/Projeto_Integrador | 3ce876ddc2be7d2617efe63e392ccc139c5bc0e6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from django.db.models import fields
from django.forms import ModelForm
from django import forms
from app.models import *
from django.contrib.auth.models import User
class UserModelForm(forms.ModelForm):
class Meta:
model = User
fields = ['email']
class Cliente_Form(forms.M... | 23.55814 | 81 | 0.635735 |
from django.db.models import fields
from django.forms import ModelForm
from django import forms
from app.models import *
from django.contrib.auth.models import User
class UserModelForm(forms.ModelForm):
class Meta:
model = User
fields = ['email']
class Cliente_Form(forms.ModelForm):
class Me... | true | true |
1c240e1019ae9ec59aa942d467acf9cacd1c4280 | 8,967 | py | Python | api/desecapi/tests/test_dyndns12update.py | Knight1/desec-stack | f141a374ee21ba26f4f593ae590663af3f02b9fa | [
"MIT"
] | null | null | null | api/desecapi/tests/test_dyndns12update.py | Knight1/desec-stack | f141a374ee21ba26f4f593ae590663af3f02b9fa | [
"MIT"
] | null | null | null | api/desecapi/tests/test_dyndns12update.py | Knight1/desec-stack | f141a374ee21ba26f4f593ae590663af3f02b9fa | [
"MIT"
] | null | null | null | import random
from rest_framework import status
from desecapi.tests.base import DynDomainOwnerTestCase
class DynDNS12UpdateTest(DynDomainOwnerTestCase):
def assertIP(self, ipv4=None, ipv6=None, name=None):
name = name or self.my_domain.name.lower()
for type_, value in [('A', ipv4), ('AAAA', ipv... | 40.210762 | 117 | 0.625962 | import random
from rest_framework import status
from desecapi.tests.base import DynDomainOwnerTestCase
class DynDNS12UpdateTest(DynDomainOwnerTestCase):
def assertIP(self, ipv4=None, ipv6=None, name=None):
name = name or self.my_domain.name.lower()
for type_, value in [('A', ipv4), ('AAAA', ipv... | true | true |
1c240f150947f86154201c4db486963e4bbd988c | 13,487 | py | Python | boogio/utensils/test/test_cidr_tools.py | osgirl/boogio | b78fc02b93f2ed1320ba253b01f28f5e2f45afa0 | [
"Apache-2.0"
] | null | null | null | boogio/utensils/test/test_cidr_tools.py | osgirl/boogio | b78fc02b93f2ed1320ba253b01f28f5e2f45afa0 | [
"Apache-2.0"
] | null | null | null | boogio/utensils/test/test_cidr_tools.py | osgirl/boogio | b78fc02b93f2ed1320ba253b01f28f5e2f45afa0 | [
"Apache-2.0"
] | null | null | null | # ----------------------------------------------------------------------------
# Copyright (C) 2017 Verizon. 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
#
# ... | 37.778711 | 79 | 0.502632 |
import unittest
from boogio.utensils import cidr_tools
UNIVERSAL_CIDR = cidr_tools.UNIVERSAL_CIDR
class TestCidrModuleFunctions(unittest.TestCase):
def setUp(self):
pass
def test_sort_cidrs(self):
cidrs = ["1.0.0.0", "2.0.0.0"]
self.assertEqual... | true | true |
1c240f680b45b59a17fce9c46c94ef320c329c02 | 72,034 | py | Python | mantis/Database_generator.py | PedroMTQ/Mantis | a59937d23979372c65188cf2358b69485099dc68 | [
"MIT"
] | null | null | null | mantis/Database_generator.py | PedroMTQ/Mantis | a59937d23979372c65188cf2358b69485099dc68 | [
"MIT"
] | null | null | null | mantis/Database_generator.py | PedroMTQ/Mantis | a59937d23979372c65188cf2358b69485099dc68 | [
"MIT"
] | null | null | null | import re
try:
from mantis.Exceptions import *
from mantis.utils import *
from mantis.UniFunc_wrapper import UniFunc_wrapper
except:
from Exceptions import *
from utils import *
from UniFunc_wrapper import UniFunc_wrapper
if not unifunc_downloaded():
download_unifunc()
class Database_gene... | 50.303073 | 203 | 0.597593 | import re
try:
from mantis.Exceptions import *
from mantis.utils import *
from mantis.UniFunc_wrapper import UniFunc_wrapper
except:
from Exceptions import *
from utils import *
from UniFunc_wrapper import UniFunc_wrapper
if not unifunc_downloaded():
download_unifunc()
class Database_gene... | true | true |
1c240f6d3bfb2534d59d9ca21ef328607bb3248b | 1,183 | py | Python | Bootcamp_2020/AdvancedPython/stacks/tower_of_hanoi.py | samirsaravia/Python_101 | 0c45f11d74a356514a0c436ade6af4c0f67c56b7 | [
"MIT"
] | null | null | null | Bootcamp_2020/AdvancedPython/stacks/tower_of_hanoi.py | samirsaravia/Python_101 | 0c45f11d74a356514a0c436ade6af4c0f67c56b7 | [
"MIT"
] | 1 | 2020-10-16T23:26:41.000Z | 2020-10-16T23:26:41.000Z | Bootcamp_2020/AdvancedPython/stacks/tower_of_hanoi.py | samirsaravia/Python_101 | 0c45f11d74a356514a0c436ade6af4c0f67c56b7 | [
"MIT"
] | null | null | null | """
-*- coding: UTF-8 -*-
author: Samir S.
"""
# tower of Hanoi
# There are 3 stacks (towers) A,B,C
# When moving 3 disks from A to C we move the top two disks to B and then
# the bottom disk to C. More generally, when moving n disks from A to C
# we move n-1 disks to B; we then move the base disk from A to C... | 25.170213 | 73 | 0.551141 |
def tower_of_hanoi(a, b, c, n):
global count
if n == 1:
disk = a.pop()
c.append(disk)
count += 1
else:
tower_of_hanoi(a, c, b,
n - 1)
tower_of_hanoi(a, b, c,
1)
tower_of_hanoi(b, a, c,
... | true | true |
1c24103decbb08daf86a3f9297d8a1eb0fac6323 | 20,093 | py | Python | official/vision/image_classification/dataset_factory.py | hjkim-haga/TF-OD-API | 22ac477ff4dfb93fe7a32c94b5f0b1e74330902b | [
"Apache-2.0"
] | null | null | null | official/vision/image_classification/dataset_factory.py | hjkim-haga/TF-OD-API | 22ac477ff4dfb93fe7a32c94b5f0b1e74330902b | [
"Apache-2.0"
] | null | null | null | official/vision/image_classification/dataset_factory.py | hjkim-haga/TF-OD-API | 22ac477ff4dfb93fe7a32c94b5f0b1e74330902b | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | 37.278293 | 81 | 0.669338 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from typing import Any, List, Optional, Tuple, Mapping, Union
from absl import logging
from dataclasses import dataclass
import tensorflow as tf
import tensorflow_datasets ... | true | true |
1c2411e75b7ce26bf68f195f494337ce35baa4ee | 934 | py | Python | lesson04CountingElements/MaxCounters/solutionB.py | wandesky/codility | c13d91ca828c37a7673d529743b4d678910eb611 | [
"MIT"
] | null | null | null | lesson04CountingElements/MaxCounters/solutionB.py | wandesky/codility | c13d91ca828c37a7673d529743b4d678910eb611 | [
"MIT"
] | null | null | null | lesson04CountingElements/MaxCounters/solutionB.py | wandesky/codility | c13d91ca828c37a7673d529743b4d678910eb611 | [
"MIT"
] | null | null | null | '''
This solution is correct. Gives O(N+M)
'''
# you can write to stdout for debugging purposes, e.g.
# print("this is a debug message")
def solution(N, A):
# write your code in Python 3.6
if(not len(A)):
return [0]*N
counter = [0]*N
maxy = 0
miny = 0
# print('N is ', N)
... | 25.944444 | 76 | 0.477516 |
def solution(N, A):
if(not len(A)):
return [0]*N
counter = [0]*N
maxy = 0
miny = 0
for elem in A:
if(elem >= 1 and elem <=N and counter[elem-1] < miny):
counter[elem-1] = miny
if(elem >= 1 and elem <=N):
counter[elem-1] += 1
... | true | true |
1c2411e77956f42edfd4ec24790c0dbc99a3fa71 | 10,703 | py | Python | mrpython/UndoDelegator.py | naim1992/grep_mister_python | 17e4aefc10d221c2b566c01f775b6d77106b84ef | [
"PSF-2.0"
] | null | null | null | mrpython/UndoDelegator.py | naim1992/grep_mister_python | 17e4aefc10d221c2b566c01f775b6d77106b84ef | [
"PSF-2.0"
] | null | null | null | mrpython/UndoDelegator.py | naim1992/grep_mister_python | 17e4aefc10d221c2b566c01f775b6d77106b84ef | [
"PSF-2.0"
] | null | null | null | import string
from tkinter import *
from Delegator import Delegator
#$ event <<redo>>
#$ win <Control-y>
#$ unix <Alt-z>
#$ event <<undo>>
#$ win <Control-z>
#$ unix <Control-z>
#$ event <<dump-undo-state>>
#$ win <Control-backslash>
#$ unix <Control-backslash>
class UndoDelegator(Delegator):
max_undo = 1000... | 29.484848 | 77 | 0.57582 | import string
from tkinter import *
from Delegator import Delegator
class UndoDelegator(Delegator):
max_undo = 1000
def __init__(self):
Delegator.__init__(self)
self.reset_undo()
def setdelegate(self, delegate):
if self.delegate is not None:
self.unbind(... | true | true |
1c241295f83d8658e21d1fadf9f86d6f5f4f5ae0 | 5,230 | py | Python | SMHIweatherInfo.py | Realera/piControlCenter | 13cf51c60c360e4ba4c95cb753451c39834746e2 | [
"MIT"
] | null | null | null | SMHIweatherInfo.py | Realera/piControlCenter | 13cf51c60c360e4ba4c95cb753451c39834746e2 | [
"MIT"
] | null | null | null | SMHIweatherInfo.py | Realera/piControlCenter | 13cf51c60c360e4ba4c95cb753451c39834746e2 | [
"MIT"
] | null | null | null | import requests
import json
from datetime import datetime
import traceback
class SMHI(object):
"""Just talking to myself."""
def __init__(self, lat, lon):
"""Initialize all variables and calls the update function.
Args:
-lat (str): latitude of the address
-lon (str): ... | 39.923664 | 98 | 0.449522 | import requests
import json
from datetime import datetime
import traceback
class SMHI(object):
def __init__(self, lat, lon):
self.lat = lat
self.lon = lon
self.host = 'https://opendata-download-metfcst.smhi.se'
self.parsedJSON = None
self.approvedTime = datetime.strptime(
... | true | true |
1c24130f1fdc1ca86fef2c61d376a917ddf9d233 | 40 | py | Python | user_login.py | git-ew-casa/football | 863b05cee288487139a7e7429760149f17ba1eab | [
"Apache-2.0"
] | null | null | null | user_login.py | git-ew-casa/football | 863b05cee288487139a7e7429760149f17ba1eab | [
"Apache-2.0"
] | null | null | null | user_login.py | git-ew-casa/football | 863b05cee288487139a7e7429760149f17ba1eab | [
"Apache-2.0"
] | null | null | null | Meine neuer Code...
Neue Codezeile ...
| 10 | 19 | 0.675 | Meine neuer Code...
Neue Codezeile ...
| false | true |
1c2413ae39c65fd0c2056646307caa7bfb882115 | 2,552 | py | Python | lbrc_flask/validators.py | LCBRU/lbrc_flask | f5f6c3f3832a9040e941c6398b7f150e567d4762 | [
"MIT"
] | null | null | null | lbrc_flask/validators.py | LCBRU/lbrc_flask | f5f6c3f3832a9040e941c6398b7f150e567d4762 | [
"MIT"
] | null | null | null | lbrc_flask/validators.py | LCBRU/lbrc_flask | f5f6c3f3832a9040e941c6398b7f150e567d4762 | [
"MIT"
] | null | null | null | import re
from datetime import datetime, date
from dateutil.parser import parse
from dateutil.relativedelta import relativedelta
def standardise_nhs_number(nhs_number):
return re.sub('[- ]', '', nhs_number or '')
def calculate_nhs_number_checksum(nhs_number):
checkcalc = lambda sum: 11 - (sum % 11)
cha... | 24.538462 | 206 | 0.601881 | import re
from datetime import datetime, date
from dateutil.parser import parse
from dateutil.relativedelta import relativedelta
def standardise_nhs_number(nhs_number):
return re.sub('[- ]', '', nhs_number or '')
def calculate_nhs_number_checksum(nhs_number):
checkcalc = lambda sum: 11 - (sum % 11)
cha... | true | true |
1c2413c0f567922097ba198861297fa6f26821a2 | 4,549 | py | Python | TermRelations/anotation/anotacion_karen.py | pmchozas/llod4lion | 52bb00634f770cb5fd46cfb2cc4d009c317bcef9 | [
"Apache-2.0"
] | null | null | null | TermRelations/anotation/anotacion_karen.py | pmchozas/llod4lion | 52bb00634f770cb5fd46cfb2cc4d009c317bcef9 | [
"Apache-2.0"
] | 1 | 2020-12-18T06:19:55.000Z | 2020-12-18T06:19:55.000Z | TermRelations/anotation/anotacion_karen.py | pmchozas/llod4lion | 52bb00634f770cb5fd46cfb2cc4d009c317bcef9 | [
"Apache-2.0"
] | 1 | 2020-05-16T11:11:18.000Z | 2020-05-16T11:11:18.000Z | import os
import json
import csv
def read_terms(file):
new=open('termimos_json.txt', 'w')
valuelist=[]
lang_list=[]
with open(file) as f:
file = json.load(f)
item=file[0]['@graph']
for i in range(len(item)):
ide=item[i]['@id']
item2=item[i]
if('http://ww... | 27.737805 | 101 | 0.460321 | import os
import json
import csv
def read_terms(file):
new=open('termimos_json.txt', 'w')
valuelist=[]
lang_list=[]
with open(file) as f:
file = json.load(f)
item=file[0]['@graph']
for i in range(len(item)):
ide=item[i]['@id']
item2=item[i]
if('http://ww... | true | true |
1c2413ce71e7a5f67fb5963883d3afef17ebcbff | 20,597 | py | Python | scripts/rad2json/restructureDeclarations.py | HenryJanson707/Ignis | f8a3769ecd0fe371993ff2c78e41bb0030d5caa8 | [
"MIT"
] | 6 | 2021-08-19T08:38:37.000Z | 2022-01-26T20:29:24.000Z | scripts/rad2json/restructureDeclarations.py | HenryJanson707/Ignis | f8a3769ecd0fe371993ff2c78e41bb0030d5caa8 | [
"MIT"
] | 17 | 2021-09-30T19:41:47.000Z | 2022-02-27T11:10:49.000Z | scripts/rad2json/restructureDeclarations.py | HenryJanson707/Ignis | f8a3769ecd0fe371993ff2c78e41bb0030d5caa8 | [
"MIT"
] | 2 | 2022-01-11T14:45:26.000Z | 2022-01-24T15:38:39.000Z | import parseRad
from primitive import Primitive
from command import Command
import json
import os
import shlex
import logging
import config
import itertools
import copy
from transformation import Transformation
from jsonmerge import merge
import struct
#variables relevant for reading
shapeList = ["sphere", "polygon", ... | 38.213358 | 176 | 0.60101 | import parseRad
from primitive import Primitive
from command import Command
import json
import os
import shlex
import logging
import config
import itertools
import copy
from transformation import Transformation
from jsonmerge import merge
import struct
shapeList = ["sphere", "polygon", "ring", "cylinder", "cone"]
lig... | true | true |
1c2414482e124212e8994c7ec28d845ea3004fca | 89 | py | Python | tests/test_dagre_py.py | xperrylinn/dagre-py | 54002104dd5a79f0e68a99ad1fc3afd44a8684f1 | [
"MIT"
] | null | null | null | tests/test_dagre_py.py | xperrylinn/dagre-py | 54002104dd5a79f0e68a99ad1fc3afd44a8684f1 | [
"MIT"
] | null | null | null | tests/test_dagre_py.py | xperrylinn/dagre-py | 54002104dd5a79f0e68a99ad1fc3afd44a8684f1 | [
"MIT"
] | null | null | null | from dagre_py import __version__
def test_version():
assert __version__ == "0.1.5"
| 14.833333 | 33 | 0.719101 | from dagre_py import __version__
def test_version():
assert __version__ == "0.1.5"
| true | true |
1c241489e9ae9e62fb9c0a9d7dbe6ed3f1dc83b0 | 3,936 | py | Python | cli/stat_menu.py | Exia-Aix-2016/Data-Project | f8f40cb001dbd74e630b42b930532a364ae0aa5d | [
"MIT"
] | null | null | null | cli/stat_menu.py | Exia-Aix-2016/Data-Project | f8f40cb001dbd74e630b42b930532a364ae0aa5d | [
"MIT"
] | null | null | null | cli/stat_menu.py | Exia-Aix-2016/Data-Project | f8f40cb001dbd74e630b42b930532a364ae0aa5d | [
"MIT"
] | null | null | null | from PyInquirer import prompt
from .menu import Menu
from .utils import toInt, toFloat, NumberValidator
from .select_algo_menu import SelectAlgoMenu
from chart import Chart
from runner import Runner
ITERATION_QUESTION = {
'type': 'input',
'name': 'iterations',
'message': 'How many iterations do you want ?... | 36.110092 | 93 | 0.513465 | from PyInquirer import prompt
from .menu import Menu
from .utils import toInt, toFloat, NumberValidator
from .select_algo_menu import SelectAlgoMenu
from chart import Chart
from runner import Runner
ITERATION_QUESTION = {
'type': 'input',
'name': 'iterations',
'message': 'How many iterations do you want ?... | true | true |
1c2414a25aaac50ee7574a0c55cc3bcc289be2a2 | 2,569 | py | Python | waitlist/blueprints/settings/permissions.py | kimnnmadsen/eve-inc-waitlist | c3e4853c5563a95edbf105c11e73d481595fb3ab | [
"MIT"
] | null | null | null | waitlist/blueprints/settings/permissions.py | kimnnmadsen/eve-inc-waitlist | c3e4853c5563a95edbf105c11e73d481595fb3ab | [
"MIT"
] | 1 | 2020-02-18T05:11:20.000Z | 2020-02-18T05:29:10.000Z | waitlist/blueprints/settings/permissions.py | kimnnmadsen/eve-inc-waitlist | c3e4853c5563a95edbf105c11e73d481595fb3ab | [
"MIT"
] | null | null | null | import logging
from flask import Blueprint
from flask import Response
from flask import redirect
from flask import render_template
from flask import request
from flask import url_for
from flask_login import login_required, current_user
from waitlist.blueprints.settings import add_menu_entry
from waitlist.permissions ... | 33.802632 | 85 | 0.722071 | import logging
from flask import Blueprint
from flask import Response
from flask import redirect
from flask import render_template
from flask import request
from flask import url_for
from flask_login import login_required, current_user
from waitlist.blueprints.settings import add_menu_entry
from waitlist.permissions ... | true | true |
1c2414fe26a0ab6d9e115bb295dafd3c9da51c38 | 780 | py | Python | src/file_ripper/fileinstance.py | rubyclimber/file-ripper-py | 9d14e57976db771d59f3a0ac387a45e309e9dfa8 | [
"MIT"
] | null | null | null | src/file_ripper/fileinstance.py | rubyclimber/file-ripper-py | 9d14e57976db771d59f3a0ac387a45e309e9dfa8 | [
"MIT"
] | null | null | null | src/file_ripper/fileinstance.py | rubyclimber/file-ripper-py | 9d14e57976db771d59f3a0ac387a45e309e9dfa8 | [
"MIT"
] | null | null | null | from dataclasses import dataclass
from typing import List, Dict
@dataclass
class FileRow:
fields: Dict[str, str]
def __contains__(self, item):
return item in self.fields
def __len__(self):
return len(self.fields)
def __iter__(self):
return iter(self.fields)
def __getite... | 19.02439 | 37 | 0.658974 | from dataclasses import dataclass
from typing import List, Dict
@dataclass
class FileRow:
fields: Dict[str, str]
def __contains__(self, item):
return item in self.fields
def __len__(self):
return len(self.fields)
def __iter__(self):
return iter(self.fields)
def __getite... | true | true |
1c241598a84a9101eb561f553f2a210d32aabbf4 | 23,927 | py | Python | qa/rpc-tests/test_framework/script.py | mirzaei-ce/core-baghdadbit | 25129e42936c8319a7e44b6badfc25abd4717a51 | [
"MIT"
] | null | null | null | qa/rpc-tests/test_framework/script.py | mirzaei-ce/core-baghdadbit | 25129e42936c8319a7e44b6badfc25abd4717a51 | [
"MIT"
] | null | null | null | qa/rpc-tests/test_framework/script.py | mirzaei-ce/core-baghdadbit | 25129e42936c8319a7e44b6badfc25abd4717a51 | [
"MIT"
] | null | null | null | #
# script.py
#
# This file is modified from python-baghdadbitlib.
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
"""Scripts
Functionality to build scripts, as well as SignatureHash().
"""
from __future__ import absolut... | 26.67447 | 146 | 0.605341 |
from __future__ import absolute_import, division, print_function, unicode_literals
from .mininode import CTransaction, CTxOut, hash256
from binascii import hexlify
import sys
bchr = chr
bord = ord
if sys.version > '3':
long = int
bchr = lambda x: bytes([x])
bord = lambda x: x
import struct
fro... | true | true |
1c241608959c75d68e470d2b96a15cc6121cc190 | 364 | py | Python | pygdpr/services/preprocess_words_service.py | GDPRxiv/crawler | 178ef9ff6c3641ba8b761a49e42c2579e453c1ca | [
"MIT"
] | null | null | null | pygdpr/services/preprocess_words_service.py | GDPRxiv/crawler | 178ef9ff6c3641ba8b761a49e42c2579e453c1ca | [
"MIT"
] | 2 | 2022-02-19T06:56:03.000Z | 2022-02-19T07:00:00.000Z | pygdpr/services/preprocess_words_service.py | GDPRxiv/crawler | 178ef9ff6c3641ba8b761a49e42c2579e453c1ca | [
"MIT"
] | null | null | null | import nltk
class PreprocessWordsService():
def for_words(self, words):
if len(words) == 0:
return []
stop_words = set(nltk.corpus.stopwords.words('english'))
words = [w for w in words if w.isalpha()]
words = [w.lower() for w in words]
words = [w for w in words i... | 30.333333 | 64 | 0.587912 | import nltk
class PreprocessWordsService():
def for_words(self, words):
if len(words) == 0:
return []
stop_words = set(nltk.corpus.stopwords.words('english'))
words = [w for w in words if w.isalpha()]
words = [w.lower() for w in words]
words = [w for w in words i... | true | true |
1c24179254584827557d2d516653510636a6cdb4 | 2,876 | py | Python | tools/linter_lib/pep8.py | vabs22/zulip | 470d0a481c0a990a81b2facc6dac63364791178a | [
"Apache-2.0"
] | null | null | null | tools/linter_lib/pep8.py | vabs22/zulip | 470d0a481c0a990a81b2facc6dac63364791178a | [
"Apache-2.0"
] | 11 | 2020-06-05T18:43:08.000Z | 2022-03-02T14:55:12.000Z | tools/linter_lib/pep8.py | vabs22/zulip | 470d0a481c0a990a81b2facc6dac63364791178a | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
from __future__ import absolute_import
import subprocess
from .printer import print_err, colors
from typing import List
def check_pep8(files):
# type: (List[str]) -> bool
def run_pycodestyle(files, ignored_rules):
# type: (List[str], List[str]) -> bool
... | 34.238095 | 97 | 0.628999 | from __future__ import print_function
from __future__ import absolute_import
import subprocess
from .printer import print_err, colors
from typing import List
def check_pep8(files):
def run_pycodestyle(files, ignored_rules):
failed = False
color = next(colors)
pep8 = subpro... | true | true |
1c241874c0e038c16805fc743f71a076d1d69d43 | 2,310 | py | Python | dj_lab/mysite/polls/views.py | ch1huizong/lab | c1622f94ca5c8a716cb5769fa6213060eb7c140d | [
"MIT"
] | null | null | null | dj_lab/mysite/polls/views.py | ch1huizong/lab | c1622f94ca5c8a716cb5769fa6213060eb7c140d | [
"MIT"
] | null | null | null | dj_lab/mysite/polls/views.py | ch1huizong/lab | c1622f94ca5c8a716cb5769fa6213060eb7c140d | [
"MIT"
] | null | null | null | from django.utils import timezone
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render, get_object_or_404
from django.urls import reverse
from django.views import generic
from .models import Question, Choice
def index(request):
latest_question_list = Question.objects.ord... | 30.8 | 82 | 0.690476 | from django.utils import timezone
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render, get_object_or_404
from django.urls import reverse
from django.views import generic
from .models import Question, Choice
def index(request):
latest_question_list = Question.objects.ord... | true | true |
1c241b492012e2c40b8c976beefb77460ed5e223 | 7,985 | py | Python | src/model.py | williamdjones/deep_protein_binding | 10b00835024702b6d0e73092c777fed267215ca7 | [
"MIT"
] | null | null | null | src/model.py | williamdjones/deep_protein_binding | 10b00835024702b6d0e73092c777fed267215ca7 | [
"MIT"
] | null | null | null | src/model.py | williamdjones/deep_protein_binding | 10b00835024702b6d0e73092c777fed267215ca7 | [
"MIT"
] | null | null | null | import time
import torch
from torch import nn
from torch.autograd import Variable
import numpy as np
from sklearn.preprocessing import OneHotEncoder
from sklearn.metrics import r2_score, precision_score, recall_score, f1_score, accuracy_score
import dc_features as dc
from rdkit import Chem
# TODO: is it a good idea ... | 42.473404 | 152 | 0.555041 | import time
import torch
from torch import nn
from torch.autograd import Variable
import numpy as np
from sklearn.preprocessing import OneHotEncoder
from sklearn.metrics import r2_score, precision_score, recall_score, f1_score, accuracy_score
import dc_features as dc
from rdkit import Chem
class MPNN(nn.Module):
... | true | true |
1c241c154cb0210586d9b4b1e18291229b0fc89a | 2,243 | py | Python | op1repacker/op1_analyze.py | domenukk/op1repacker | 98b7a45fc5f2bb5438b6b07762bf1d0c0e8688b9 | [
"MIT"
] | null | null | null | op1repacker/op1_analyze.py | domenukk/op1repacker | 98b7a45fc5f2bb5438b6b07762bf1d0c0e8688b9 | [
"MIT"
] | null | null | null | op1repacker/op1_analyze.py | domenukk/op1repacker | 98b7a45fc5f2bb5438b6b07762bf1d0c0e8688b9 | [
"MIT"
] | null | null | null | """Analyze unpacked OP-1 firmware directories."""
import os
import re
import time
UNKNOWN_VALUE = 'UNKNOWN'
def analyze_boot_ldr(target):
path = os.path.join(target, 'te-boot.ldr')
f = open(path, 'rb')
data = f.read()
f.close()
version_arr = re.findall(br'TE-BOOT .+?(\d*\.?\d+)', data)
boot... | 27.691358 | 97 | 0.614802 |
import os
import re
import time
UNKNOWN_VALUE = 'UNKNOWN'
def analyze_boot_ldr(target):
path = os.path.join(target, 'te-boot.ldr')
f = open(path, 'rb')
data = f.read()
f.close()
version_arr = re.findall(br'TE-BOOT .+?(\d*\.?\d+)', data)
bootloader_version = version_arr[0].decode('utf-8').st... | true | true |
1c241cc790d3d28ff9bbe2eea2a22b6608772f20 | 1,305 | py | Python | plugins/feeds/public/openphish.py | chaitanyakrishna/yeti | 796257311a84cd84873fd2423d5ccce231459560 | [
"Apache-2.0"
] | null | null | null | plugins/feeds/public/openphish.py | chaitanyakrishna/yeti | 796257311a84cd84873fd2423d5ccce231459560 | [
"Apache-2.0"
] | null | null | null | plugins/feeds/public/openphish.py | chaitanyakrishna/yeti | 796257311a84cd84873fd2423d5ccce231459560 | [
"Apache-2.0"
] | 1 | 2021-11-16T13:21:56.000Z | 2021-11-16T13:21:56.000Z | from datetime import timedelta
import logging
from core.observables import Url
from core.feed import Feed
from core.errors import ObservableValidationError
class OpenPhish(Feed):
# set default values for feed
default_values = {
'frequency': timedelta(hours=4),
'name': 'OpenPhish',
'so... | 31.071429 | 93 | 0.595402 | from datetime import timedelta
import logging
from core.observables import Url
from core.feed import Feed
from core.errors import ObservableValidationError
class OpenPhish(Feed):
default_values = {
'frequency': timedelta(hours=4),
'name': 'OpenPhish',
'source': 'https://openphish.com... | true | true |
1c241cdfe19a30603fd19ec54f732f8174e21bfd | 1,543 | py | Python | aliyun-python-sdk-cr/aliyunsdkcr/request/v20160607/GetImageScanRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-cr/aliyunsdkcr/request/v20160607/GetImageScanRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-cr/aliyunsdkcr/request/v20160607/GetImageScanRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 35.068182 | 76 | 0.753727 |
from aliyunsdkcore.request import RoaRequest
class GetImageScanRequest(RoaRequest):
def __init__(self):
RoaRequest.__init__(self, 'cr', '2016-06-07', 'GetImageScan','cr')
self.set_uri_pattern('/repos/[RepoNamespace]/[RepoName]/tags/[Tag]/scan')
self.set_method('GET')
def get_RepoNamespa... | true | true |
1c241d7d7860b7fc1e6fc1131a03b4657663a1df | 1,514 | py | Python | src/JobApi/tasks/Delete.py | shasha79/nectm | 600044a6fe2c3a73e0d9327bc85883831a26dcae | [
"Apache-2.0"
] | 3 | 2020-02-28T21:42:44.000Z | 2021-03-12T13:56:16.000Z | src/JobApi/tasks/Delete.py | Pangeamt/nectm | 6b84f048698f2530b9fdbb30695f2e2217c3fbfe | [
"Apache-2.0"
] | 2 | 2020-11-06T14:40:10.000Z | 2020-12-29T19:03:11.000Z | src/JobApi/tasks/Delete.py | Pangeamt/nectm | 6b84f048698f2530b9fdbb30695f2e2217c3fbfe | [
"Apache-2.0"
] | 2 | 2020-03-26T16:05:11.000Z | 2020-08-06T16:35:39.000Z | #
# Copyright (c) 2020 Pangeanic SL.
#
# This file is part of NEC TM
# (see https://github.com/shasha79/nectm).
#
# 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 owne... | 32.913043 | 111 | 0.738441 |
import sys, os, datetime, re, logging
sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)), '..', '..'))
from JobApi.tasks.Task import Task
class DeleteTask(Task):
def __init__(self, job_id):
super().__init__(job_id)
self.langs = self.get_langs()
def run_sequentia... | true | true |
1c241f3251cb732b7620294d5f64b50808ecfb4f | 129 | py | Python | stock_investing/support/__init__.py | jeff00seattle/stock-investor | 16c9e1062cd699090748f7d47b3c0211ef652a98 | [
"MIT"
] | null | null | null | stock_investing/support/__init__.py | jeff00seattle/stock-investor | 16c9e1062cd699090748f7d47b3c0211ef652a98 | [
"MIT"
] | null | null | null | stock_investing/support/__init__.py | jeff00seattle/stock-investor | 16c9e1062cd699090748f7d47b3c0211ef652a98 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @namespace stock_investing
from .errors_traceback import get_exception_message
| 21.5 | 51 | 0.751938 |
from .errors_traceback import get_exception_message
| true | true |
1c241f895ff882016de2be4d91c6bb1bb7747089 | 5,246 | py | Python | tests/integration/query_comments_test/test_query_comments.py | dlb8685/dbt-redshift | c1f02a1931ad6bd9cf0c2eb28bee9bf9e7da3dcf | [
"Apache-2.0"
] | 18 | 2021-10-03T09:15:30.000Z | 2022-03-31T20:32:12.000Z | tests/integration/query_comments_test/test_query_comments.py | dlb8685/dbt-redshift | c1f02a1931ad6bd9cf0c2eb28bee9bf9e7da3dcf | [
"Apache-2.0"
] | 42 | 2021-10-05T17:03:10.000Z | 2022-03-31T14:26:25.000Z | tests/integration/query_comments_test/test_query_comments.py | dlb8685/dbt-redshift | c1f02a1931ad6bd9cf0c2eb28bee9bf9e7da3dcf | [
"Apache-2.0"
] | 10 | 2021-11-02T13:16:26.000Z | 2022-03-29T07:44:24.000Z | from tests.integration.base import DBTIntegrationTest, use_profile
import io
import json
import os
import re
import dbt.exceptions
from dbt.version import __version__ as dbt_version
from dbt.logger import log_manager
class TestDefaultQueryComments(DBTIntegrationTest):
def matches_comment(self, msg) -> bool:
... | 30.5 | 122 | 0.613992 | from tests.integration.base import DBTIntegrationTest, use_profile
import io
import json
import os
import re
import dbt.exceptions
from dbt.version import __version__ as dbt_version
from dbt.logger import log_manager
class TestDefaultQueryComments(DBTIntegrationTest):
def matches_comment(self, msg) -> bool:
... | true | true |
1c2420418c3364fe264134671e539e073db7dfa5 | 5,094 | py | Python | thrift/test/py/TestCppServer.py | jesboat/fbthrift | 7d8e1dcec59024e526e6768d3d4a66f6c4abe5ac | [
"Apache-2.0"
] | 1 | 2015-11-05T18:31:38.000Z | 2015-11-05T18:31:38.000Z | thrift/test/py/TestCppServer.py | jesboat/fbthrift | 7d8e1dcec59024e526e6768d3d4a66f6c4abe5ac | [
"Apache-2.0"
] | null | null | null | thrift/test/py/TestCppServer.py | jesboat/fbthrift | 7d8e1dcec59024e526e6768d3d4a66f6c4abe5ac | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# this interferes with ServiceRouter/SWIG
# @lint-avoid-python-3-compatibility-imports
#from __future__ import unicode_literals
import multiprocessing
import sys
import threading
import time
from fb303.Context... | 28.617978 | 77 | 0.660974 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import multiprocessing
import sys
import threading
import time
from fb303.ContextFacebookBase import FacebookBase
from libfb.testutil import BaseFacebookTestCase
from thrift.transport import TSocket, TTrans... | true | true |
1c24229cbc4284c1944ebd3204c0b1059d93fc40 | 3,128 | py | Python | lib/spelling_type/__init__.py | Anne-kj/keyboard-design | fa177bdf0add737e41274394bdc880ce511af216 | [
"MIT"
] | null | null | null | lib/spelling_type/__init__.py | Anne-kj/keyboard-design | fa177bdf0add737e41274394bdc880ce511af216 | [
"MIT"
] | null | null | null | lib/spelling_type/__init__.py | Anne-kj/keyboard-design | fa177bdf0add737e41274394bdc880ce511af216 | [
"MIT"
] | null | null | null | from lib.constants import alphabet
from lib.spelling_type.heatmap import draw_heatmap_by_key_number_dict
from lib.spelling_type.parameters.balance import cal_balance
from lib.spelling_type.parameters.efficiency.cal_efficiency import efficiency
from lib.spelling_type.parameters.efficiency.ck_ratio import cal_key_charact... | 40.102564 | 94 | 0.673274 | from lib.constants import alphabet
from lib.spelling_type.heatmap import draw_heatmap_by_key_number_dict
from lib.spelling_type.parameters.balance import cal_balance
from lib.spelling_type.parameters.efficiency.cal_efficiency import efficiency
from lib.spelling_type.parameters.efficiency.ck_ratio import cal_key_charact... | true | true |
1c2423a07cb149bff0db33651a50e8381518a3ee | 548 | py | Python | config.py | distmatters/eparDataDistribution | 394797e6408dfc24baa1bb532c7ccaeed13428a9 | [
"BSD-3-Clause"
] | 1 | 2022-02-23T21:03:38.000Z | 2022-02-23T21:03:38.000Z | config.py | distmatters/eparDataDistribution | 394797e6408dfc24baa1bb532c7ccaeed13428a9 | [
"BSD-3-Clause"
] | 12 | 2018-12-27T22:07:08.000Z | 2019-04-08T22:48:05.000Z | config.py | distmatters/eparDataDistribution | 394797e6408dfc24baa1bb532c7ccaeed13428a9 | [
"BSD-3-Clause"
] | 3 | 2019-07-11T12:11:57.000Z | 2020-09-15T13:19:13.000Z | # config.py
"""
Copyright 2018 Evans Policy Analysis and Research Group (EPAR)
This project is licensed under the 3-Clause BSD License. Please see the
license.txt file for more information.
"""
import os
class Config(object):
DEBUG = False
TESTING = False
CSRF_ENABLED = True
SECRET_KEY = ""
SQLALCHEMY_DATABASE... | 20.296296 | 72 | 0.770073 |
import os
class Config(object):
DEBUG = False
TESTING = False
CSRF_ENABLED = True
SECRET_KEY = ""
SQLALCHEMY_DATABASE_URI=os.environ['DATABASE_URI']
SQLALCHEMY_TRACK_MODIFICATIONS=False
class ProductionConfig(Config):
DEBUG = False
class DevelopmentConfig(Config):
DEBUG = True
TESTING = True
class Testi... | true | true |
1c2423c76a6d71c2e005b3c3b4dac2dcf787238d | 4,334 | py | Python | test/functional/p2p_invalid_block.py | KiPa-SuJi/PaydayCoin-Core | d807d95550d955bfa9ffda2b39cad745422224e5 | [
"MIT"
] | 2 | 2020-06-12T10:12:49.000Z | 2020-07-31T19:43:09.000Z | test/functional/p2p_invalid_block.py | KiPa-SuJi/PaydayCoin-Core | d807d95550d955bfa9ffda2b39cad745422224e5 | [
"MIT"
] | null | null | null | test/functional/p2p_invalid_block.py | KiPa-SuJi/PaydayCoin-Core | d807d95550d955bfa9ffda2b39cad745422224e5 | [
"MIT"
] | 1 | 2020-12-04T13:34:46.000Z | 2020-12-04T13:34:46.000Z | #!/usr/bin/env python3
# Copyright (c) 2015-2018 The PaydayCoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test node responses to invalid blocks.
In this test we connect to one node over p2p, and test block... | 39.4 | 116 | 0.686664 |
import copy
from test_framework.blocktools import create_block, create_coinbase, create_tx_with_script
from test_framework.messages import COIN
from test_framework.mininode import P2PDataStore
from test_framework.test_framework import PaydayCoinTestFramework
from test_framework.util import assert_equal
class Inva... | true | true |
1c24246f8f6386ef0d484d593e360f01a9941de7 | 9,519 | py | Python | qlib/contrib/model/pytorch_lstm.py | wegamekinglc/qlib | e0f02003c70064712445aa1a67e2cb83220f2b93 | [
"MIT"
] | 18 | 2021-12-17T12:09:53.000Z | 2022-02-03T12:42:43.000Z | qlib/contrib/model/pytorch_lstm.py | yilunchen27/qlib | 1bab07e419c9a6bc42f4f7bdcf86b6c922a1718b | [
"MIT"
] | 1 | 2021-05-16T14:17:56.000Z | 2021-05-19T07:07:20.000Z | qlib/contrib/model/pytorch_lstm.py | yilunchen27/qlib | 1bab07e419c9a6bc42f4f7bdcf86b6c922a1718b | [
"MIT"
] | 3 | 2021-03-03T14:20:50.000Z | 2021-12-02T17:08:10.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
from __future__ import division
from __future__ import print_function
import os
import numpy as np
import pandas as pd
import copy
from sklearn.metrics import roc_auc_score, mean_squared_error
import logging
from ...utils import (
unpack_ar... | 29.37963 | 112 | 0.552369 |
from __future__ import division
from __future__ import print_function
import os
import numpy as np
import pandas as pd
import copy
from sklearn.metrics import roc_auc_score, mean_squared_error
import logging
from ...utils import (
unpack_archive_with_buffer,
save_multiple_parts_file,
create_save_path,
... | true | true |
1c2426e7ca3e5548ec60d4e865e4d672325b8f1b | 709 | py | Python | app/models/news.py | farzana583/News-API | 68744239399e79bcd1fceb9d58e825982b359dbd | [
"Unlicense"
] | null | null | null | app/models/news.py | farzana583/News-API | 68744239399e79bcd1fceb9d58e825982b359dbd | [
"Unlicense"
] | null | null | null | app/models/news.py | farzana583/News-API | 68744239399e79bcd1fceb9d58e825982b359dbd | [
"Unlicense"
] | null | null | null | # class News:
# '''
# News source class to define sources' objects
# '''
# def __init__(self,id,name,description,url,category,country):
# self.id = id
# self.name = name
# self.description = description
# self.url = url
# self.category = category
# self.co... | 30.826087 | 88 | 0.589563 |
# News source class to define sources' objects
# '''
# def __init__(self,id,name,description,url,category,country):
# self.id = id
# self.name = name
# self.description = description
# self.url = url
# self.category = category
# self.country = country
# cl... | true | true |
1c2427a36609f75fa1906f5ede71e12ba7116456 | 562 | py | Python | kitsune/users/management/commands/purge_hashes.py | jgmize/kitsune | 8f23727a9c7fcdd05afc86886f0134fb08d9a2f0 | [
"BSD-3-Clause"
] | 2 | 2019-08-19T17:08:47.000Z | 2019-10-05T11:37:02.000Z | kitsune/users/management/commands/purge_hashes.py | jgmize/kitsune | 8f23727a9c7fcdd05afc86886f0134fb08d9a2f0 | [
"BSD-3-Clause"
] | null | null | null | kitsune/users/management/commands/purge_hashes.py | jgmize/kitsune | 8f23727a9c7fcdd05afc86886f0134fb08d9a2f0 | [
"BSD-3-Clause"
] | null | null | null | from datetime import datetime, timedelta
from django.contrib.auth.models import User
from django.contrib.auth.hashers import UNUSABLE_PASSWORD
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = 'Purge old hashed passwords.'
def handle(self, *args, **kw):
old = dat... | 33.058824 | 57 | 0.725979 | from datetime import datetime, timedelta
from django.contrib.auth.models import User
from django.contrib.auth.hashers import UNUSABLE_PASSWORD
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = 'Purge old hashed passwords.'
def handle(self, *args, **kw):
old = dat... | false | true |
1c2428903d1616344954ad6f29f8e755c6c9508e | 1,191 | py | Python | acxDataProcessor/entities/NameEntity.py | etbrow/dsapi-hashed-pii-example | 9d6bb367c82173ece97b587d5498f24964dadce1 | [
"MIT"
] | 1 | 2021-02-11T23:16:05.000Z | 2021-02-11T23:16:05.000Z | acxDataProcessor/entities/NameEntity.py | etbrow/dsapi-hashed-pii-example | 9d6bb367c82173ece97b587d5498f24964dadce1 | [
"MIT"
] | null | null | null | acxDataProcessor/entities/NameEntity.py | etbrow/dsapi-hashed-pii-example | 9d6bb367c82173ece97b587d5498f24964dadce1 | [
"MIT"
] | 2 | 2021-02-12T13:40:17.000Z | 2022-02-21T08:07:56.000Z | class NameEntity:
def __init__(self, firstName, middleName, lastName, generationalSuffix):
self.firstName = firstName
self.middleName = middleName
self.lastName = lastName
self.generationalSuffix = generationalSuffix
#Making sure that we have at least a first + last name
def... | 33.083333 | 106 | 0.588581 | class NameEntity:
def __init__(self, firstName, middleName, lastName, generationalSuffix):
self.firstName = firstName
self.middleName = middleName
self.lastName = lastName
self.generationalSuffix = generationalSuffix
def isEligibleForDsapi(self):
if not self.firstNa... | true | true |
1c242a6ca8f56848bb1904d4633bfb08d897e989 | 1,914 | py | Python | gimbaled_thrust/gimbal_ctrl/servo_controller/ServoController.py | RobertYL/aurora | 387172bfa5ccc7a55ec7f3b68f4c06eb1e9ed36a | [
"MIT"
] | null | null | null | gimbaled_thrust/gimbal_ctrl/servo_controller/ServoController.py | RobertYL/aurora | 387172bfa5ccc7a55ec7f3b68f4c06eb1e9ed36a | [
"MIT"
] | null | null | null | gimbaled_thrust/gimbal_ctrl/servo_controller/ServoController.py | RobertYL/aurora | 387172bfa5ccc7a55ec7f3b68f4c06eb1e9ed36a | [
"MIT"
] | 1 | 2022-01-27T04:05:51.000Z | 2022-01-27T04:05:51.000Z | import RPi.GPIO as GPIO
import time
import warnings
import math
try:
# Get monotonic time to ensure that time deltas are always positive
_current_time = time.monotonic
except AttributeError:
# time.monotonic() not available (using python < 3.3), fallback to time.time()
_current_time = time.time
war... | 31.9 | 155 | 0.608673 | import RPi.GPIO as GPIO
import time
import warnings
import math
try:
_current_time = time.monotonic
except AttributeError:
_current_time = time.time
warnings.warn('time.monotonic() not available in python < 3.3, using time.time() as fallback')
class ServoController(object):
def __init__(
... | true | true |
1c242b71f87f1b53f3f71e2c9d2427c5c3e865ba | 5,596 | py | Python | nova/tests/virt/hyperv/test_volumeutilsv2.py | vmthunder/nova | baf05caab705c5778348d9f275dc541747b7c2de | [
"Apache-2.0"
] | 1 | 2015-11-25T10:18:22.000Z | 2015-11-25T10:18:22.000Z | nova/tests/virt/hyperv/test_volumeutilsv2.py | vmthunder/nova | baf05caab705c5778348d9f275dc541747b7c2de | [
"Apache-2.0"
] | 9 | 2015-05-20T11:20:17.000Z | 2017-07-27T08:21:33.000Z | nova/tests/virt/hyperv/test_volumeutilsv2.py | vmthunder/nova | baf05caab705c5778348d9f275dc541747b7c2de | [
"Apache-2.0"
] | 13 | 2015-05-05T09:34:04.000Z | 2017-11-08T02:03:46.000Z | # Copyright 2014 Cloudbase Solutions Srl
#
# 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 ... | 37.810811 | 79 | 0.684596 |
import mock
from oslo.config import cfg
from nova import test
from nova.virt.hyperv import vmutils
from nova.virt.hyperv import volumeutilsv2
CONF = cfg.CONF
CONF.import_opt('volume_attach_retry_count', 'nova.virt.hyperv.volumeops',
'hyperv')
class VolumeUtilsV2TestCase(test.NoDBTestCa... | true | true |
1c242c221f9322ecd0a02810bb69e37fab4a1b65 | 2,665 | py | Python | src/ope/deep_gmm/oadam/optimizer_utils.py | liyuan9988/IVOPEwithACME | d77fab09b2e1cb8d3dbd8b2ab88adcce6a853558 | [
"MIT"
] | 1 | 2020-09-05T01:25:39.000Z | 2020-09-05T01:25:39.000Z | src/ope/deep_gmm/oadam/optimizer_utils.py | liyuan9988/IVOPEwithACME | d77fab09b2e1cb8d3dbd8b2ab88adcce6a853558 | [
"MIT"
] | null | null | null | src/ope/deep_gmm/oadam/optimizer_utils.py | liyuan9988/IVOPEwithACME | d77fab09b2e1cb8d3dbd8b2ab88adcce6a853558 | [
"MIT"
] | null | null | null | """Utils for OAdam optimizers.
Copied from: sonnet/v2/src/optimizers/optimizer_utils.py
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from typing import Sequence
import tensorflow.compat.v2 as tf
from src.ope.deep_gmm.oadam import replicator
from s... | 37.535211 | 80 | 0.717824 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from typing import Sequence
import tensorflow.compat.v2 as tf
from src.ope.deep_gmm.oadam import replicator
from src.ope.deep_gmm.oadam import types
_SUPPORTED_STRATEGIES = (
tf.distribute.OneDevice... | true | true |
1c242d0e5b77ac783d729c61d27e857702c8f3cf | 5,737 | py | Python | conjureup/app_config.py | stefb965/conjure-up | 62d272ce82645109899c7e2a7a7ece0cc2bd3fc6 | [
"MIT"
] | null | null | null | conjureup/app_config.py | stefb965/conjure-up | 62d272ce82645109899c7e2a7a7ece0cc2bd3fc6 | [
"MIT"
] | null | null | null | conjureup/app_config.py | stefb965/conjure-up | 62d272ce82645109899c7e2a7a7ece0cc2bd3fc6 | [
"MIT"
] | null | null | null | """ application config
"""
import json
from types import SimpleNamespace
bootstrap = SimpleNamespace(
# Is bootstrap running
running=False,
# Attached output
output=None
)
maas = SimpleNamespace(
# Client
client=None,
# API key
api_key=None,
# API Endpoint
endpoint=None
)
j... | 25.497778 | 79 | 0.587241 | import json
from types import SimpleNamespace
bootstrap = SimpleNamespace(
running=False,
output=None
)
maas = SimpleNamespace(
client=None,
api_key=None,
endpoint=None
)
juju = SimpleNamespace(
client=None,
authenticated=False
)
class AppConfig:
... | true | true |
1c242ee7263943361f5cc131ad4cab5de7596fc2 | 2,009 | py | Python | code_for_3D/plot_eig.py | yuyingyeh/isospectralization-pytorch | 48317133b8bb57e57a8ecd73b3bc93ba374d0d60 | [
"MIT"
] | 1 | 2021-02-21T05:08:10.000Z | 2021-02-21T05:08:10.000Z | code_for_2D/plot_eig.py | yuyingyeh/isospectralization-pytorch | 48317133b8bb57e57a8ecd73b3bc93ba374d0d60 | [
"MIT"
] | null | null | null | code_for_2D/plot_eig.py | yuyingyeh/isospectralization-pytorch | 48317133b8bb57e57a8ecd73b3bc93ba374d0d60 | [
"MIT"
] | 2 | 2020-03-21T05:27:11.000Z | 2020-06-15T08:03:05.000Z | """Plot the eigenvalue sequences stored in a txt file."""
import argparse
import numpy as np
from matplotlib import pyplot as plt
# Configure Matplotlib
plt.rc("figure", titleweight="bold", dpi=100)
plt.rc("font", family="serif")
plt.rc("axes", labelweight="bold", linewidth=1.5, titleweight="bold")
plt.rc("xtick", di... | 34.637931 | 83 | 0.666501 | import argparse
import numpy as np
from matplotlib import pyplot as plt
plt.rc("figure", titleweight="bold", dpi=100)
plt.rc("font", family="serif")
plt.rc("axes", labelweight="bold", linewidth=1.5, titleweight="bold")
plt.rc("xtick", direction="in")
plt.rc("ytick", direction="in")
def parse_args():
parser = a... | true | true |
1c242f84a0a7bf835b4cf9575c9653e634022190 | 3,026 | py | Python | third_party/rules_cuda/check_cuda_libs.py | storypku/bazel-galaxy | 2e2a3303af6d1b2dced3f330559fd173ca793052 | [
"Apache-2.0"
] | null | null | null | third_party/rules_cuda/check_cuda_libs.py | storypku/bazel-galaxy | 2e2a3303af6d1b2dced3f330559fd173ca793052 | [
"Apache-2.0"
] | null | null | null | third_party/rules_cuda/check_cuda_libs.py | storypku/bazel-galaxy | 2e2a3303af6d1b2dced3f330559fd173ca793052 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 35.6 | 85 | 0.667217 |
import os
import os.path
import subprocess
import sys
try:
from shutil import which
except ImportError:
from distutils.spawn import find_executable as which
class ConfigError(Exception):
pass
def check_cuda_lib(path, check_soname=True):
if not os.path.isfile(path):
raise Con... | true | true |
1c243039cae247f614b7ae011d300e9355facf60 | 729 | py | Python | cloudflare/caches.py | darylyu/cloudflare | be12ac9fa614a7078a89d7036f3a99e3165bd99d | [
"BSD-3-Clause"
] | 1 | 2015-05-03T12:51:44.000Z | 2015-05-03T12:51:44.000Z | cloudflare/caches.py | darylyu/cloudflare | be12ac9fa614a7078a89d7036f3a99e3165bd99d | [
"BSD-3-Clause"
] | 2 | 2015-12-17T00:47:01.000Z | 2016-04-04T14:24:14.000Z | cloudflare/caches.py | darylyu/cloudflare | be12ac9fa614a7078a89d7036f3a99e3165bd99d | [
"BSD-3-Clause"
] | 3 | 2015-09-13T22:43:54.000Z | 2016-04-02T19:44:21.000Z | # -*- coding: utf-8 -*-
from .http_client import CloudFlareClient
def purge(url):
cfc = CloudFlareClient()
response = cfc.purge_cache(url)
msg = ''
if response['success']:
msg = 'Successful!'
else:
for error in response['errors']:
msg += 'ERROR: (%s) %s\n' % (error['cod... | 26.035714 | 73 | 0.556927 |
from .http_client import CloudFlareClient
def purge(url):
cfc = CloudFlareClient()
response = cfc.purge_cache(url)
msg = ''
if response['success']:
msg = 'Successful!'
else:
for error in response['errors']:
msg += 'ERROR: (%s) %s\n' % (error['code'], error['message'])
... | true | true |
1c2432a05007c2d265314975f085e33f7a04c77a | 12,653 | py | Python | test/test_dataset.py | jturner65/habitat-api | b54dd6eb4a7d99762f326d1a78035600c4e57929 | [
"MIT"
] | 489 | 2019-02-21T21:47:40.000Z | 2020-08-10T06:43:24.000Z | test/test_dataset.py | jturner65/habitat-api | b54dd6eb4a7d99762f326d1a78035600c4e57929 | [
"MIT"
] | 380 | 2019-02-26T00:50:48.000Z | 2020-08-11T14:57:07.000Z | test/test_dataset.py | jturner65/habitat-api | b54dd6eb4a7d99762f326d1a78035600c4e57929 | [
"MIT"
] | 167 | 2019-02-26T00:38:30.000Z | 2020-08-09T23:07:10.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from itertools import groupby, islice
import pytest
from habitat.core.dataset import Dataset, Episode
from habitat.tas... | 33.385224 | 79 | 0.674939 |
from itertools import groupby, islice
import pytest
from habitat.core.dataset import Dataset, Episode
from habitat.tasks.nav.nav import NavigationEpisode, NavigationGoal
def _construct_dataset(num_episodes, num_groups=10):
episodes = []
for i in range(num_episodes):
episode = Episode(
... | true | true |
1c2433248b619229a0d8661c43cd9b4ff81ab083 | 9,374 | py | Python | froide/publicbody/migrations/0003_auto__add_publicbodytopic.py | rufuspollock/froide | 8ef4dbdd54a74f8c986d59e90348dfdbd85c5da4 | [
"MIT"
] | null | null | null | froide/publicbody/migrations/0003_auto__add_publicbodytopic.py | rufuspollock/froide | 8ef4dbdd54a74f8c986d59e90348dfdbd85c5da4 | [
"MIT"
] | null | null | null | froide/publicbody/migrations/0003_auto__add_publicbodytopic.py | rufuspollock/froide | 8ef4dbdd54a74f8c986d59e90348dfdbd85c5da4 | [
"MIT"
] | null | null | null | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'PublicBodyTopic'
db.create_table('publicbody_publicbodytopic', (
('id', self.g... | 74.992 | 196 | 0.567527 |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
db.create_table('publicbody_publicbodytopic', (
('id', self.gf('django.db.models.fields.AutoField')(primary_ke... | true | true |
1c243340554176e79348f4055327b6c451d5e94b | 5,017 | py | Python | jax/experimental/callback.py | nirum/jax | 3f8c73593d41d4d6711f71851890e2e1ada6063f | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2019-04-03T03:11:55.000Z | 2020-05-21T18:01:51.000Z | jax/experimental/callback.py | nirum/jax | 3f8c73593d41d4d6711f71851890e2e1ada6063f | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2019-08-15T18:22:52.000Z | 2019-08-20T18:19:42.000Z | jax/experimental/callback.py | nirum/jax | 3f8c73593d41d4d6711f71851890e2e1ada6063f | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2019-05-03T02:06:16.000Z | 2019-05-03T02:06:16.000Z | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 30.969136 | 79 | 0.719554 |
import numpy as onp
from typing import Any, Callable, Dict, Optional, Sequence, Tuple, Union
import jax.numpy as np
from jax import core
from jax.core import Trace, Tracer, new_master
from jax import linear_util as lu
from jax.util import partial, safe_map, wrap_name
from jax.interpreters import xla
fro... | true | true |
1c243343031060ea945d5b29a0e4f34df042e96f | 127 | py | Python | lang/py/cookbook/v2/source/cb2_6_0_exm_8.py | ch1huizong/learning | 632267634a9fd84a5f5116de09ff1e2681a6cc85 | [
"MIT"
] | null | null | null | lang/py/cookbook/v2/source/cb2_6_0_exm_8.py | ch1huizong/learning | 632267634a9fd84a5f5116de09ff1e2681a6cc85 | [
"MIT"
] | null | null | null | lang/py/cookbook/v2/source/cb2_6_0_exm_8.py | ch1huizong/learning | 632267634a9fd84a5f5116de09ff1e2681a6cc85 | [
"MIT"
] | null | null | null | class Subclass(Behave):
def once(self): print '(%s)' % self.name
subInstance = Subclass("Queen Bee")
subInstance.repeat(3)
| 25.4 | 44 | 0.700787 | class Subclass(Behave):
def once(self): print '(%s)' % self.name
subInstance = Subclass("Queen Bee")
subInstance.repeat(3)
| false | true |
1c2434aa3aa29477b48c4b3d0b087938d79cce67 | 459 | py | Python | pyleecan/Methods/Slot/Slot/comp_surface.py | IrakozeFD/pyleecan | 5a93bd98755d880176c1ce8ac90f36ca1b907055 | [
"Apache-2.0"
] | 95 | 2019-01-23T04:19:45.000Z | 2022-03-17T18:22:10.000Z | pyleecan/Methods/Slot/Slot/comp_surface.py | IrakozeFD/pyleecan | 5a93bd98755d880176c1ce8ac90f36ca1b907055 | [
"Apache-2.0"
] | 366 | 2019-02-20T07:15:08.000Z | 2022-03-31T13:37:23.000Z | pyleecan/Methods/Slot/Slot/comp_surface.py | IrakozeFD/pyleecan | 5a93bd98755d880176c1ce8ac90f36ca1b907055 | [
"Apache-2.0"
] | 74 | 2019-01-24T01:47:31.000Z | 2022-02-25T05:44:42.000Z | # -*- coding: utf-8 -*-
def comp_surface(self, Ndisc=200):
"""Compute the Slot total surface (by numerical computation).
Caution, the bottom of the Slot is an Arc
Parameters
----------
self : Slot
A Slot object
Ndisc : int
Number of point to discretize the lines
Returns
... | 19.956522 | 65 | 0.586057 |
def comp_surface(self, Ndisc=200):
surf = self.get_surface()
return surf.comp_surface(Ndisc=Ndisc)
| true | true |
1c2435279f0442361358868fb4f5446424a8049d | 12,196 | py | Python | sdk/python/pulumi_alicloud/mns/topic.py | pulumi/pulumi-alicloud | 9c34d84b4588a7c885c6bec1f03b5016e5a41683 | [
"ECL-2.0",
"Apache-2.0"
] | 42 | 2019-03-18T06:34:37.000Z | 2022-03-24T07:08:57.000Z | sdk/python/pulumi_alicloud/mns/topic.py | pulumi/pulumi-alicloud | 9c34d84b4588a7c885c6bec1f03b5016e5a41683 | [
"ECL-2.0",
"Apache-2.0"
] | 152 | 2019-04-15T21:03:44.000Z | 2022-03-29T18:00:57.000Z | sdk/python/pulumi_alicloud/mns/topic.py | pulumi/pulumi-alicloud | 9c34d84b4588a7c885c6bec1f03b5016e5a41683 | [
"ECL-2.0",
"Apache-2.0"
] | 3 | 2020-08-26T17:30:07.000Z | 2021-07-05T01:37:45.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | 48.015748 | 274 | 0.662676 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
__all__ = ['TopicArgs', 'Topic']
@pulumi.input_type
class TopicArgs:
def __init__(__self__, *,
logging_enabled: Optional[pulumi.Input[bool]] = Non... | true | true |
1c2435419377808802e41e8a82f12a1d802f77e2 | 18,179 | py | Python | hdwell2/simulator.py | x94carbone/hdwell | 3f3726edd815f82df0a72f7e22cb681032f774d9 | [
"BSD-3-Clause"
] | null | null | null | hdwell2/simulator.py | x94carbone/hdwell | 3f3726edd815f82df0a72f7e22cb681032f774d9 | [
"BSD-3-Clause"
] | null | null | null | hdwell2/simulator.py | x94carbone/hdwell | 3f3726edd815f82df0a72f7e22cb681032f774d9 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
__author__ = "Matthew R. Carbone & Marco Baity-Jesi"
__maintainer__ = "Matthew R. Carbone"
__email__ = "x94carbone@gmail.com"
__status__ = "Prototype"
"""Core simulation."""
import numpy as np
import sys
from time import time
from collections import Counter
from math import floor
import hdwel... | 41.694954 | 79 | 0.64503 |
__author__ = "Matthew R. Carbone & Marco Baity-Jesi"
__maintainer__ = "Matthew R. Carbone"
__email__ = "x94carbone@gmail.com"
__status__ = "Prototype"
import numpy as np
import sys
from time import time
from collections import Counter
from math import floor
import hdwell2.auxiliary as aux
def simulate(nMC_lg, N,... | true | true |
1c24357b091abaf80411cea4194955591502c58c | 683 | py | Python | extensions/ping.py | hiway/spritzbot | 678ac922a70e65d1411f57c464a8c7167840bc71 | [
"BSD-2-Clause"
] | 7 | 2015-01-12T20:29:31.000Z | 2016-08-16T13:03:56.000Z | extensions/ping.py | hiway/spritzbot | 678ac922a70e65d1411f57c464a8c7167840bc71 | [
"BSD-2-Clause"
] | null | null | null | extensions/ping.py | hiway/spritzbot | 678ac922a70e65d1411f57c464a8c7167840bc71 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import random
def process_mention(status, settings):
print status.user.screen_name,':', status.text.encode('utf-8')
text = status.text.lower().replace('@'+settings.username, '').strip()
responses = {
'ping':'pong',
'pong':u'err…',
'k':'kk',
'kk':'kkk... | 28.458333 | 73 | 0.528551 |
import random
def process_mention(status, settings):
print status.user.screen_name,':', status.text.encode('utf-8')
text = status.text.lower().replace('@'+settings.username, '').strip()
responses = {
'ping':'pong',
'pong':u'err…',
'k':'kk',
'kk':'kkk',
'kkk':'kkkk'... | false | true |
1c2435ffb62dbaae800d3511da8ea16ceb870857 | 2,579 | py | Python | api/test/api/responders_test/test_data/links.py | korenlev/calipso-cvim | 39278a5cf09c40b26a8a143ccc0c8d437961abc2 | [
"Apache-2.0"
] | null | null | null | api/test/api/responders_test/test_data/links.py | korenlev/calipso-cvim | 39278a5cf09c40b26a8a143ccc0c8d437961abc2 | [
"Apache-2.0"
] | null | null | null | api/test/api/responders_test/test_data/links.py | korenlev/calipso-cvim | 39278a5cf09c40b26a8a143ccc0c8d437961abc2 | [
"Apache-2.0"
] | null | null | null | ###############################################################################
# Copyright (c) 2017-2020 Koren Lev (Cisco Systems), #
# Yaron Yogev (Cisco Systems), Ilia Abashin (Cisco Systems) and others #
# #
... | 28.340659 | 79 | 0.562621 | true | true | |
1c243621d309764c15c637a5e2083c62deedd7c8 | 17,489 | py | Python | sdk/python/pulumi_azure_native/network/v20190701/virtual_router.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20190701/virtual_router.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20190701/virtual_router.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 45.782723 | 2,020 | 0.660415 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . import outputs
from ._inputs import *
__all__ = ['VirtualRouterArgs', 'VirtualRouter']
@pulumi.input_type
class VirtualRouterArgs:
def __init__(__self__, *... | true | true |
1c243631d276917d166530cc7f8079a126290c94 | 11,206 | py | Python | mne/gui/tests/test_coreg_gui.py | csliuwei/mne-python | 0e67ce63990117756ff3f63caecb43e4b37c153f | [
"BSD-3-Clause"
] | 1 | 2020-11-05T21:30:15.000Z | 2020-11-05T21:30:15.000Z | mne/gui/tests/test_coreg_gui.py | csliuwei/mne-python | 0e67ce63990117756ff3f63caecb43e4b37c153f | [
"BSD-3-Clause"
] | 1 | 2020-10-29T19:55:08.000Z | 2020-10-29T19:55:08.000Z | mne/gui/tests/test_coreg_gui.py | csliuwei/mne-python | 0e67ce63990117756ff3f63caecb43e4b37c153f | [
"BSD-3-Clause"
] | 1 | 2020-01-07T03:16:59.000Z | 2020-01-07T03:16:59.000Z | # Author: Christian Brodbeck <christianbrodbeck@nyu.edu>
#
# License: BSD (3-clause)
import os
import os.path as op
import re
import shutil
import sys
from unittest import SkipTest
import numpy as np
from numpy.testing import (assert_allclose, assert_equal,
assert_array_almost_equal)
import... | 34.06079 | 79 | 0.683473 |
import os
import os.path as op
import re
import shutil
import sys
from unittest import SkipTest
import numpy as np
from numpy.testing import (assert_allclose, assert_equal,
assert_array_almost_equal)
import pytest
import mne
from mne.datasets import testing
from mne.io.kit.tests import ... | true | true |
1c2437f55e0c7856534f34baa1b14b48f0dc71dd | 792 | py | Python | src/systems of linear equations/gaussian_elimination.py | djeada/Numerical-Methodes | 45a5288f4719568a62a82374efbb3fc06d33ec46 | [
"MIT"
] | null | null | null | src/systems of linear equations/gaussian_elimination.py | djeada/Numerical-Methodes | 45a5288f4719568a62a82374efbb3fc06d33ec46 | [
"MIT"
] | null | null | null | src/systems of linear equations/gaussian_elimination.py | djeada/Numerical-Methodes | 45a5288f4719568a62a82374efbb3fc06d33ec46 | [
"MIT"
] | null | null | null | import numpy as np
def gaussian_elimination(a, b):
n = len(a)
m = n + 1
for row, element in zip(a, b):
row.append(element)
if len(row) != m:
raise ValueError("You have to provide a square matrix")
for i in range(n):
if a[i][i] == 0.0:
raise ZeroDivisi... | 20.307692 | 80 | 0.425505 | import numpy as np
def gaussian_elimination(a, b):
n = len(a)
m = n + 1
for row, element in zip(a, b):
row.append(element)
if len(row) != m:
raise ValueError("You have to provide a square matrix")
for i in range(n):
if a[i][i] == 0.0:
raise ZeroDivisi... | true | true |
1c24384adff836ed2c56e83dc7cd2790627b722c | 13,432 | py | Python | volatility/framework/automagic/stacker.py | fengjixuchui/volatility3 | 8d3cc1dc1e6e301798aac1072b77cadecfc16091 | [
"Linux-OpenIB"
] | 3 | 2021-05-31T19:43:14.000Z | 2021-08-02T00:09:26.000Z | volatility/framework/automagic/stacker.py | fengjixuchui/volatility3 | 8d3cc1dc1e6e301798aac1072b77cadecfc16091 | [
"Linux-OpenIB"
] | null | null | null | volatility/framework/automagic/stacker.py | fengjixuchui/volatility3 | 8d3cc1dc1e6e301798aac1072b77cadecfc16091 | [
"Linux-OpenIB"
] | null | null | null | # This file is Copyright 2019 Volatility Foundation and licensed under the Volatility Software License 1.0
# which is available at https://www.volatilityfoundation.org/license/vsl-v1.0
#
"""This module attempts to automatically stack layers.
This automagic module fulfills :class:`~volatility.framework.interfaces.confi... | 51.267176 | 163 | 0.666915 |
import logging
import sys
import traceback
from typing import Any, List, Optional, Tuple, Type
from volatility import framework
from volatility.framework import interfaces, constants
from volatility.framework.automagic import construct_layers
from volatility.framework.configuration import requirements
from volatil... | true | true |
1c24389bafc232f72c71db0ba5242ccb146a49c8 | 1,469 | py | Python | python/cugraph/cugraph/experimental/__init__.py | betochimas/cugraph | 7100fd5d47577ca90b83c986620415d1a45fe999 | [
"Apache-2.0"
] | null | null | null | python/cugraph/cugraph/experimental/__init__.py | betochimas/cugraph | 7100fd5d47577ca90b83c986620415d1a45fe999 | [
"Apache-2.0"
] | null | null | null | python/cugraph/cugraph/experimental/__init__.py | betochimas/cugraph | 7100fd5d47577ca90b83c986620415d1a45fe999 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2022, NVIDIA CORPORATION.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 48.966667 | 86 | 0.850919 |
from cugraph.utilities.api_tools import experimental_warning_wrapper
from cugraph.structure.property_graph import EXPERIMENTAL__PropertyGraph
PropertyGraph = experimental_warning_wrapper(EXPERIMENTAL__PropertyGraph)
from cugraph.structure.property_graph import EXPERIMENTAL__PropertySelection
PropertySele... | true | true |
1c2439d4dcfca709ea617fdf134aa6e65d532a7d | 399 | py | Python | musicbrainz/wsgi.py | wt3c/musicbrainz | 05a074bcb8cd04192419e54ed5a3ce9dd8492bdf | [
"MIT"
] | null | null | null | musicbrainz/wsgi.py | wt3c/musicbrainz | 05a074bcb8cd04192419e54ed5a3ce9dd8492bdf | [
"MIT"
] | 17 | 2019-07-03T21:19:59.000Z | 2022-02-10T10:32:47.000Z | musicbrainz/wsgi.py | wt3c/musicbrainz | 05a074bcb8cd04192419e54ed5a3ce9dd8492bdf | [
"MIT"
] | null | null | null | """
WSGI config for musicbrainz project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_S... | 23.470588 | 78 | 0.789474 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'musicbrainz.settings')
application = get_wsgi_application()
| true | true |
1c243a531f4d38a1a3bc1d792b2d7c4d9b57972f | 99 | py | Python | blog/errors/__init__.py | leni1/microblog | d51f47618b3eb446e351f3d3ae493cb6a5a15d45 | [
"MIT"
] | null | null | null | blog/errors/__init__.py | leni1/microblog | d51f47618b3eb446e351f3d3ae493cb6a5a15d45 | [
"MIT"
] | null | null | null | blog/errors/__init__.py | leni1/microblog | d51f47618b3eb446e351f3d3ae493cb6a5a15d45 | [
"MIT"
] | null | null | null | from flask import Blueprint
bp = Blueprint('errors', __name__)
from blog.errors import handlers
| 14.142857 | 34 | 0.777778 | from flask import Blueprint
bp = Blueprint('errors', __name__)
from blog.errors import handlers
| true | true |
1c243b203be15eb1925eea95f769946dba124668 | 1,820 | py | Python | example/example.py | DickerDackel/tinyecs | 9ec27bd70d23ccdda43923bc145d9a1c9029dcb9 | [
"MIT"
] | null | null | null | example/example.py | DickerDackel/tinyecs | 9ec27bd70d23ccdda43923bc145d9a1c9029dcb9 | [
"MIT"
] | null | null | null | example/example.py | DickerDackel/tinyecs | 9ec27bd70d23ccdda43923bc145d9a1c9029dcb9 | [
"MIT"
] | null | null | null | import tinyecs as ecs
from dataclasses import dataclass
# Let's see, if the object will be destroyed if it's removed from the
# registry at the end
def destructor(self):
print(f'Descructor of {self} called')
ecs.Entity.__del__ = destructor
@dataclass
class Position:
x: float
y: float
@dataclass
class V... | 29.354839 | 97 | 0.682967 | import tinyecs as ecs
from dataclasses import dataclass
def destructor(self):
print(f'Descructor of {self} called')
ecs.Entity.__del__ = destructor
@dataclass
class Position:
x: float
y: float
@dataclass
class Velocity:
dx: float
dy: float
ten_seconds_walker = ecs.Entity(
('name', '10 Se... | true | true |
1c243c4cc9e29659c6510c741f22a36192c80d9d | 24,447 | py | Python | hpcc-nagios-tools/hpcc_centralized_nagios.py | hpcc-systems/nagios-monitoring | 5d842ce9329524b1a5f88302d6328124eb051998 | [
"Apache-2.0"
] | 2 | 2017-06-30T23:50:09.000Z | 2019-10-12T03:58:25.000Z | hpcc-nagios-tools/hpcc_centralized_nagios.py | hpcc-systems/nagios-monitoring | 5d842ce9329524b1a5f88302d6328124eb051998 | [
"Apache-2.0"
] | 29 | 2015-01-21T16:22:17.000Z | 2020-09-30T19:17:35.000Z | hpcc-nagios-tools/hpcc_centralized_nagios.py | hpcc-systems/nagios-monitoring | 5d842ce9329524b1a5f88302d6328124eb051998 | [
"Apache-2.0"
] | 6 | 2016-12-23T15:15:23.000Z | 2022-01-01T11:49:42.000Z | #!/usr/bin/env python3
##############################################################################
# HPCC SYSTEMS software Copyright (C) 2015 HPCC Systems.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtai... | 38.743265 | 166 | 0.566941 |
nt('eclscheduler = '), eclscheduler, '\n'
print('Number of schedulers = '), len(eclscheduler), '\n'
print('esp = '), esp, '\n'
print('Number of ESP Servers = '), len(esp), '\n'
print('Roxie = '), roxie, '\n'
print('Number of Roxie Servers = '), len(roxie), '\n'
print('ThorMaster = ', thormaster[0], '\n')
print('Numbe... | true | true |
1c243ce7f7f5866f61dee5ab6c21f00cf8362ac3 | 20,963 | py | Python | salt/_modules/metalk8s_drain.py | SaintLoong/metalk8s | 06fa3a731f35ab0f9ad8d3443fd8f8c4e7037432 | [
"Apache-2.0"
] | 23 | 2018-03-16T09:06:46.000Z | 2018-08-02T00:02:07.000Z | salt/_modules/metalk8s_drain.py | SaintLoong/metalk8s | 06fa3a731f35ab0f9ad8d3443fd8f8c4e7037432 | [
"Apache-2.0"
] | 131 | 2018-03-13T07:31:34.000Z | 2018-08-02T21:57:18.000Z | salt/_modules/metalk8s_drain.py | SaintLoong/metalk8s | 06fa3a731f35ab0f9ad8d3443fd8f8c4e7037432 | [
"Apache-2.0"
] | 4 | 2018-04-03T07:18:39.000Z | 2018-07-02T22:56:56.000Z | """
Module for draining a Kubernetes node.
This implementation is based on the go code of `kubectl`, for more details see
https://github.com/kubernetes/kubernetes/blob/v1.11.10/pkg/kubectl/cmd/drain.go
This module's functions are merged into the `metalk8s_kubernetes`
module when called by salt by virtue of its `__vir... | 33.975689 | 88 | 0.59605 |
import json
import logging
import operator
import time
from salt.exceptions import CommandExecutionError
try:
import kubernetes
from kubernetes.client.rest import ApiException
from kubernetes.client.models.v1_object_meta import V1ObjectMeta
from kubernetes.client.models.v1beta1_eviction import V1beta... | true | true |
1c243cfd686ecc8c061d36a9a1785577413f1db3 | 800 | py | Python | deepdrive/utils/utils.py | braceal/DeepDriveMD | 5d8ae5016a6bb172fa0188a78b8d2b14ebb754fd | [
"MIT"
] | 3 | 2020-02-07T21:35:48.000Z | 2020-12-23T01:44:49.000Z | deepdrive/utils/utils.py | braceal/DeepDriveMD | 5d8ae5016a6bb172fa0188a78b8d2b14ebb754fd | [
"MIT"
] | 5 | 2019-11-02T05:29:55.000Z | 2020-05-06T04:20:24.000Z | deepdrive/utils/utils.py | braceal/DeepDriveMD | 5d8ae5016a6bb172fa0188a78b8d2b14ebb754fd | [
"MIT"
] | 1 | 2020-12-07T12:26:01.000Z | 2020-12-07T12:26:01.000Z | def get_id(filename, prefix, ext):
"""
Given a path to a file in the form of <path>/<prefix><id>.<ext>
returns <id>
Parameters
----------
filename : str
full path or basepath to `prefix` prefixed file name
with extension `ext`
prefix : str
prefix of file name
e... | 25.806452 | 72 | 0.595 | def get_id(filename, prefix, ext):
if prefix not in filename:
raise Exception(f'prefix: {prefix} not in filename: {filename}')
if ext not in filename:
raise Exception(f'ext: {ext} not in filename: {filename}')
return filename.split(prefix)[1].split(ext)[0][:-1]
| true | true |
1c243f1bb8bb687e4963b4ff01799a4c156a3ea4 | 15,249 | py | Python | test_fuzzywuzzy.py | brandomr/fuzzywuzzy | 5f0eb1b9517600a3fb59fb0233904789683a11ae | [
"MIT"
] | 1 | 2015-05-30T03:45:17.000Z | 2015-05-30T03:45:17.000Z | test_fuzzywuzzy.py | devil-gkz/fuzzywuzzy | 5f0eb1b9517600a3fb59fb0233904789683a11ae | [
"MIT"
] | null | null | null | test_fuzzywuzzy.py | devil-gkz/fuzzywuzzy | 5f0eb1b9517600a3fb59fb0233904789683a11ae | [
"MIT"
] | 1 | 2020-03-24T19:08:42.000Z | 2020-03-24T19:08:42.000Z | # -*- coding: utf8 -*-
from __future__ import unicode_literals
import unittest
import re
import sys
from fuzzywuzzy import fuzz
from fuzzywuzzy import process
from fuzzywuzzy import utils
from fuzzywuzzy.string_processing import StringProcessor
if sys.version_info[0] == 3:
unicode = str
if sys.version_info[:2] =... | 33.662252 | 99 | 0.611384 |
from __future__ import unicode_literals
import unittest
import re
import sys
from fuzzywuzzy import fuzz
from fuzzywuzzy import process
from fuzzywuzzy import utils
from fuzzywuzzy.string_processing import StringProcessor
if sys.version_info[0] == 3:
unicode = str
if sys.version_info[:2] == (2, 6):
def... | true | true |
1c2441f6df21a953d588d80e780c30e14c032ba0 | 33,034 | py | Python | policyglass/policy_shard.py | etta-trust/PolicyGlass | 72157189a9af3172e6efbdcc2050969796cfa99f | [
"MIT"
] | 49 | 2021-12-21T23:15:55.000Z | 2022-03-28T09:38:30.000Z | policyglass/policy_shard.py | etta-trust/PolicyGlass | 72157189a9af3172e6efbdcc2050969796cfa99f | [
"MIT"
] | 3 | 2021-12-23T22:02:02.000Z | 2022-01-10T14:16:24.000Z | policyglass/policy_shard.py | etta-trust/PolicyGlass | 72157189a9af3172e6efbdcc2050969796cfa99f | [
"MIT"
] | 1 | 2022-02-22T11:03:27.000Z | 2022-02-22T11:03:27.000Z | """PolicyShards are a simplified representation of policies."""
import json
from typing import Any, DefaultDict, Dict, Iterable, Iterator, List, Optional, Tuple
from pydantic import BaseModel
from .action import Action, EffectiveAction
from .condition import EffectiveCondition
from .effective_arp import EffectiveARP... | 44.520216 | 120 | 0.614034 |
import json
from typing import Any, DefaultDict, Dict, Iterable, Iterator, List, Optional, Tuple
from pydantic import BaseModel
from .action import Action, EffectiveAction
from .condition import EffectiveCondition
from .effective_arp import EffectiveARP
from .principal import EffectivePrincipal, Principal
from .reso... | true | true |
1c2442735ac784c4633e3d34f05f9c7451ce7614 | 5,376 | py | Python | rts/python/scalar.py | CulpaBS/wbBach | 1e2defc8d8ef8612b1f8684af55d433747c22ae6 | [
"BSD-3-Clause"
] | null | null | null | rts/python/scalar.py | CulpaBS/wbBach | 1e2defc8d8ef8612b1f8684af55d433747c22ae6 | [
"BSD-3-Clause"
] | 3 | 2016-02-29T13:19:59.000Z | 2016-03-14T14:40:49.000Z | rts/python/scalar.py | CulpaBS/wbBach | 1e2defc8d8ef8612b1f8684af55d433747c22ae6 | [
"BSD-3-Clause"
] | null | null | null | # Scalar functions.
import numpy as np
def signed(x):
if type(x) == np.uint8:
return np.int8(x)
elif type(x) == np.uint16:
return np.int16(x)
elif type(x) == np.uint32:
return np.int32(x)
else:
return np.int64(x)
def unsigned(x):
if type(x) == np.int8:
return np.uint8(x)
elif type(x) ... | 20.059701 | 79 | 0.697173 |
import numpy as np
def signed(x):
if type(x) == np.uint8:
return np.int8(x)
elif type(x) == np.uint16:
return np.int16(x)
elif type(x) == np.uint32:
return np.int32(x)
else:
return np.int64(x)
def unsigned(x):
if type(x) == np.int8:
return np.uint8(x)
elif type(x) == np.int16:
re... | true | true |
1c244291f4e7060199ec0a4c5e11d41a96a1ba25 | 1,811 | py | Python | nodes/SmartPlugNode.py | albrandwood/udi-poly-kasa | 2fa87570eaabd7246dff7975e06c959244e6d16c | [
"MIT"
] | null | null | null | nodes/SmartPlugNode.py | albrandwood/udi-poly-kasa | 2fa87570eaabd7246dff7975e06c959244e6d16c | [
"MIT"
] | null | null | null | nodes/SmartPlugNode.py | albrandwood/udi-poly-kasa | 2fa87570eaabd7246dff7975e06c959244e6d16c | [
"MIT"
] | null | null | null | #
# TP Link Kasa Smart Bulb Node
#
# This code is used for bulbs
#
import polyinterface
from kasa import SmartPlug,SmartDeviceException
from nodes import SmartDeviceNode
LOGGER = polyinterface.LOGGER
class SmartPlugNode(SmartDeviceNode):
def __init__(self, controller, address, name, cfg=None, dev=None):
... | 28.296875 | 81 | 0.542794 |
import polyinterface
from kasa import SmartPlug,SmartDeviceException
from nodes import SmartDeviceNode
LOGGER = polyinterface.LOGGER
class SmartPlugNode(SmartDeviceNode):
def __init__(self, controller, address, name, cfg=None, dev=None):
self.debug_level = 0
self.name = name
... | true | true |
1c244299cf206eb6b32b57869f66b0a0b1d72847 | 603 | py | Python | silver/api/__init__.py | truehostcloud/silver | dd60ea476f0c7c6055df32669fcba9f0bf70d8da | [
"Apache-2.0"
] | null | null | null | silver/api/__init__.py | truehostcloud/silver | dd60ea476f0c7c6055df32669fcba9f0bf70d8da | [
"Apache-2.0"
] | null | null | null | silver/api/__init__.py | truehostcloud/silver | dd60ea476f0c7c6055df32669fcba9f0bf70d8da | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2015 Presslabs SRL
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | 37.6875 | 74 | 0.756219 |
__version__ = "0.1.2"
| true | true |
1c2442d4cabc759a5fe7d9aae13e81a388e80a60 | 9,752 | py | Python | src/ralph/scan/plugins/puppet.py | quamilek/ralph | bf7231ea096924332b874718b33cd1f43f9c783b | [
"Apache-2.0"
] | null | null | null | src/ralph/scan/plugins/puppet.py | quamilek/ralph | bf7231ea096924332b874718b33cd1f43f9c783b | [
"Apache-2.0"
] | null | null | null | src/ralph/scan/plugins/puppet.py | quamilek/ralph | bf7231ea096924332b874718b33cd1f43f9c783b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import random
import thread
import time
import MySQLdb
import requests
import sqlalchemy as sqla
import yaml
from django.conf import settings
... | 31.356913 | 77 | 0.607465 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import random
import thread
import time
import MySQLdb
import requests
import sqlalchemy as sqla
import yaml
from django.conf import settings
from ralph.discovery.mo... | true | true |
1c24448a2841f402b75b1e5fb0b4050e04c359b4 | 790 | py | Python | PaddleFSL/test/backbones/relationnet_test.py | tianxin1860/FSL-Mate | 74dde9a3e1f789ec92710b9ecdf9c5b060d26fd3 | [
"MIT"
] | 982 | 2020-04-14T09:26:05.000Z | 2021-08-16T12:11:37.000Z | PaddleFSL/test/backbones/relationnet_test.py | gaorui999/FSL-Mate | b490c795f4aaf2c4a86b56721481d48f7c3aadfc | [
"MIT"
] | 10 | 2021-08-19T11:19:38.000Z | 2022-03-16T02:55:13.000Z | PaddleFSL/test/backbones/relationnet_test.py | gaorui999/FSL-Mate | b490c795f4aaf2c4a86b56721481d48f7c3aadfc | [
"MIT"
] | 185 | 2020-04-14T09:26:08.000Z | 2021-08-16T02:16:18.000Z | import paddle
from paddlefsl.backbones import ConvEmbedModel, ConvRelationModel
def conv_embed_model_test():
train_input = paddle.ones(shape=(1, 1, 28, 28), dtype='float32')
embed_model = ConvEmbedModel(input_size=(1, 28, 28), num_filters=64)
print(embed_model.output_size) # (64, 7, 7)
print(embed_mo... | 35.909091 | 96 | 0.706329 | import paddle
from paddlefsl.backbones import ConvEmbedModel, ConvRelationModel
def conv_embed_model_test():
train_input = paddle.ones(shape=(1, 1, 28, 28), dtype='float32')
embed_model = ConvEmbedModel(input_size=(1, 28, 28), num_filters=64)
print(embed_model.output_size)
print(embed_model(train_in... | true | true |
1c2446209a34211a7b77a5c1b21da75d238571fb | 8,567 | py | Python | tests/devices/test_jjpro_jpd01_dehumidifier.py | Chris061290/tuya-local | a158a6b4c6752f55ea0da83b3af98ec89ffc827f | [
"MIT"
] | null | null | null | tests/devices/test_jjpro_jpd01_dehumidifier.py | Chris061290/tuya-local | a158a6b4c6752f55ea0da83b3af98ec89ffc827f | [
"MIT"
] | null | null | null | tests/devices/test_jjpro_jpd01_dehumidifier.py | Chris061290/tuya-local | a158a6b4c6752f55ea0da83b3af98ec89ffc827f | [
"MIT"
] | null | null | null | from homeassistant.components.binary_sensor import BinarySensorDeviceClass
from homeassistant.components.fan import SUPPORT_SET_SPEED
from homeassistant.components.humidifier import SUPPORT_MODES
from homeassistant.components.sensor import SensorDeviceClass
from homeassistant.const import (
PERCENTAGE,
TI... | 33.33463 | 82 | 0.562274 | from homeassistant.components.binary_sensor import BinarySensorDeviceClass
from homeassistant.components.fan import SUPPORT_SET_SPEED
from homeassistant.components.humidifier import SUPPORT_MODES
from homeassistant.components.sensor import SensorDeviceClass
from homeassistant.const import (
PERCENTAGE,
TI... | true | true |
1c244678f0979b707865b2e7faf7e8028bb2f681 | 8,484 | py | Python | zerver/webhooks/sentry/view.py | simpsonme1/zulip | 1bfa429d95043a47677d590e5a75ba9d4ee4c4b4 | [
"Apache-2.0"
] | 2 | 2021-02-02T01:29:32.000Z | 2021-02-02T01:30:51.000Z | zerver/webhooks/sentry/view.py | simpsonme1/zulip | 1bfa429d95043a47677d590e5a75ba9d4ee4c4b4 | [
"Apache-2.0"
] | null | null | null | zerver/webhooks/sentry/view.py | simpsonme1/zulip | 1bfa429d95043a47677d590e5a75ba9d4ee4c4b4 | [
"Apache-2.0"
] | null | null | null | import logging
from datetime import datetime
from typing import Any, Dict, List, Optional, Tuple
from urllib.parse import urljoin
from django.http import HttpRequest, HttpResponse
from zerver.decorator import webhook_view
from zerver.lib.exceptions import UnsupportedWebhookEventType
from zerver.lib.request import REQ... | 31.775281 | 103 | 0.630481 | import logging
from datetime import datetime
from typing import Any, Dict, List, Optional, Tuple
from urllib.parse import urljoin
from django.http import HttpRequest, HttpResponse
from zerver.decorator import webhook_view
from zerver.lib.exceptions import UnsupportedWebhookEventType
from zerver.lib.request import REQ... | true | true |
1c24469a078d0601102daf09db427ba78f80cab1 | 7,028 | py | Python | autogluon/utils/tabular/ml/tuning/ensemble_selection.py | zhanghang1989/autogluon | 8bfe6b0da8915020eeb9895fd18d7688c0d604c1 | [
"Apache-2.0"
] | 1 | 2020-08-14T16:09:59.000Z | 2020-08-14T16:09:59.000Z | autogluon/utils/tabular/ml/tuning/ensemble_selection.py | zhanghang1989/autogluon | 8bfe6b0da8915020eeb9895fd18d7688c0d604c1 | [
"Apache-2.0"
] | null | null | null | autogluon/utils/tabular/ml/tuning/ensemble_selection.py | zhanghang1989/autogluon | 8bfe6b0da8915020eeb9895fd18d7688c0d604c1 | [
"Apache-2.0"
] | null | null | null | import logging, time
import numpy as np
from collections import Counter
from ..constants import PROBLEM_TYPES
from ...metrics import calculate_score, _ProbaScorer, _ThresholdScorer
from ..utils import get_pred_from_proba
logger = logging.getLogger(__name__)
class EnsembleSelection:
def __init__(
sel... | 42.083832 | 198 | 0.617957 | import logging, time
import numpy as np
from collections import Counter
from ..constants import PROBLEM_TYPES
from ...metrics import calculate_score, _ProbaScorer, _ThresholdScorer
from ..utils import get_pred_from_proba
logger = logging.getLogger(__name__)
class EnsembleSelection:
def __init__(
sel... | true | true |
1c2446f94b1038e9787db9664412bd96999c0f54 | 13,563 | py | Python | gooddata-metadata-client/gooddata_metadata_client/model/json_api_workspace_data_filter_patch.py | hkad98/gooddata-python-sdk | 64942080ecb44c2d8e914e57f7a591daa6cca205 | [
"MIT"
] | null | null | null | gooddata-metadata-client/gooddata_metadata_client/model/json_api_workspace_data_filter_patch.py | hkad98/gooddata-python-sdk | 64942080ecb44c2d8e914e57f7a591daa6cca205 | [
"MIT"
] | null | null | null | gooddata-metadata-client/gooddata_metadata_client/model/json_api_workspace_data_filter_patch.py | hkad98/gooddata-python-sdk | 64942080ecb44c2d8e914e57f7a591daa6cca205 | [
"MIT"
] | null | null | null | """
OpenAPI definition
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v0
Contact: support@gooddata.com
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sy... | 44.762376 | 136 | 0.57561 |
import re
import sys
from gooddata_metadata_client.model_utils import (
ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_i... | true | true |
1c2447ad99bafaaf40edabd9c9ff1620a2a170fd | 4,754 | py | Python | speedtest.py | mithrendal/multipeer | da1a78a4588fece62e063a5422bfe3d68ac5ea96 | [
"Unlicense"
] | null | null | null | speedtest.py | mithrendal/multipeer | da1a78a4588fece62e063a5422bfe3d68ac5ea96 | [
"Unlicense"
] | null | null | null | speedtest.py | mithrendal/multipeer | da1a78a4588fece62e063a5422bfe3d68ac5ea96 | [
"Unlicense"
] | null | null | null | import ui
#from .BaseDelegate import BaseDelegate
import multipeer
import objc_util
import console
from objc_util import *
from timeit import default_timer as timer
UIDevice = ObjCClass('UIDevice')
class thePeer(multipeer.MultipeerConnectivity):
pingcount=0
durchschnitt=0
def __init__(self, parent):
dn=UIDevice.... | 27.639535 | 90 | 0.676483 | import ui
import multipeer
import objc_util
import console
from objc_util import *
from timeit import default_timer as timer
UIDevice = ObjCClass('UIDevice')
class thePeer(multipeer.MultipeerConnectivity):
pingcount=0
durchschnitt=0
def __init__(self, parent):
dn=UIDevice.currentDevice().name()
super().__init... | true | true |
1c24484639811b162dc84861469ca57015160adb | 2,896 | py | Python | postprocessor.py | johnbanq/minecraft-symbol-analyzer | b8147d9ac44fc8e3bfd60c8a1b9a7a1d77113717 | [
"MIT"
] | 1 | 2020-06-17T06:34:40.000Z | 2020-06-17T06:34:40.000Z | postprocessor.py | johnbanq/minecraft-symbol-analyzer | b8147d9ac44fc8e3bfd60c8a1b9a7a1d77113717 | [
"MIT"
] | null | null | null | postprocessor.py | johnbanq/minecraft-symbol-analyzer | b8147d9ac44fc8e3bfd60c8a1b9a7a1d77113717 | [
"MIT"
] | null | null | null | from class_assembler import assemble_class_def
from my_analyzer.analysis_result import AnalysisResult,AnalysisClass,FunctionDecl,Virtualness,VariableDecl,SimpleSymbolDecl
import os.path
import pickle
def prefix_classify_factory(prefix):
return lambda clazz: clazz.name.startswith(prefix)
post_processors = ... | 29.252525 | 124 | 0.608425 | from class_assembler import assemble_class_def
from my_analyzer.analysis_result import AnalysisResult,AnalysisClass,FunctionDecl,Virtualness,VariableDecl,SimpleSymbolDecl
import os.path
import pickle
def prefix_classify_factory(prefix):
return lambda clazz: clazz.name.startswith(prefix)
post_processors = ... | true | true |
1c24484b2134e23d7b22e848906d9b6e6d48beb5 | 406 | py | Python | testcode/test_dependent.py | ppant/Python-Architecture-Patterns | a9c4d1e7d3fc037cd11903378c3b93814fcd6e16 | [
"MIT"
] | null | null | null | testcode/test_dependent.py | ppant/Python-Architecture-Patterns | a9c4d1e7d3fc037cd11903378c3b93814fcd6e16 | [
"MIT"
] | null | null | null | testcode/test_dependent.py | ppant/Python-Architecture-Patterns | a9c4d1e7d3fc037cd11903378c3b93814fcd6e16 | [
"MIT"
] | 1 | 2022-02-01T12:38:45.000Z | 2022-02-01T12:38:45.000Z | from dependent import parameter_dependent
def test_negative():
assert parameter_dependent(-1) == 0
def test_zero():
assert parameter_dependent(0) == 0
def test_twenty_five():
assert parameter_dependent(25) == 5
def test_hundred():
assert parameter_dependent(100) =... | 9.666667 | 42 | 0.652709 | from dependent import parameter_dependent
def test_negative():
assert parameter_dependent(-1) == 0
def test_zero():
assert parameter_dependent(0) == 0
def test_twenty_five():
assert parameter_dependent(25) == 5
def test_hundred():
assert parameter_dependent(100) =... | true | true |
1c2448d29f457c400f727ebab3a1f0e17cce71b4 | 404 | py | Python | classwork/01/hourglass.py | erodrago/golclinics-dsa | 0ddf282de45c50a5be59d0a293009cd28945d2e2 | [
"MIT"
] | null | null | null | classwork/01/hourglass.py | erodrago/golclinics-dsa | 0ddf282de45c50a5be59d0a293009cd28945d2e2 | [
"MIT"
] | null | null | null | classwork/01/hourglass.py | erodrago/golclinics-dsa | 0ddf282de45c50a5be59d0a293009cd28945d2e2 | [
"MIT"
] | null | null | null | def hourglassSum(arr):
result = []
n = len(arr)
for i in range(n-2):
for j in range(n-2):
total = sum(arr[i][j:j+3]) + arr[i+1][j+1] + sum(arr[i+2][j:j+3])
result.append(total)
return max(result)
arr = [[1, 1, 1, 0, 0, 0],
[0, 1, 0, 0, 0, 0],
[1, 1, 1, 0, 0, 0],
[... | 20.2 | 77 | 0.44802 | def hourglassSum(arr):
result = []
n = len(arr)
for i in range(n-2):
for j in range(n-2):
total = sum(arr[i][j:j+3]) + arr[i+1][j+1] + sum(arr[i+2][j:j+3])
result.append(total)
return max(result)
arr = [[1, 1, 1, 0, 0, 0],
[0, 1, 0, 0, 0, 0],
[1, 1, 1, 0, 0, 0],
[... | true | true |
1c2449ece4e864e92488b600adbdb4c43e1f1dca | 94 | py | Python | No.py | carolinacastiglia/AP2_aula13_repositorio_carolina | ef28a016b9866bb89a2c0f5cfe9827846e09882c | [
"MIT"
] | null | null | null | No.py | carolinacastiglia/AP2_aula13_repositorio_carolina | ef28a016b9866bb89a2c0f5cfe9827846e09882c | [
"MIT"
] | null | null | null | No.py | carolinacastiglia/AP2_aula13_repositorio_carolina | ef28a016b9866bb89a2c0f5cfe9827846e09882c | [
"MIT"
] | null | null | null | class No:
def __init__(self, dado):
self.dado = dado
self.anterior = None | 18.8 | 29 | 0.574468 | class No:
def __init__(self, dado):
self.dado = dado
self.anterior = None | true | true |
1c244a09f5ba0b00475789d346bab8e4c55e7cd0 | 909 | py | Python | django/contrib/redirects/models.py | egenerat/gae-django | f12379483cf3917ed3cb46ca5ff0b94daf89fc50 | [
"MIT"
] | 3 | 2016-07-08T23:49:32.000Z | 2018-04-15T22:55:01.000Z | django/contrib/redirects/models.py | egenerat/gae-django | f12379483cf3917ed3cb46ca5ff0b94daf89fc50 | [
"MIT"
] | 27 | 2017-02-05T15:57:04.000Z | 2018-04-15T22:57:26.000Z | django/contrib/redirects/models.py | egenerat/gae-django | f12379483cf3917ed3cb46ca5ff0b94daf89fc50 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.sites.models import Site
from django.utils.translation import ugettext_lazy as _
class Redirect(models.Model):
site = models.ForeignKey(Site)
old_path = models.CharField(_('redirect from'), max_length=200, db_index=True,
help_text=_("This should b... | 43.285714 | 112 | 0.658966 | from django.db import models
from django.contrib.sites.models import Site
from django.utils.translation import ugettext_lazy as _
class Redirect(models.Model):
site = models.ForeignKey(Site)
old_path = models.CharField(_('redirect from'), max_length=200, db_index=True,
help_text=_("This should b... | true | true |
1c244a0abdfb9e8bc236b686b9134ee801e0598e | 526 | py | Python | CSGraphQLAPIDeployScripts/websphere/Jython/exportLTPAKeys.py | ibm-ecm/-ibm-content-platform-engine-samples | a551eee17ab0e1337bf0ec0cb158854a99f4b791 | [
"RSA-MD",
"IBM-pibs"
] | null | null | null | CSGraphQLAPIDeployScripts/websphere/Jython/exportLTPAKeys.py | ibm-ecm/-ibm-content-platform-engine-samples | a551eee17ab0e1337bf0ec0cb158854a99f4b791 | [
"RSA-MD",
"IBM-pibs"
] | null | null | null | CSGraphQLAPIDeployScripts/websphere/Jython/exportLTPAKeys.py | ibm-ecm/-ibm-content-platform-engine-samples | a551eee17ab0e1337bf0ec0cb158854a99f4b791 | [
"RSA-MD",
"IBM-pibs"
] | 3 | 2020-11-05T01:40:54.000Z | 2021-06-14T11:47:06.000Z | #/*
# IBM Confidential
# OCO Source Materials
# 5737-I23
# Copyright IBM Corp. 2021
# The source code for this program is not published or otherwise divested of its trade secrets, irrespective of what has been deposited with the U.S Copyright Office.
# */
import java
#replace values for the following vars to match you... | 30.941176 | 166 | 0.745247 |
import java
ltpaKeyFile= sys.argv[0]
password= sys.argv[1]
AdminTask.exportLTPAKeys('[ -ltpaKeyFile file:' + ltpaKeyFile + ' -password ' + password + ']')
| true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.